From f8aea83fb2243e499c30ec552dbad08cc81a526c Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 28 Jan 2024 11:59:03 +0000 Subject: [PATCH] Auto-generated commit --- dist/index.js | 2 +- dist/index.js.map | 8 +- strided/chisquare/README.md | 375 +++++ .../benchmark/benchmark.float32.broadcast.js | 100 ++ .../chisquare/benchmark/benchmark.float32.js | 100 ++ .../benchmark/benchmark.float64.broadcast.js | 100 ++ .../chisquare/benchmark/benchmark.float64.js | 100 ++ .../benchmark/benchmark.generic.broadcast.js | 100 ++ .../chisquare/benchmark/benchmark.generic.js | 100 ++ strided/chisquare/docs/repl.txt | 203 +++ strided/chisquare/docs/types/index.d.ts | 208 +++ strided/chisquare/docs/types/test.ts | 255 +++ strided/chisquare/examples/index.js | 54 + strided/chisquare/lib/factory.js | 64 + strided/chisquare/lib/index.js | 63 + strided/chisquare/lib/main.js | 54 + strided/chisquare/package.json | 77 + strided/chisquare/test/test.factory.js | 1476 +++++++++++++++++ strided/chisquare/test/test.js | 74 + strided/chisquare/test/test.main.js | 176 ++ strided/chisquare/test/test.ndarray.js | 176 ++ strided/lib/index.js | 9 + 22 files changed, 3869 insertions(+), 5 deletions(-) create mode 100644 strided/chisquare/README.md create mode 100644 strided/chisquare/benchmark/benchmark.float32.broadcast.js create mode 100644 strided/chisquare/benchmark/benchmark.float32.js create mode 100644 strided/chisquare/benchmark/benchmark.float64.broadcast.js create mode 100644 strided/chisquare/benchmark/benchmark.float64.js create mode 100644 strided/chisquare/benchmark/benchmark.generic.broadcast.js create mode 100644 strided/chisquare/benchmark/benchmark.generic.js create mode 100644 strided/chisquare/docs/repl.txt create mode 100644 strided/chisquare/docs/types/index.d.ts create mode 100644 strided/chisquare/docs/types/test.ts create mode 100644 strided/chisquare/examples/index.js create mode 100644 strided/chisquare/lib/factory.js create mode 100644 strided/chisquare/lib/index.js create mode 100644 strided/chisquare/lib/main.js create mode 100644 strided/chisquare/package.json create mode 100644 strided/chisquare/test/test.factory.js create mode 100644 strided/chisquare/test/test.js create mode 100644 strided/chisquare/test/test.main.js create mode 100644 strided/chisquare/test/test.ndarray.js diff --git a/dist/index.js b/dist/index.js index 6c13a298..de8c2856 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 Zh=s(function(h5e,Hh){"use strict";var S$=require("@stdlib/assert/is-plain-object"),O$=require("@stdlib/assert/has-own-property"),E$=require("@stdlib/array/base/assert/contains"),Yh=require("@stdlib/string/format");function _$(r,e,t){return S$(t)?O$(t,"dtype")&&(r.dtype=t.dtype,!E$(e,r.dtype))?new TypeError(Yh('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),r.dtype)):null:new TypeError(Yh("invalid argument. Options argument must be an object. Value: `%s`.",t))}Hh.exports=_$});var ep=s(function(p5e,Kh){"use strict";var Qh=require("@stdlib/utils/define-nonenumerable-read-only-property"),N$=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,L$=require("@stdlib/assert/is-function"),R$=require("@stdlib/assert/is-string-array").primitives,P$=require("@stdlib/assert/is-collection"),T$=require("@stdlib/array/base/assert/contains"),j$=require("@stdlib/array/base/filled-by"),$h=require("@stdlib/strided/base/binary"),M$=require("@stdlib/array/ctors"),Ws=require("@stdlib/string/format"),x$=Zh();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(!R$(e))throw new TypeError(Ws("invalid argument. Second argument must be an array of strings. Value: `%s`.",e));if(!T$(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}Qh(Is.prototype,"generate",function(e,t,i,n){var a,u,o,v,g,c;if(!N$(e))throw new TypeError(Ws("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if(u={},arguments.length>3&&(g=x$(u,this._dtypes,n),g))throw g;if(o=this._prng,c=u.dtype||this._dtype,c==="generic")return j$(e,l);return a=M$(c),v=new a(e),$h([[t],[i],v],[e],[0,0,1],o),v;function l(){return o(t,i)}});Qh(Is.prototype,"assign",function(e,t,i){if(!P$(i))throw new TypeError(Ws("invalid argument. Third argument must be an array-like object. Value: `%s`.",i));return $h([[e],[t],i],[i.length],[0,0,1],this._prng),i});Kh.exports=Is});var tp=s(function(y5e,rp){"use strict";var A$=ep();rp.exports=A$});var ap=s(function(q5e,np){"use strict";var G$=require("@stdlib/assert/is-plain-object"),V$=require("@stdlib/assert/has-own-property"),F$=require("@stdlib/array/base/assert/contains"),ip=require("@stdlib/string/format");function W$(r,e,t){return G$(t)?V$(t,"dtype")&&(r.dtype=t.dtype,!F$(e,r.dtype))?new TypeError(ip('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),r.dtype)):null:new TypeError(ip("invalid argument. Options argument must be an object. Value: `%s`.",t))}np.exports=W$});var vp=s(function(b5e,op){"use strict";var sp=require("@stdlib/utils/define-nonenumerable-read-only-property"),I$=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,k$=require("@stdlib/assert/is-function"),z$=require("@stdlib/assert/is-string-array").primitives,J$=require("@stdlib/assert/is-collection"),U$=require("@stdlib/array/base/assert/contains"),C$=require("@stdlib/array/base/filled-by"),up=require("@stdlib/strided/base/nullary"),B$=require("@stdlib/array/ctors"),ks=require("@stdlib/string/format"),D$=ap();function zs(r,e,t){if(!(this instanceof zs))return new zs(r,e,t);if(!k$(r))throw new TypeError(ks("invalid argument. First argument must be a function. Value: `%s`.",r));if(!z$(e))throw new TypeError(ks("invalid argument. Second argument must be an array of strings. Value: `%s`.",e));if(!U$(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}sp(zs.prototype,"generate",function(e,t){var i,n,a,u,o;if(!I$(e))throw new TypeError(ks("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if(n={},arguments.length>1&&(u=D$(n,this._dtypes,t),u))throw u;return o=n.dtype||this._dtype,o==="generic"?C$(e,this._prng):(i=B$(o),a=new i(e),up([a],[e],[1],this._prng),a)});sp(zs.prototype,"assign",function(e){if(!J$(e))throw new TypeError(ks("invalid argument. First argument must be an array-like object. Value: `%s`.",e));return up([e],[e.length],[1],this._prng),e});op.exports=zs});var _u=s(function(w5e,gp){"use strict";var X$=vp();gp.exports=X$});var cp=s(function(S5e,lp){"use strict";var fp=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Nu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),oa=require("@stdlib/utils/define-nonenumerable-read-only-property"),Y$=require("@stdlib/assert/is-string-array").primitives,H$=require("@stdlib/assert/is-function"),Z$=require("@stdlib/assert/is-method-in"),Q$=require("@stdlib/assert/has-own-property"),dp=require("@stdlib/array/base/assert/contains").factory,$$=require("@stdlib/utils/constant-function"),K$=require("@stdlib/utils/noop"),eK=tp(),rK=_u(),Js=require("@stdlib/string/format");function tK(r,e,t){var i;if(!H$(r))throw new TypeError(Js("invalid argument. First argument must be a function. Value: `%s`.",r));if(!Z$(r,"factory"))throw new TypeError(Js("invalid argument. First argument must have a `%s` method.","factory"));if(!Y$(e))throw new TypeError(Js("invalid argument. Second argument must an array of strings. Value: `%s`.",e));if(!dp(e,t))throw new TypeError(Js("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return i=dp(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),Q$(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=eK):(g=q,a=rK),u=new a(l,e,p),m&&m.prng?(oa(h,"seed",null),oa(h,"seedLength",null),fp(h,"state",$$(null),K$),oa(h,"stateLength",null),oa(h,"byteLength",null)):(Nu(h,"seed",b),Nu(h,"seedLength",w),fp(h,"state",J,x),Nu(h,"stateLength",S),Nu(h,"byteLength",W)),oa(h,"PRNG",l.PRNG),oa(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}}}lp.exports=tK});var F=s(function(O5e,mp){"use strict";var iK=cp();mp.exports=iK});var xd=s(function(E5e,hp){"use strict";var nK=require("@stdlib/constants/uint32/max"),aK=require("@stdlib/math/base/special/floor"),sK=nK-1;function uK(){var r=aK(1+sK*Math.random());return r>>>0}hp.exports=uK});var zd=s(function(_5e,Lp){"use strict";var Ar=require("@stdlib/utils/define-nonenumerable-read-only-property"),ft=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),pp=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ad=require("@stdlib/assert/has-own-property"),oK=require("@stdlib/assert/is-plain-object"),vK=require("@stdlib/assert/is-collection"),yp=require("@stdlib/assert/is-uint32array"),gK=require("@stdlib/assert/is-boolean").isPrimitive,qp=require("@stdlib/assert/is-positive-integer").isPrimitive,Ep=require("@stdlib/constants/float64/max-safe-integer"),_p=require("@stdlib/constants/uint32/max"),U=require("@stdlib/array/uint32"),fK=require("@stdlib/math/base/special/max"),kd=require("@stdlib/math/base/ops/umul"),va=require("@stdlib/blas/base/gcopy"),dK=require("@stdlib/array/to-json"),B=require("@stdlib/string/format"),bp=xd(),I=624,Gd=397,wp=_p>>>0,lK=19650218,Vd=2147483648,Fd=2147483647,cK=1812433253,mK=1664525,hK=1566083941,pK=2636928640,yK=4022730752,qK=2567483615,Wd=[0,qK>>>0],Np=1/(Ep+1),bK=67108864,wK=2147483648,Id=1,SK=Ep*Np,Lu=1,Ru=3,dt=2,lt=I+3,C=I+5,Us=I+6;function Sp(r,e){var t;return e?t="option":t="argument",r.length>>0,i=1;i>>0,t=(t^t>>>30)>>>0,r[i]=kd(t,cK)+i>>>0;return r}function OK(r,e,t,i){var n,a,u,o;for(a=1,u=0,o=fK(e,i);o>0;o--)n=r[a-1]>>>0,n=(n^n>>>30)>>>0,n=kd(n,mK)>>>0,r[a]=(r[a]>>>0^n)+t[u]+u>>>0,a+=1,u+=1,a>=e&&(r[0]=r[e-1],a=1),u>=i&&(u=0);for(o=e-1;o>0;o--)n=r[a-1]>>>0,n=(n^n>>>30)>>>0,n=kd(n,hK)>>>0,r[a]=(r[a]>>>0^n)-a>>>0,a+=1,a>=e&&(r[0]=r[e-1],a=1);return r[0]=wK,r}function EK(r){var e,t,i,n;for(n=I-Gd,t=0;t>>1^Wd[e&Id];for(i=I-1;t>>1^Wd[e&Id];return e=r[i]&Vd|r[0]&Fd,r[i]=r[Gd-1]^e>>>1^Wd[e&Id],r}function _K(r){var e,t,i,n,a,u;if(i={},arguments.length){if(!oK(r))throw new TypeError(B("invalid argument. Options argument must be an object. Value: `%s`.",r));if(Ad(r,"copy")&&(i.copy=r.copy,!gK(r.copy)))throw new TypeError(B("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy));if(Ad(r,"state")){if(t=r.state,i.state=!0,!yp(t))throw new TypeError(B("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",t));if(u=Sp(t,!0),u)throw u;i.copy===!1?e=t:(e=new U(t.length),va(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(Ad(r,"seed"))if(n=r.seed,i.seed=!0,qp(n)){if(n>wp)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(vK(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],!qp(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>wp)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,va.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=Op(t,I,lK),t=OK(t,I,n,a)}else n=bp()>>>0}else n=bp()>>>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=Op(t,I,n)),Ar(p,"NAME","mt19937"),ft(p,"seed",o),ft(p,"seedLength",v),pp(p,"state",l,m),ft(p,"stateLength",g),ft(p,"byteLength",c),Ar(p,"toJSON",h),Ar(p,"MIN",0),Ar(p,"MAX",_p),Ar(p,"normalized",d),Ar(d,"NAME",p.NAME),ft(d,"seed",o),ft(d,"seedLength",v),pp(d,"state",l,m),ft(d,"stateLength",g),ft(d,"byteLength",c),Ar(d,"toJSON",h),Ar(d,"MIN",0),Ar(d,"MAX",SK),p;function o(){var f=e[C];return va(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 va(f,e,1,new U(f),1)}function m(f){var y;if(!yp(f))throw new TypeError(B("invalid argument. Must provide a Uint32Array. Value: `%s`.",f));if(y=Sp(f,!1),y)throw y;i.copy===!1?i.state&&f.length===e.length?va(f.length,f,1,e,1):(e=f,i.state=!0):(f.length!==e.length&&(e=new U(f.length)),va(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=dK(e),f.params=[],f}function p(){var f,y;return y=e[lt+1],y>=I&&(t=EK(t),y=0),f=t[y],e[lt+1]=y+1,f^=f>>>11,f^=f<<7&pK,f^=f<<15&yK,f^=f>>>18,f>>>0}function d(){var f=p()>>>5,y=p()>>>6;return(f*bK+y)*Np}}Lp.exports=_K});var Pp=s(function(N5e,Rp){"use strict";var NK=zd(),LK=xd(),RK=NK({seed:LK()});Rp.exports=RK});var T=s(function(L5e,jp){"use strict";var PK=require("@stdlib/utils/define-nonenumerable-read-only-property"),Tp=Pp(),TK=zd();PK(Tp,"factory",TK);jp.exports=Tp});var Gp=s(function(R5e,Ap){"use strict";var Mp=require("@stdlib/assert/is-number").isPrimitive,Jd=require("@stdlib/string/format"),xp=require("@stdlib/assert/is-nan");function jK(r,e){return!Mp(r)||xp(r)?new TypeError(Jd("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):!Mp(e)||xp(e)?new TypeError(Jd("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):r>=e?new RangeError(Jd("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e)):null}Ap.exports=jK});var Fp=s(function(P5e,Vp){"use strict";var MK=require("@stdlib/math/base/special/pow"),xK=require("@stdlib/math/base/special/sin"),AK=require("@stdlib/constants/float64/half-pi");function GK(r,e,t){return e+MK(xK(AK*r()),2)*(t-e)}Vp.exports=GK});var Ud=s(function(T5e,Bp){"use strict";var Gr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Pu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Wp=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ip=require("@stdlib/assert/is-plain-object"),kp=require("@stdlib/assert/is-function"),zp=require("@stdlib/assert/has-own-property"),Jp=require("@stdlib/utils/constant-function"),VK=require("@stdlib/utils/noop"),Tu=T().factory,Up=require("@stdlib/math/base/assert/is-nan"),FK=require("@stdlib/array/to-json"),ju=require("@stdlib/string/format"),WK=Gp(),Cp=Fp();function IK(){var r,e,t,i,n,a;if(arguments.length===0)e=Tu();else if(arguments.length===1){if(r=arguments[0],!Ip(r))throw new TypeError(ju("invalid argument. Options argument must be an object. Value: `%s`.",r));if(zp(r,"prng")){if(!kp(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=WK(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!Ip(r))throw new TypeError(ju("invalid argument. Options argument must be an object. Value: `%s`.",r));if(zp(r,"prng")){if(!kp(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),Wp(t,"state",Jp(null),VK),Gr(t,"stateLength",null),Gr(t,"byteLength",null),Gr(t,"toJSON",Jp(null)),Gr(t,"PRNG",e)):(Pu(t,"seed",u),Pu(t,"seedLength",o),Wp(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=FK(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return Cp(e,n,a)}function p(d,f){return Up(d)||Up(f)||d>=f?NaN:Cp(e,d,f)}}Bp.exports=IK});var Xp=s(function(j5e,Dp){"use strict";var kK=Ud(),zK=kK();Dp.exports=zK});var nn=s(function(M5e,Hp){"use strict";var JK=require("@stdlib/utils/define-nonenumerable-read-only-property"),Yp=Xp(),UK=Ud();JK(Yp,"factory",UK);Hp.exports=Yp});var Cd=s(function(x5e,Zp){"use strict";var CK=F(),BK=require("@stdlib/array/dtypes"),DK=require("@stdlib/array/defaults"),XK=nn(),YK=BK("real_floating_point_and_generic"),HK=CK(XK,YK,DK.get("dtypes.real_floating_point"));Zp.exports=HK});var $p=s(function(A5e,Qp){"use strict";var ZK=Cd(),QK=ZK();Qp.exports=QK});var ry=s(function(G5e,ey){"use strict";var $K=require("@stdlib/utils/define-nonenumerable-read-only-property"),Kp=$p(),KK=Cd();$K(Kp,"factory",KK);ey.exports=Kp});var ny=s(function(V5e,iy){"use strict";var eee=require("@stdlib/assert/is-plain-object"),ree=require("@stdlib/assert/has-own-property"),tee=require("@stdlib/array/base/assert/contains"),ty=require("@stdlib/string/format");function iee(r,e,t){return eee(t)?ree(t,"dtype")&&(r.dtype=t.dtype,!tee(e,r.dtype))?new TypeError(ty('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),r.dtype)):null:new TypeError(ty("invalid argument. Options argument must be an object. Value: `%s`.",t))}iy.exports=iee});var oy=s(function(F5e,uy){"use strict";var ay=require("@stdlib/utils/define-nonenumerable-read-only-property"),nee=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,aee=require("@stdlib/assert/is-function"),see=require("@stdlib/assert/is-string-array").primitives,uee=require("@stdlib/assert/is-collection"),oee=require("@stdlib/array/base/assert/contains"),vee=require("@stdlib/array/base/filled-by"),sy=require("@stdlib/strided/base/unary"),gee=require("@stdlib/array/ctors"),Cs=require("@stdlib/string/format"),fee=ny();function Bs(r,e,t){if(!(this instanceof Bs))return new Bs(r,e,t);if(!aee(r))throw new TypeError(Cs("invalid argument. First argument must be a function. Value: `%s`.",r));if(!see(e))throw new TypeError(Cs("invalid argument. Second argument must be an array of strings. Value: `%s`.",e));if(!oee(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}ay(Bs.prototype,"generate",function(e,t,i){var n,a,u,o,v,g;if(!nee(e))throw new TypeError(Cs("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if(a={},arguments.length>2&&(v=fee(a,this._dtypes,i),v))throw v;if(u=this._prng,g=a.dtype||this._dtype,g==="generic")return vee(e,c);return n=gee(g),o=new n(e),sy([[t],o],[e],[0,1],u),o;function c(){return u(t)}});ay(Bs.prototype,"assign",function(e,t){if(!uee(t))throw new TypeError(Cs("invalid argument. Second argument must be an array-like object. Value: `%s`.",t));return sy([[e],t],[t.length],[0,1],this._prng),t});uy.exports=Bs});var gy=s(function(W5e,vy){"use strict";var dee=oy();vy.exports=dee});var cy=s(function(I5e,ly){"use strict";var fy=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Mu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),ga=require("@stdlib/utils/define-nonenumerable-read-only-property"),lee=require("@stdlib/assert/is-string-array").primitives,cee=require("@stdlib/assert/is-function"),mee=require("@stdlib/assert/is-method-in"),hee=require("@stdlib/assert/is-plain-object"),pee=require("@stdlib/assert/has-own-property"),dy=require("@stdlib/array/base/assert/contains").factory,yee=require("@stdlib/utils/constant-function"),qee=require("@stdlib/utils/noop"),bee=gy(),wee=_u(),Ds=require("@stdlib/string/format");function See(r,e,t){var i;if(!cee(r))throw new TypeError(Ds("invalid argument. First argument must be a function. Value: `%s`.",r));if(!mee(r,"factory"))throw new TypeError(Ds("invalid argument. First argument must have a `%s` method.","factory"));if(!lee(e))throw new TypeError(Ds("invalid argument. Second argument must an array of strings. Value: `%s`.",e));if(!dy(e,t))throw new TypeError(Ds("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return i=dy(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):hee(arguments[0])?(l=arguments[0],c=r.factory(l),m=p):(o=arguments[0],l={},c=r.factory(o),m=d),pee(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=bee):(v=y,a=wee),u=new a(c,e,h),l&&l.prng?(ga(m,"seed",null),ga(m,"seedLength",null),fy(m,"state",yee(null),qee),ga(m,"stateLength",null),ga(m,"byteLength",null)):(Mu(m,"seed",q),Mu(m,"seedLength",b),fy(m,"state",W,J),Mu(m,"stateLength",w),Mu(m,"byteLength",S)),ga(m,"PRNG",c.PRNG),ga(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}}}ly.exports=See});var Vr=s(function(k5e,my){"use strict";var Oee=cy();my.exports=Oee});var Bd=s(function(z5e,wy){"use strict";var Fr=require("@stdlib/utils/define-nonenumerable-read-only-property"),xu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),hy=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),py=require("@stdlib/assert/is-plain-object"),Eee=require("@stdlib/assert/is-probability").isPrimitive,yy=require("@stdlib/assert/is-function"),qy=require("@stdlib/assert/has-own-property"),by=require("@stdlib/utils/constant-function"),_ee=require("@stdlib/utils/noop"),Au=T().factory,Nee=require("@stdlib/math/base/assert/is-nan"),Lee=require("@stdlib/array/to-json"),Gu=require("@stdlib/string/format");function Ree(){var r,e,t,i;if(arguments.length===0)e=Au();else if(arguments.length===1&&py(arguments[0]))if(r=arguments[0],qy(r,"prng")){if(!yy(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],!Eee(i))throw new TypeError(Gu("invalid argument. First argument must be a probability. Value: `%s`.",i));if(arguments.length>1){if(r=arguments[1],!py(r))throw new TypeError(Gu("invalid argument. Options argument must be an object. Value: `%s`.",r));if(qy(r,"prng")){if(!yy(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),hy(t,"state",by(null),_ee),Fr(t,"stateLength",null),Fr(t,"byteLength",null),Fr(t,"toJSON",by(null)),Fr(t,"PRNG",e)):(xu(t,"seed",n),xu(t,"seedLength",a),hy(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 Nee(h)||h<0||h>1?NaN:e()<=h?1:0}}wy.exports=Ree});var Oy=s(function(J5e,Sy){"use strict";var Pee=Bd(),Tee=Pee();Sy.exports=Tee});var an=s(function(U5e,_y){"use strict";var jee=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ey=Oy(),Mee=Bd();jee(Ey,"factory",Mee);_y.exports=Ey});var Dd=s(function(C5e,Ny){"use strict";var xee=Vr(),Aee=require("@stdlib/array/dtypes"),Gee=require("@stdlib/array/defaults"),Vee=an(),Fee=Aee("real_and_generic"),Wee=xee(Vee,Fee,Gee.get("dtypes.real"));Ny.exports=Wee});var Ry=s(function(B5e,Ly){"use strict";var Iee=Dd(),kee=Iee();Ly.exports=kee});var jy=s(function(D5e,Ty){"use strict";var zee=require("@stdlib/utils/define-nonenumerable-read-only-property"),Py=Ry(),Jee=Dd();zee(Py,"factory",Jee);Ty.exports=Py});var Gy=s(function(X5e,Ay){"use strict";var Uee=require("@stdlib/math/base/special/sqrt"),My=require("@stdlib/math/base/special/exp"),Cee=require("@stdlib/math/base/special/ln"),xy=.00991256303526217;function Bee(r,e){var t,i,n;for(i=My(-.5*e*e),t=[],t.push(xy/i),t.push(e),n=2;n=0&&g<=1&&(v=r(),n=Hd(u,4),c=8*t-12,c=1-n/c,v<=c?i=!1:(c+=.5*Hd(n/(8*t-8),2),v=uq(v)&&(i=!1))));return g}oq.exports=qre});var fq=s(function(iYe,gq){"use strict";var bre=require("@stdlib/math/base/special/pow"),Wu=require("@stdlib/math/base/special/ln");function wre(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/bre(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}gq.exports=wre});var cq=s(function(nYe,lq){"use strict";var Zd=require("@stdlib/math/base/special/exp"),dq=require("@stdlib/math/base/special/pow"),Qd=require("@stdlib/math/base/special/ln");function Sre(r,e,t){for(var i,n,a,u,o,v,g;;)if(u=r(),o=r(),v=dq(u,1/e),g=dq(o,1/t),a=v+g,a<=1)return a>0?v/a:(i=Qd(u)/e,n=Qd(o)/t,i>n?(n-=i,i=0):(i-=n,n=0),Zd(i-Qd(Zd(i)+Zd(n))))}lq.exports=Sre});var pq=s(function(aYe,hq){"use strict";var mq=sq(),Ore=vq(),Ere=fq(),_re=cq();function Nre(r,e,t,i){var n,a;return t===i&&t>1.5?Ore(r,e,t):t>1&&i>1?Ere(r,e,t,i):t<1&&i<1?_re(r,t,i):(n=mq(r,e,t),a=mq(r,e,i),n/(n+a))}hq.exports=Nre});var rl=s(function(sYe,Lq){"use strict";var Wr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Iu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),yq=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),qq=require("@stdlib/assert/is-plain-object"),bq=require("@stdlib/assert/is-boolean").isPrimitive,wq=require("@stdlib/assert/is-function"),fa=require("@stdlib/assert/has-own-property"),Sq=require("@stdlib/utils/constant-function"),Lre=require("@stdlib/utils/noop"),Oq=Q().factory,ku=T().factory,Eq=require("@stdlib/math/base/assert/is-nan"),$d=require("@stdlib/blas/base/gcopy"),Kd=require("@stdlib/array/uint32"),el=require("@stdlib/assert/is-uint32array"),_q=require("@stdlib/object/assign"),Rre=require("@stdlib/array/to-json"),Ir=require("@stdlib/string/format"),Pre=rq(),Nq=pq();function Tre(){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],!qq(n))throw new TypeError(Ir("invalid argument. Options argument must be an object. Value: `%s`.",n));if(fa(n,"copy")&&!bq(n.copy))throw new TypeError(Ir("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(fa(n,"prng")){if(!wq(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(fa(n,"state")&&!el(n.state))throw new TypeError(Ir("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=$d(n.state.length,n.state,1,new Kd(n.state.length),1)),n.copy=!1,a=ku(n)}}else{if(t=arguments[0],i=arguments[1],v=Pre(t,i),v)throw v;if(arguments.length>2){if(n=arguments[2],!qq(n))throw new TypeError(Ir("invalid argument. Options argument must be an object. Value: `%s`.",n));if(fa(n,"copy")&&!bq(n.copy))throw new TypeError(Ir("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(fa(n,"prng")){if(!wq(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(fa(n,"state")&&!el(n.state))throw new TypeError(Ir("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=$d(n.state.length,n.state,1,new Kd(n.state.length),1)),n.copy=!1,a=ku(n)}}else n={copy:!1},a=ku(n)}return n&&n.prng?e=Oq({prng:n.prng}):(n.state?r=n.state:(r=a.state,a.state=r),e=Oq({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),yq(u,"state",Sq(null),Lre),Wr(u,"stateLength",null),Wr(u,"byteLength",null),Wr(u,"toJSON",Sq(null)),Wr(u,"PRNG",a)):(Iu(u,"seed",g),Iu(u,"seedLength",c),yq(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(!el(q))throw new TypeError(Ir("invalid argument. Must provide a Uint32Array. Value: `%s`.",q));o&&(q=$d(q.length,q,1,new Kd(q.length),1)),a.state=q}function d(){var q={};return q.type="PRNG",q.name=u.NAME,q.state=Rre(a.state),t===void 0?q.params=[]:q.params=[t,i],q}function f(){return Nq(a,e,t,i)}function y(q,b){return Eq(q)||Eq(b)||q<=0||b<=0?NaN:Nq(a,e,q,b)}}Lq.exports=Tre});var Pq=s(function(uYe,Rq){"use strict";var jre=rl(),Mre=jre();Rq.exports=Mre});var un=s(function(oYe,jq){"use strict";var xre=require("@stdlib/utils/define-nonenumerable-read-only-property"),Tq=Pq(),Are=rl();xre(Tq,"factory",Are);jq.exports=Tq});var tl=s(function(vYe,Mq){"use strict";var Gre=F(),Vre=require("@stdlib/array/dtypes"),Fre=require("@stdlib/array/defaults"),Wre=un(),Ire=Vre("real_floating_point_and_generic"),kre=Gre(Wre,Ire,Fre.get("dtypes.real_floating_point"));Mq.exports=kre});var Aq=s(function(gYe,xq){"use strict";var zre=tl(),Jre=zre();xq.exports=Jre});var Fq=s(function(fYe,Vq){"use strict";var Ure=require("@stdlib/utils/define-nonenumerable-read-only-property"),Gq=Aq(),Cre=tl();Ure(Gq,"factory",Cre);Vq.exports=Gq});var zq=s(function(dYe,kq){"use strict";var Wq=require("@stdlib/assert/is-positive-number").isPrimitive,Iq=require("@stdlib/string/format");function Bre(r,e){return Wq(r)?Wq(e)?null:new TypeError(Iq("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(Iq("invalid argument. First argument must be a positive number. Value: `%s`.",r))}kq.exports=Bre});var Cq=s(function(lYe,Uq){"use strict";var Jq=require("@stdlib/math/base/special/ln");function Dre(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+Jq(l)),c=r(),(c2){if(n=arguments[2],!Dq(n))throw new TypeError(zr("invalid argument. Options argument must be an object. Value: `%s`.",n));if(da(n,"copy")&&!Xq(n.copy))throw new TypeError(zr("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(da(n,"prng")){if(!Yq(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(da(n,"state")&&!il(n.state))throw new TypeError(zr("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=Kq({},n),n.copy===!1?o=!1:n.state&&(n.state=al(n.state.length,n.state,1,new sl(n.state.length),1)),n.copy=!1,a=Ju(n)}}else n={copy:!1},a=Ju(n)}return n&&n.prng?t=Zq({prng:n.prng}):(n.state?r=n.state:(r=a.state,a.state=r),t=Zq({state:r,copy:!1})),e===void 0?u=w:(e>=1?(u=q,c=e-Cu):(u=b,c=e+1-Cu),g=1/nl(9*c)),kr(u,"NAME","gamma"),n&&n.prng?(kr(u,"seed",null),kr(u,"seedLength",null),Bq(u,"state",Hq(null),Xre),kr(u,"stateLength",null),kr(u,"byteLength",null),kr(u,"toJSON",Hq(null)),kr(u,"PRNG",a)):(zu(u,"seed",l),zu(u,"seedLength",m),Bq(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(!il(S))throw new TypeError(zr("invalid argument. Must provide a Uint32Array. Value: `%s`.",S));o&&(S=al(S.length,S,1,new sl(S.length),1)),a.state=S}function y(){var S={};return S.type="PRNG",S.name=u.NAME,S.state=Yre(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)*$q(a(),1/e)}function w(S,W){var J,x;return Qq(S)||Qq(W)||S<=0||W<=0?NaN:S<1?(x=S+1-Cu,J=1/nl(9*x),Uu(a,t,W,x,J)*$q(a(),1/S)):(x=S-Cu,J=1/nl(9*x),Uu(a,t,W,x,J))}}eb.exports=Zre});var tb=s(function(mYe,rb){"use strict";var Qre=ul(),$re=Qre();rb.exports=$re});var Ce=s(function(hYe,nb){"use strict";var Kre=require("@stdlib/utils/define-nonenumerable-read-only-property"),ib=tb(),ete=ul();Kre(ib,"factory",ete);nb.exports=ib});var ob=s(function(pYe,ub){"use strict";var ab=require("@stdlib/assert/is-positive-number").isPrimitive,sb=require("@stdlib/string/format");function rte(r,e){return ab(r)?ab(e)?null:new TypeError(sb("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(sb("invalid argument. First argument must be a positive number. Value: `%s`.",r))}ub.exports=rte});var gb=s(function(yYe,vb){"use strict";function tte(r,e,t){return r(e,1)/r(t,1)}vb.exports=tte});var ol=s(function(qYe,pb){"use strict";var mt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),fb=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),db=require("@stdlib/assert/is-plain-object"),lb=require("@stdlib/utils/constant-function"),ite=require("@stdlib/utils/noop"),Du=Ce().factory,cb=require("@stdlib/math/base/assert/is-nan"),nte=require("@stdlib/array/to-json"),mb=require("@stdlib/string/format"),ate=ob(),hb=gb();function ste(){var r,e,t,i,n,a,u;if(arguments.length===0)r=Du();else if(arguments.length===1){if(i=arguments[0],!db(i))throw new TypeError(mb("invalid argument. Options argument must be an object. Value: `%s`.",i));r=Du(i)}else{if(e=arguments[0],t=arguments[1],u=ate(e,t),u)throw u;if(arguments.length>2){if(i=arguments[2],!db(i))throw new TypeError(mb("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),fb(a,"state",lb(null),ite),mt(a,"stateLength",null),mt(a,"byteLength",null),mt(a,"toJSON",lb(null))):(Bu(a,"seed",o),Bu(a,"seedLength",v),fb(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=nte(n.state),e===void 0?f.params=[]:f.params=[e,t],f}function p(){return hb(r,e,t)}function d(f,y){return cb(f)||cb(y)||f<=0||y<=0?NaN:hb(r,f,y)}}pb.exports=ste});var qb=s(function(bYe,yb){"use strict";var ute=ol(),ote=ute();yb.exports=ote});var on=s(function(wYe,wb){"use strict";var vte=require("@stdlib/utils/define-nonenumerable-read-only-property"),bb=qb(),gte=ol();vte(bb,"factory",gte);wb.exports=bb});var vl=s(function(SYe,Sb){"use strict";var fte=F(),dte=require("@stdlib/array/dtypes"),lte=require("@stdlib/array/defaults"),cte=on(),mte=dte("real_floating_point_and_generic"),hte=fte(cte,mte,lte.get("dtypes.real_floating_point"));Sb.exports=hte});var Eb=s(function(OYe,Ob){"use strict";var pte=vl(),yte=pte();Ob.exports=yte});var Lb=s(function(EYe,Nb){"use strict";var qte=require("@stdlib/utils/define-nonenumerable-read-only-property"),_b=Eb(),bte=vl();qte(_b,"factory",bte);Nb.exports=_b});var Tb=s(function(_Ye,Pb){"use strict";var wte=require("@stdlib/assert/is-positive-integer").isPrimitive,Ste=require("@stdlib/assert/is-probability").isPrimitive,Rb=require("@stdlib/string/format");function Ote(r,e){return wte(r)?Ste(e)?null:new TypeError(Rb("invalid argument. Second argument must be a probability. Value: `%s`.",e)):new TypeError(Rb("invalid argument. First argument must be a positive integer. Value: `%s`.",e))}Pb.exports=Ote});var Mb=s(function(NYe,jb){"use strict";function Ete(r,e,t){var i=0,n;for(n=0;n=p?A=r()-.5:(A=G/p-.93,A=Tte(A)*.5-A,G=p*r()),l=.5-fl(A),S=gl(A*(2*d/l+f)+y),!(S<0||S>e))if(G=G*i/(d/(l*l)+f),m=fl(S-W),m>15){if(G=Xu(G),o=m/u,v=(m/3+.625)*m,v+=Mte,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}}}Gb.exports=xte});var Ib=s(function(PYe,Wb){"use strict";var Ate=Mb(),Gte=Vb();function Fb(r,e,t){return t>.5?e-Fb(r,e,1-t):e*t<10?Ate(r,e,t):Gte(r,e,t)}Wb.exports=Fb});var dl=s(function(TYe,Xb){"use strict";var Jr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),kb=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),zb=require("@stdlib/assert/is-plain-object"),Jb=require("@stdlib/assert/is-function"),Ub=require("@stdlib/assert/has-own-property"),Cb=require("@stdlib/utils/constant-function"),Vte=require("@stdlib/utils/noop"),Bb=require("@stdlib/math/base/assert/is-nan"),Fte=require("@stdlib/math/base/assert/is-positive-integer"),Wte=require("@stdlib/math/base/assert/is-probability"),Zu=T().factory,Ite=require("@stdlib/array/to-json"),Qu=require("@stdlib/string/format"),kte=Tb(),Db=Ib();function zte(){var r,e,t,i,n,a;if(arguments.length===0)e=Zu();else if(arguments.length===1){if(r=arguments[0],!zb(r))throw new TypeError(Qu("invalid argument. Options argument must be an object. Value: `%s`.",r));if(Ub(r,"prng")){if(!Jb(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=kte(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!zb(r))throw new TypeError(Qu("invalid argument. Options argument must be an object. Value: `%s`.",r));if(Ub(r,"prng")){if(!Jb(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),kb(t,"state",Cb(null),Vte),Jr(t,"stateLength",null),Jr(t,"byteLength",null),Jr(t,"toJSON",Cb(null)),Jr(t,"PRNG",e)):(Hu(t,"seed",u),Hu(t,"seedLength",o),kb(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=Ite(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return Db(e,n,a)}function p(d,f){return Bb(d)||Bb(f)||!Fte(d)||!Wte(f)?NaN:Db(e,d,f)}}Xb.exports=zte});var Hb=s(function(jYe,Yb){"use strict";var Jte=dl(),Ute=Jte();Yb.exports=Ute});var la=s(function(MYe,Qb){"use strict";var Cte=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zb=Hb(),Bte=dl();Cte(Zb,"factory",Bte);Qb.exports=Zb});var ll=s(function(xYe,$b){"use strict";var Dte=F(),Xte=require("@stdlib/array/dtypes"),Yte=require("@stdlib/array/defaults"),Hte=la(),Zte=Xte("real_and_generic"),Qte=Dte(Hte,Zte,Yte.get("dtypes.real"));$b.exports=Qte});var ew=s(function(AYe,Kb){"use strict";var $te=ll(),Kte=$te();Kb.exports=Kte});var iw=s(function(GYe,tw){"use strict";var eie=require("@stdlib/utils/define-nonenumerable-read-only-property"),rw=ew(),rie=ll();eie(rw,"factory",rie);tw.exports=rw});var sw=s(function(VYe,aw){"use strict";var tie=require("@stdlib/assert/is-number").isPrimitive,iie=require("@stdlib/assert/is-positive-number").isPrimitive,nw=require("@stdlib/string/format"),nie=require("@stdlib/assert/is-nan");function aie(r,e){return!tie(r)||nie(r)?new TypeError(nw("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):iie(e)?null:new TypeError(nw("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}aw.exports=aie});var ow=s(function(FYe,uw){"use strict";var sie=require("@stdlib/math/base/special/tan"),uie=require("@stdlib/constants/float64/pi");function oie(r,e,t){return e+t*sie(uie*(r()-.5))}uw.exports=oie});var cl=s(function(WYe,hw){"use strict";var ht=require("@stdlib/utils/define-nonenumerable-read-only-property"),$u=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),vw=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),gw=require("@stdlib/assert/is-plain-object"),fw=require("@stdlib/assert/is-function"),dw=require("@stdlib/assert/has-own-property"),lw=require("@stdlib/utils/constant-function"),vie=require("@stdlib/utils/noop"),cw=require("@stdlib/math/base/assert/is-nan"),ca=Q().factory,gie=require("@stdlib/array/to-json"),Ku=require("@stdlib/string/format"),fie=sw(),mw=ow();function die(){var r,e,t,i,n,a,u;if(arguments.length===0)e=ca();else if(arguments.length===1){if(t=arguments[0],!gw(t))throw new TypeError(Ku("invalid argument. Options argument must be an object. Value: `%s`.",t));if(dw(t,"prng")){if(!fw(t.prng))throw new TypeError(Ku("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));e=ca({prng:t.prng})}else e=ca(t)}else{if(u=arguments[0],r=arguments[1],a=fie(u,r),a)throw a;if(arguments.length>2){if(t=arguments[2],!gw(t))throw new TypeError(Ku("invalid argument. Options argument must be an object. Value: `%s`.",t));if(dw(t,"prng")){if(!fw(t.prng))throw new TypeError(Ku("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));e=ca({prng:t.prng})}else e=ca(t)}else e=ca()}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),vw(n,"state",lw(null),vie),ht(n,"stateLength",null),ht(n,"byteLength",null),ht(n,"toJSON",lw(null))):($u(n,"seed",o),$u(n,"seedLength",v),vw(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=gie(i.state),u===void 0?f.params=[]:f.params=[u,r],f}function p(){return mw(e,u,r)}function d(f,y){return cw(f)||cw(y)||y<=0?NaN:mw(e,f,y)}}hw.exports=die});var yw=s(function(IYe,pw){"use strict";var lie=cl(),cie=lie();pw.exports=cie});var ma=s(function(kYe,bw){"use strict";var mie=require("@stdlib/utils/define-nonenumerable-read-only-property"),qw=yw(),hie=cl();mie(qw,"factory",hie);bw.exports=qw});var ml=s(function(zYe,ww){"use strict";var pie=F(),yie=require("@stdlib/array/dtypes"),qie=require("@stdlib/array/defaults"),bie=ma(),wie=yie("real_floating_point_and_generic"),Sie=pie(bie,wie,qie.get("dtypes.real_floating_point"));ww.exports=Sie});var Ow=s(function(JYe,Sw){"use strict";var Oie=ml(),Eie=Oie();Sw.exports=Eie});var Nw=s(function(UYe,_w){"use strict";var _ie=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ew=Ow(),Nie=ml();_ie(Ew,"factory",Nie);_w.exports=Ew});var hl=s(function(CYe,Mw){"use strict";var pt=require("@stdlib/utils/define-nonenumerable-read-only-property"),eo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Lw=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Lie=require("@stdlib/assert/is-positive-number").isPrimitive,Rw=require("@stdlib/assert/is-plain-object"),Pw=require("@stdlib/assert/is-function"),Tw=require("@stdlib/assert/has-own-property"),jw=require("@stdlib/utils/constant-function"),Rie=require("@stdlib/utils/noop"),Pie=require("@stdlib/math/base/assert/is-nan"),ha=Ce().factory,Tie=require("@stdlib/array/to-json"),ro=require("@stdlib/string/format");function jie(){var r,e,t,i,n;if(arguments.length===0)r=ha();else if(arguments.length===1&&Rw(arguments[0]))if(t=arguments[0],Tw(t,"prng")){if(!Pw(t.prng))throw new TypeError(ro("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],!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],!Rw(t))throw new TypeError(ro("invalid argument. Options argument must be an object. Value: `%s`.",t));if(Tw(t,"prng")){if(!Pw(t.prng))throw new TypeError(ro("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));r=ha(n/2,.5,{prng:t.prng})}else r=ha(n/2,.5,t)}else r=ha(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),Lw(i,"state",jw(null),Rie),pt(i,"stateLength",null),pt(i,"byteLength",null),pt(i,"toJSON",jw(null))):(eo(i,"seed",a),eo(i,"seedLength",u),Lw(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=Tie(e.state),n===void 0?p.params=[]:p.params=[n],p}function m(){return r()}function h(p){return Pie(p)||p<=0?NaN:r(p/2,.5)}}Mw.exports=jie});var Aw=s(function(BYe,xw){"use strict";var Mie=hl(),xie=Mie();xw.exports=xie});var Ur=s(function(DYe,Vw){"use strict";var Aie=require("@stdlib/utils/define-nonenumerable-read-only-property"),Gw=Aw(),Gie=hl();Aie(Gw,"factory",Gie);Vw.exports=Gw});var pl=s(function(XYe,Uw){"use strict";var yt=require("@stdlib/utils/define-nonenumerable-read-only-property"),to=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Fw=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Vie=require("@stdlib/assert/is-positive-number").isPrimitive,Ww=require("@stdlib/assert/is-plain-object"),Iw=require("@stdlib/assert/is-function"),kw=require("@stdlib/assert/has-own-property"),zw=require("@stdlib/utils/constant-function"),Fie=require("@stdlib/utils/noop"),Wie=require("@stdlib/math/base/assert/is-nan"),pa=Ur().factory,Iie=require("@stdlib/array/to-json"),Jw=require("@stdlib/math/base/special/sqrt"),io=require("@stdlib/string/format");function kie(){var r,e,t,i,n;if(arguments.length===0)r=pa();else if(arguments.length===1&&Ww(arguments[0]))if(t=arguments[0],kw(t,"prng")){if(!Iw(t.prng))throw new TypeError(io("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));r=pa({prng:t.prng})}else r=pa(t);else{if(n=arguments[0],!Vie(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],!Ww(t))throw new TypeError(io("invalid argument. Options argument must be an object. Value: `%s`.",t));if(kw(t,"prng")){if(!Iw(t.prng))throw new TypeError(io("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));r=pa(n,{prng:t.prng})}else r=pa(n,t)}else r=pa(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),Fw(i,"state",zw(null),Fie),yt(i,"stateLength",null),yt(i,"byteLength",null),yt(i,"toJSON",zw(null))):(to(i,"seed",a),to(i,"seedLength",u),Fw(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=Iie(e.state),n===void 0?p.params=[]:p.params=[n],p}function m(){return Jw(r())}function h(p){return Wie(p)||p<=0?NaN:Jw(r(p))}}Uw.exports=kie});var Bw=s(function(YYe,Cw){"use strict";var zie=pl(),Jie=zie();Cw.exports=Jie});var vn=s(function(HYe,Xw){"use strict";var Uie=require("@stdlib/utils/define-nonenumerable-read-only-property"),Dw=Bw(),Cie=pl();Uie(Dw,"factory",Cie);Xw.exports=Dw});var yl=s(function(ZYe,Yw){"use strict";var Bie=Vr(),Die=require("@stdlib/array/dtypes"),Xie=require("@stdlib/array/defaults"),Yie=vn(),Hie=Die("real_floating_point_and_generic"),Zie=Bie(Yie,Hie,Xie.get("dtypes.real_floating_point"));Yw.exports=Zie});var Zw=s(function(QYe,Hw){"use strict";var Qie=yl(),$ie=Qie();Hw.exports=$ie});var Kw=s(function($Ye,$w){"use strict";var Kie=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qw=Zw(),ene=yl();Kie(Qw,"factory",ene);$w.exports=Qw});var ql=s(function(KYe,eS){"use strict";var rne=Vr(),tne=require("@stdlib/array/dtypes"),ine=require("@stdlib/array/defaults"),nne=Ur(),ane=tne("real_floating_point_and_generic"),sne=rne(nne,ane,ine.get("dtypes.real_floating_point"));eS.exports=sne});var tS=s(function(e6e,rS){"use strict";var une=ql(),one=une();rS.exports=one});var aS=s(function(r6e,nS){"use strict";var vne=require("@stdlib/utils/define-nonenumerable-read-only-property"),iS=tS(),gne=ql();vne(iS,"factory",gne);nS.exports=iS});var oS=s(function(t6e,uS){"use strict";var fne=require("@stdlib/assert/is-number").isPrimitive,dne=require("@stdlib/assert/is-positive-number").isPrimitive,sS=require("@stdlib/string/format"),lne=require("@stdlib/assert/is-nan");function cne(r,e){return!fne(r)||lne(r)?new TypeError(sS("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):dne(e)?null:new TypeError(sS("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}uS.exports=cne});var gS=s(function(i6e,vS){"use strict";var mne=require("@stdlib/stats/base/dists/cosine/quantile");function hne(r,e,t){return mne(r(),e,t)}vS.exports=hne});var bl=s(function(n6e,yS){"use strict";var Cr=require("@stdlib/utils/define-nonenumerable-read-only-property"),no=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),fS=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),dS=require("@stdlib/assert/is-plain-object"),lS=require("@stdlib/assert/is-function"),cS=require("@stdlib/assert/has-own-property"),mS=require("@stdlib/utils/constant-function"),pne=require("@stdlib/utils/noop"),ao=T().factory,hS=require("@stdlib/math/base/assert/is-nan"),yne=require("@stdlib/array/to-json"),so=require("@stdlib/string/format"),qne=oS(),pS=gS();function bne(){var r,e,t,i,n,a;if(arguments.length===0)e=ao();else if(arguments.length===1){if(r=arguments[0],!dS(r))throw new TypeError(so("invalid argument. Options argument must be an object. Value: `%s`.",r));if(cS(r,"prng")){if(!lS(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=qne(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!dS(r))throw new TypeError(so("invalid argument. Options argument must be an object. Value: `%s`.",r));if(cS(r,"prng")){if(!lS(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),fS(t,"state",mS(null),pne),Cr(t,"stateLength",null),Cr(t,"byteLength",null),Cr(t,"toJSON",mS(null)),Cr(t,"PRNG",e)):(no(t,"seed",u),no(t,"seedLength",o),fS(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=yne(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return pS(e,n,a)}function p(d,f){return hS(d)||hS(f)||f<=0?NaN:pS(e,d,f)}}yS.exports=bne});var bS=s(function(a6e,qS){"use strict";var wne=bl(),Sne=wne();qS.exports=Sne});var gn=s(function(s6e,SS){"use strict";var One=require("@stdlib/utils/define-nonenumerable-read-only-property"),wS=bS(),Ene=bl();One(wS,"factory",Ene);SS.exports=wS});var wl=s(function(u6e,OS){"use strict";var _ne=F(),Nne=require("@stdlib/array/dtypes"),Lne=require("@stdlib/array/defaults"),Rne=gn(),Pne=Nne("real_floating_point_and_generic"),Tne=_ne(Rne,Pne,Lne.get("dtypes.real_floating_point"));OS.exports=Tne});var _S=s(function(o6e,ES){"use strict";var jne=wl(),Mne=jne();ES.exports=Mne});var RS=s(function(v6e,LS){"use strict";var xne=require("@stdlib/utils/define-nonenumerable-read-only-property"),NS=_S(),Ane=wl();xne(NS,"factory",Ane);LS.exports=NS});var MS=s(function(g6e,jS){"use strict";var PS=require("@stdlib/assert/is-integer").isPrimitive,Sl=require("@stdlib/string/format"),TS=require("@stdlib/assert/is-nan");function Gne(r,e){return!PS(r)||TS(r)?new TypeError(Sl("invalid argument. First argument must be an integer and not NaN. Value: `%s`.",r)):!PS(e)||TS(e)?new TypeError(Sl("invalid argument. Second argument must be an integer and not NaN. Value: `%s`.",e)):r>e?new RangeError(Sl("invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d, %d]`.",r,e)):null}jS.exports=Gne});var GS=s(function(f6e,AS){"use strict";var Ol=require("@stdlib/constants/float64/max-safe-integer"),ya=require("@stdlib/math/base/special/floor");function xS(r,e,t){var i,n,a,u,o,v,g,c,l;if(a=t-e,a===0)return e;if(g=r.MIN,c=r.MAX,n=c-g,n===a)return r()-g+e;if(nOl/v)&&(l*=v,i+=l,!(i>a)))return i+e}for(n===Ol?(o=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}AS.exports=xS});var El=s(function(d6e,US){"use strict";var Br=require("@stdlib/utils/define-nonenumerable-read-only-property"),uo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),VS=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),FS=require("@stdlib/assert/is-plain-object"),WS=require("@stdlib/assert/is-function"),IS=require("@stdlib/assert/has-own-property"),kS=require("@stdlib/utils/constant-function"),Vne=require("@stdlib/utils/noop"),oo=T().factory,zS=require("@stdlib/math/base/assert/is-nan"),qa=require("@stdlib/math/base/assert/is-integer"),Fne=require("@stdlib/array/to-json"),qt=require("@stdlib/string/format"),Wne=MS(),JS=GS();function Ine(){var r,e,t,i,n,a;if(arguments.length===0)e=oo();else if(arguments.length===1){if(r=arguments[0],!FS(r))throw new TypeError(qt("invalid argument. Options argument must be an object. Value: `%s`.",r));if(IS(r,"prng")){if(!WS(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=Wne(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!FS(r))throw new TypeError(qt("invalid argument. Options argument must be an object. Value: `%s`.",r));if(IS(r,"prng")){if(!WS(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),VS(t,"state",kS(null),Vne),Br(t,"stateLength",null),Br(t,"byteLength",null),Br(t,"toJSON",kS(null)),Br(t,"PRNG",e)):(uo(t,"seed",u),uo(t,"seedLength",o),VS(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=Fne(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return JS(e,n,a)}function p(d,f){return zS(d)||zS(f)||!qa(d)||!qa(f)||d>f?NaN:JS(e,d,f)}}US.exports=Ine});var BS=s(function(l6e,CS){"use strict";var kne=El(),zne=kne();CS.exports=zne});var fn=s(function(c6e,XS){"use strict";var Jne=require("@stdlib/utils/define-nonenumerable-read-only-property"),DS=BS(),Une=El();Jne(DS,"factory",Une);XS.exports=DS});var _l=s(function(m6e,YS){"use strict";var Cne=F(),Bne=require("@stdlib/array/dtypes"),Dne=require("@stdlib/array/defaults"),Xne=fn(),Yne=Bne("real_and_generic"),Hne=Cne(Xne,Yne,Dne.get("dtypes.real"));YS.exports=Hne});var ZS=s(function(h6e,HS){"use strict";var Zne=_l(),Qne=Zne();HS.exports=Qne});var KS=s(function(p6e,$S){"use strict";var $ne=require("@stdlib/utils/define-nonenumerable-read-only-property"),QS=ZS(),Kne=_l();$ne(QS,"factory",Kne);$S.exports=QS});var tO=s(function(y6e,rO){"use strict";var eae=require("@stdlib/assert/is-positive-number").isPrimitive,rae=require("@stdlib/assert/is-positive-integer").isPrimitive,eO=require("@stdlib/string/format");function tae(r,e){return rae(r)?eae(e)?null:new TypeError(eO("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(eO("invalid argument. First argument must be a positive integer. Value: `%s`.",r))}rO.exports=tae});var nO=s(function(q6e,iO){"use strict";var iae=require("@stdlib/math/base/special/ln");function nae(r,e,t){var i,n;for(i=1,n=0;n2){if(t=arguments[2],!sO(t))throw new TypeError(fo("invalid argument. Options argument must be an object. Value: `%s`.",t));if(oO(t,"prng")){if(!uO(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),aO(i,"state",vO(null),aae),Dr(i,"stateLength",null),Dr(i,"byteLength",null),Dr(i,"toJSON",vO(null)),Dr(i,"PRNG",e)):(vo(i,"seed",u),vo(i,"seedLength",o),aO(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=uae(e.state),a===void 0?d.params=[]:d.params=[a,r],d}function h(){return fO(e,a,r)}function p(d,f){return gO(d)||gO(f)||!sae(d)||f<=0?NaN:fO(e,d,f)}}dO.exports=vae});var cO=s(function(w6e,lO){"use strict";var gae=Nl(),fae=gae();lO.exports=fae});var ba=s(function(S6e,hO){"use strict";var dae=require("@stdlib/utils/define-nonenumerable-read-only-property"),mO=cO(),lae=Nl();dae(mO,"factory",lae);hO.exports=mO});var Ll=s(function(O6e,pO){"use strict";var cae=F(),mae=require("@stdlib/array/dtypes"),hae=require("@stdlib/array/defaults"),pae=ba(),yae=mae("real_floating_point_and_generic"),qae=cae(pae,yae,hae.get("dtypes.real_floating_point"));pO.exports=qae});var qO=s(function(E6e,yO){"use strict";var bae=Ll(),wae=bae();yO.exports=wae});var SO=s(function(_6e,wO){"use strict";var Sae=require("@stdlib/utils/define-nonenumerable-read-only-property"),bO=qO(),Oae=Ll();Sae(bO,"factory",Oae);wO.exports=bO});var EO=s(function(N6e,OO){"use strict";var Eae=require("@stdlib/math/base/special/ln");function _ae(r,e){return-Eae(1-r())/e}OO.exports=_ae});var Rl=s(function(L6e,jO){"use strict";var Xr=require("@stdlib/utils/define-nonenumerable-read-only-property"),lo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),_O=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Nae=require("@stdlib/assert/is-positive-number").isPrimitive,NO=require("@stdlib/assert/is-plain-object"),LO=require("@stdlib/assert/is-function"),RO=require("@stdlib/assert/has-own-property"),PO=require("@stdlib/utils/constant-function"),Lae=require("@stdlib/utils/noop"),co=T().factory,Rae=require("@stdlib/math/base/assert/is-nan"),Pae=require("@stdlib/array/to-json"),mo=require("@stdlib/string/format"),TO=EO();function Tae(){var r,e,t,i;if(arguments.length===0)t=co();else if(arguments.length===1&&NO(arguments[0]))if(e=arguments[0],RO(e,"prng")){if(!LO(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],!Nae(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],!NO(e))throw new TypeError(mo("invalid argument. Options argument must be an object. Value: `%s`.",e));if(RO(e,"prng")){if(!LO(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),_O(i,"state",PO(null),Lae),Xr(i,"stateLength",null),Xr(i,"byteLength",null),Xr(i,"toJSON",PO(null)),Xr(i,"PRNG",t)):(lo(i,"seed",n),lo(i,"seedLength",a),_O(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=Pae(t.state),r===void 0?h.params=[]:h.params=[r],h}function l(){return TO(t,r)}function m(h){return Rae(h)||h<=0?NaN:TO(t,h)}}jO.exports=Tae});var xO=s(function(R6e,MO){"use strict";var jae=Rl(),Mae=jae();MO.exports=Mae});var dn=s(function(P6e,GO){"use strict";var xae=require("@stdlib/utils/define-nonenumerable-read-only-property"),AO=xO(),Aae=Rl();xae(AO,"factory",Aae);GO.exports=AO});var Pl=s(function(T6e,VO){"use strict";var Gae=Vr(),Vae=require("@stdlib/array/dtypes"),Fae=require("@stdlib/array/defaults"),Wae=dn(),Iae=Vae("real_floating_point_and_generic"),kae=Gae(Wae,Iae,Fae.get("dtypes.real_floating_point"));VO.exports=kae});var WO=s(function(j6e,FO){"use strict";var zae=Pl(),Jae=zae();FO.exports=Jae});var zO=s(function(M6e,kO){"use strict";var Uae=require("@stdlib/utils/define-nonenumerable-read-only-property"),IO=WO(),Cae=Pl();Uae(IO,"factory",Cae);kO.exports=IO});var BO=s(function(x6e,CO){"use strict";var JO=require("@stdlib/assert/is-positive-number").isPrimitive,UO=require("@stdlib/string/format");function Bae(r,e){return JO(r)?JO(e)?null:new TypeError(UO("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(UO("invalid argument. First argument must be a positive number. Value: `%s`.",r))}CO.exports=Bae});var XO=s(function(A6e,DO){"use strict";function Dae(r,e,t){var i=r(e)/e,n=r(t)/t;return i/n}DO.exports=Dae});var Tl=s(function(G6e,rE){"use strict";var bt=require("@stdlib/utils/define-nonenumerable-read-only-property"),ho=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),YO=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),HO=require("@stdlib/assert/is-plain-object"),ZO=require("@stdlib/assert/is-function"),QO=require("@stdlib/assert/has-own-property"),$O=require("@stdlib/utils/constant-function"),Xae=require("@stdlib/utils/noop"),wa=Ur().factory,KO=require("@stdlib/math/base/assert/is-nan"),Yae=require("@stdlib/array/to-json"),po=require("@stdlib/string/format"),Hae=BO(),eE=XO();function Zae(){var r,e,t,i,n,a,u;if(arguments.length===0)r=wa();else if(arguments.length===1){if(e=arguments[0],!HO(e))throw new TypeError(po("invalid argument. Options argument must be an object. Value: `%s`.",e));if(QO(e,"prng")){if(!ZO(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=Hae(a,u),n)throw n;if(arguments.length>2){if(e=arguments[2],!HO(e))throw new TypeError(po("invalid argument. Options argument must be an object. Value: `%s`.",e));if(QO(e,"prng")){if(!ZO(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),YO(i,"state",$O(null),Xae),bt(i,"stateLength",null),bt(i,"byteLength",null),bt(i,"toJSON",$O(null))):(ho(i,"seed",o),ho(i,"seedLength",v),YO(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=Yae(t.state),a===void 0?f.params=[]:f.params=[a,u],f}function p(){return eE(r,a,u)}function d(f,y){return KO(f)||KO(y)||f<=0||y<=0?NaN:eE(r,f,y)}}rE.exports=Zae});var iE=s(function(V6e,tE){"use strict";var Qae=Tl(),$ae=Qae();tE.exports=$ae});var Sa=s(function(F6e,aE){"use strict";var Kae=require("@stdlib/utils/define-nonenumerable-read-only-property"),nE=iE(),ese=Tl();Kae(nE,"factory",ese);aE.exports=nE});var jl=s(function(W6e,sE){"use strict";var rse=F(),tse=require("@stdlib/array/dtypes"),ise=require("@stdlib/array/defaults"),nse=Sa(),ase=tse("real_floating_point_and_generic"),sse=rse(nse,ase,ise.get("dtypes.real_floating_point"));sE.exports=sse});var oE=s(function(I6e,uE){"use strict";var use=jl(),ose=use();uE.exports=ose});var fE=s(function(k6e,gE){"use strict";var vse=require("@stdlib/utils/define-nonenumerable-read-only-property"),vE=oE(),gse=jl();vse(vE,"factory",gse);gE.exports=vE});var cE=s(function(z6e,lE){"use strict";var fse=require("@stdlib/assert/is-plain-object"),dse=require("@stdlib/assert/has-own-property"),lse=require("@stdlib/array/base/assert/contains"),dE=require("@stdlib/string/format");function cse(r,e,t){return fse(t)?dse(t,"dtype")&&(r.dtype=t.dtype,!lse(e,r.dtype))?new TypeError(dE('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),r.dtype)):null:new TypeError(dE("invalid argument. Options argument must be an object. Value: `%s`.",t))}lE.exports=cse});var yE=s(function(J6e,pE){"use strict";var mE=require("@stdlib/utils/define-nonenumerable-read-only-property"),mse=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,hse=require("@stdlib/assert/is-function"),pse=require("@stdlib/assert/is-string-array").primitives,yse=require("@stdlib/assert/is-collection"),qse=require("@stdlib/array/base/assert/contains"),bse=require("@stdlib/array/base/filled-by"),hE=require("@stdlib/strided/base/ternary"),wse=require("@stdlib/array/ctors"),Ys=require("@stdlib/string/format"),Sse=cE();function Hs(r,e,t){if(!(this instanceof Hs))return new Hs(r,e,t);if(!hse(r))throw new TypeError(Ys("invalid argument. First argument must be a function. Value: `%s`.",r));if(!pse(e))throw new TypeError(Ys("invalid argument. Second argument must be an array of strings. Value: `%s`.",e));if(!qse(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}mE(Hs.prototype,"generate",function(e,t,i,n,a){var u,o,v,g,c,l;if(!mse(e))throw new TypeError(Ys("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if(o={},arguments.length>4&&(c=Sse(o,this._dtypes,a),c))throw c;if(v=this._prng,l=o.dtype||this._dtype,l==="generic")return bse(e,m);return u=wse(l),g=new u(e),hE([[t],[i],[n],g],[e],[0,0,0,1],v),g;function m(){return v(t,i,n)}});mE(Hs.prototype,"assign",function(e,t,i,n){if(!yse(n))throw new TypeError(Ys("invalid argument. Third argument must be an array-like object. Value: `%s`.",n));return hE([[e],[t],[i],n],[n.length],[0,0,0,1],this._prng),n});pE.exports=Hs});var bE=s(function(U6e,qE){"use strict";var Ose=yE();qE.exports=Ose});var EE=s(function(C6e,OE){"use strict";var wE=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"),Ese=require("@stdlib/assert/is-string-array").primitives,_se=require("@stdlib/assert/is-function"),Nse=require("@stdlib/assert/is-method-in"),Lse=require("@stdlib/assert/has-own-property"),SE=require("@stdlib/array/base/assert/contains").factory,Rse=require("@stdlib/utils/constant-function"),Pse=require("@stdlib/utils/noop"),Tse=bE(),jse=_u(),Zs=require("@stdlib/string/format");function Mse(r,e,t){var i;if(!_se(r))throw new TypeError(Zs("invalid argument. First argument must be a function. Value: `%s`.",r));if(!Nse(r,"factory"))throw new TypeError(Zs("invalid argument. First argument must have a `%s` method.","factory"));if(!Ese(e))throw new TypeError(Zs("invalid argument. Second argument must an array of strings. Value: `%s`.",e));if(!SE(e,t))throw new TypeError(Zs("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return i=SE(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=Tse):(c=b,a=jse),u=new a(m,e,d),h&&h.prng?(Oa(p,"seed",null),Oa(p,"seedLength",null),wE(p,"state",Rse(null),Pse),Oa(p,"stateLength",null),Oa(p,"byteLength",null)):(yo(p,"seed",w),yo(p,"seedLength",S),wE(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,w$){return arguments.length<5?u.generate(A,G,Ue,Eu):u.generate(A,G,Ue,Eu,w$)}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}}}OE.exports=Mse});var qo=s(function(B6e,_E){"use strict";var xse=EE();_E.exports=xse});var RE=s(function(D6e,LE){"use strict";var NE=require("@stdlib/assert/is-positive-number").isPrimitive,Ase=require("@stdlib/assert/is-number").isPrimitive,Ml=require("@stdlib/assert/is-nan"),xl=require("@stdlib/string/format");function Gse(r,e,t){return!NE(r)||Ml(r)?new TypeError(xl("invalid argument. First argument must be a positive number and not NaN. Value: `%s`.",r)):!NE(e)||Ml(e)?new TypeError(xl("invalid argument. Second argument must be a positive number and not NaN. Value: `%s`.",e)):!Ase(t)||Ml(t)?new TypeError(xl("invalid argument. Third argument must be a number and not NaN. Value: `%s`.",t)):null}LE.exports=Gse});var TE=s(function(X6e,PE){"use strict";var Vse=require("@stdlib/math/base/special/pow"),Fse=require("@stdlib/math/base/special/ln");function Wse(r,e,t,i){return i+t*Vse(-Fse(r()),-1/e)}PE.exports=Wse});var Gl=s(function(Y6e,FE){"use strict";var Yr=require("@stdlib/utils/define-nonenumerable-read-only-property"),bo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),jE=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ME=require("@stdlib/assert/is-plain-object"),xE=require("@stdlib/assert/is-function"),AE=require("@stdlib/assert/has-own-property"),GE=require("@stdlib/utils/constant-function"),Ise=require("@stdlib/utils/noop"),wo=T().factory,Al=require("@stdlib/math/base/assert/is-nan"),kse=require("@stdlib/array/to-json"),So=require("@stdlib/string/format"),zse=RE(),VE=TE();function Jse(){var r,e,t,i,n,a,u;if(arguments.length===0)t=wo();else if(arguments.length===1){if(e=arguments[0],!ME(e))throw new TypeError(So("invalid argument. Options argument must be an object. Value: `%s`.",e));if(AE(e,"prng")){if(!xE(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=zse(r,a,u),n)throw n;if(arguments.length>3){if(e=arguments[3],!ME(e))throw new TypeError(So("invalid argument. Options argument must be an object. Value: `%s`.",e));if(AE(e,"prng")){if(!xE(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),jE(i,"state",GE(null),Ise),Yr(i,"stateLength",null),Yr(i,"byteLength",null),Yr(i,"toJSON",GE(null)),Yr(i,"PRNG",t)):(bo(i,"seed",o),bo(i,"seedLength",v),jE(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=kse(t.state),r===void 0?f.params=[]:f.params=[r,a,u],f}function p(){return VE(t,r,a,u)}function d(f,y,q){return Al(f)||Al(y)||Al(q)||f<=0||y<=0?NaN:VE(t,f,y,q)}}FE.exports=Jse});var IE=s(function(H6e,WE){"use strict";var Use=Gl(),Cse=Use();WE.exports=Cse});var Ea=s(function(Z6e,zE){"use strict";var Bse=require("@stdlib/utils/define-nonenumerable-read-only-property"),kE=IE(),Dse=Gl();Bse(kE,"factory",Dse);zE.exports=kE});var Vl=s(function(Q6e,JE){"use strict";var Xse=qo(),Yse=require("@stdlib/array/dtypes"),Hse=require("@stdlib/array/defaults"),Zse=Ea(),Qse=Yse("real_floating_point_and_generic"),$se=Xse(Zse,Qse,Hse.get("dtypes.real_floating_point"));JE.exports=$se});var CE=s(function($6e,UE){"use strict";var Kse=Vl(),eue=Kse();UE.exports=eue});var XE=s(function(K6e,DE){"use strict";var rue=require("@stdlib/utils/define-nonenumerable-read-only-property"),BE=CE(),tue=Vl();rue(BE,"factory",tue);DE.exports=BE});var Fl=s(function(e4e,YE){"use strict";var iue=F(),nue=require("@stdlib/array/dtypes"),aue=require("@stdlib/array/defaults"),sue=Ce(),uue=nue("real_floating_point_and_generic"),oue=iue(sue,uue,aue.get("dtypes.real_floating_point"));YE.exports=oue});var ZE=s(function(r4e,HE){"use strict";var vue=Fl(),gue=vue();HE.exports=gue});var KE=s(function(t4e,$E){"use strict";var fue=require("@stdlib/utils/define-nonenumerable-read-only-property"),QE=ZE(),due=Fl();fue(QE,"factory",due);$E.exports=QE});var t_=s(function(i4e,r_){"use strict";var lue=require("@stdlib/math/base/special/floor"),e_=require("@stdlib/math/base/special/ln");function cue(r,e){var t=r();return t===0&&(t=r()),lue(e_(t)/e_(1-e))}r_.exports=cue});var Wl=s(function(n4e,v_){"use strict";var Hr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Oo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),i_=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),n_=require("@stdlib/assert/is-plain-object"),mue=require("@stdlib/assert/is-probability").isPrimitive,a_=require("@stdlib/assert/is-function"),s_=require("@stdlib/assert/has-own-property"),u_=require("@stdlib/utils/constant-function"),hue=require("@stdlib/utils/noop"),Eo=T().factory,pue=require("@stdlib/math/base/assert/is-nan"),yue=require("@stdlib/array/to-json"),_o=require("@stdlib/string/format"),o_=t_();function que(){var r,e,t,i;if(arguments.length===0)e=Eo();else if(arguments.length===1&&n_(arguments[0]))if(r=arguments[0],s_(r,"prng")){if(!a_(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],!mue(i))throw new TypeError(_o("invalid argument. First argument must be a probability. Value: `%s`.",i));if(arguments.length>1){if(r=arguments[1],!n_(r))throw new TypeError(_o("invalid argument. Options argument must be an object. Value: `%s`.",r));if(s_(r,"prng")){if(!a_(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),i_(t,"state",u_(null),hue),Hr(t,"stateLength",null),Hr(t,"byteLength",null),Hr(t,"toJSON",u_(null)),Hr(t,"PRNG",e)):(Oo(t,"seed",n),Oo(t,"seedLength",a),i_(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=yue(e.state),i===void 0?h.params=[]:h.params=[i],h}function l(){return o_(e,i)}function m(h){return pue(h)||h<0||h>1?NaN:o_(e,h)}}v_.exports=que});var f_=s(function(a4e,g_){"use strict";var bue=Wl(),wue=bue();g_.exports=wue});var _a=s(function(s4e,l_){"use strict";var Sue=require("@stdlib/utils/define-nonenumerable-read-only-property"),d_=f_(),Oue=Wl();Sue(d_,"factory",Oue);l_.exports=d_});var Il=s(function(u4e,c_){"use strict";var Eue=Vr(),_ue=require("@stdlib/array/dtypes"),Nue=require("@stdlib/array/defaults"),Lue=_a(),Rue=_ue("real_and_generic"),Pue=Eue(Lue,Rue,Nue.get("dtypes.real"));c_.exports=Pue});var h_=s(function(o4e,m_){"use strict";var Tue=Il(),jue=Tue();m_.exports=jue});var q_=s(function(v4e,y_){"use strict";var Mue=require("@stdlib/utils/define-nonenumerable-read-only-property"),p_=h_(),xue=Il();Mue(p_,"factory",xue);y_.exports=p_});var S_=s(function(g4e,w_){"use strict";var Aue=require("@stdlib/assert/is-number").isPrimitive,Gue=require("@stdlib/assert/is-positive-number").isPrimitive,b_=require("@stdlib/string/format"),Vue=require("@stdlib/assert/is-nan");function Fue(r,e){return!Aue(r)||Vue(r)?new TypeError(b_("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Gue(e)?null:new TypeError(b_("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}w_.exports=Fue});var __=s(function(f4e,E_){"use strict";var O_=require("@stdlib/math/base/special/ln");function Wue(r,e,t){return e-t*O_(-O_(r()))}E_.exports=Wue});var kl=s(function(d4e,x_){"use strict";var Zr=require("@stdlib/utils/define-nonenumerable-read-only-property"),No=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),N_=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),L_=require("@stdlib/assert/is-plain-object"),R_=require("@stdlib/assert/is-function"),P_=require("@stdlib/assert/has-own-property"),T_=require("@stdlib/utils/constant-function"),Iue=require("@stdlib/utils/noop"),Lo=T().factory,j_=require("@stdlib/math/base/assert/is-nan"),kue=require("@stdlib/array/to-json"),Ro=require("@stdlib/string/format"),zue=S_(),M_=__();function Jue(){var r,e,t,i,n,a;if(arguments.length===0)t=Lo();else if(arguments.length===1){if(e=arguments[0],!L_(e))throw new TypeError(Ro("invalid argument. Options argument must be an object. Value: `%s`.",e));if(P_(e,"prng")){if(!R_(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=zue(a,r),n)throw n;if(arguments.length>2){if(e=arguments[2],!L_(e))throw new TypeError(Ro("invalid argument. Options argument must be an object. Value: `%s`.",e));if(P_(e,"prng")){if(!R_(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),N_(i,"state",T_(null),Iue),Zr(i,"stateLength",null),Zr(i,"byteLength",null),Zr(i,"toJSON",T_(null)),Zr(i,"PRNG",t)):(No(i,"seed",u),No(i,"seedLength",o),N_(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=kue(t.state),a===void 0?d.params=[]:d.params=[a,r],d}function h(){return M_(t,a,r)}function p(d,f){return j_(d)||j_(f)||f<=0?NaN:M_(t,d,f)}}x_.exports=Jue});var G_=s(function(l4e,A_){"use strict";var Uue=kl(),Cue=Uue();A_.exports=Cue});var Na=s(function(c4e,F_){"use strict";var Bue=require("@stdlib/utils/define-nonenumerable-read-only-property"),V_=G_(),Due=kl();Bue(V_,"factory",Due);F_.exports=V_});var zl=s(function(m4e,W_){"use strict";var Xue=F(),Yue=require("@stdlib/array/dtypes"),Hue=require("@stdlib/array/defaults"),Zue=Na(),Que=Yue("real_floating_point_and_generic"),$ue=Xue(Zue,Que,Hue.get("dtypes.real_floating_point"));W_.exports=$ue});var k_=s(function(h4e,I_){"use strict";var Kue=zl(),eoe=Kue();I_.exports=eoe});var U_=s(function(p4e,J_){"use strict";var roe=require("@stdlib/utils/define-nonenumerable-read-only-property"),z_=k_(),toe=zl();roe(z_,"factory",toe);J_.exports=z_});var B_=s(function(y4e,C_){"use strict";var Jl=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Qs=require("@stdlib/string/format");function ioe(r,e,t){return Jl(r)?Jl(e)?Jl(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))}C_.exports=ioe});var X_=s(function(q4e,D_){"use strict";var wt=require("@stdlib/math/base/special/factorial");function noe(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}D_.exports=noe});var H_=s(function(b4e,Y_){"use strict";var Po=X_();function aoe(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))}Y_.exports=aoe});var Cl=s(function(w4e,iN){"use strict";var Qr=require("@stdlib/utils/define-nonenumerable-read-only-property"),To=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Z_=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Q_=require("@stdlib/assert/is-plain-object"),$_=require("@stdlib/assert/is-function"),K_=require("@stdlib/assert/has-own-property"),eN=require("@stdlib/utils/constant-function"),soe=require("@stdlib/utils/noop"),jo=T().factory,Ul=require("@stdlib/math/base/assert/is-nonnegative-integer"),rN=require("@stdlib/constants/float64/pinf"),uoe=require("@stdlib/array/to-json"),Mo=require("@stdlib/string/format"),ooe=B_(),tN=H_();function voe(){var r,e,t,i,n,a,u;if(arguments.length===0)e=jo();else if(arguments.length===1){if(r=arguments[0],!Q_(r))throw new TypeError(Mo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(K_(r,"prng")){if(!$_(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=ooe(n,a,u),i)throw i;if(arguments.length>3){if(r=arguments[3],!Q_(r))throw new TypeError(Mo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(K_(r,"prng")){if(!$_(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),Z_(t,"state",eN(null),soe),Qr(t,"stateLength",null),Qr(t,"byteLength",null),Qr(t,"toJSON",eN(null)),Qr(t,"PRNG",e)):(To(t,"seed",o),To(t,"seedLength",v),Z_(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=uoe(e.state),n===void 0?f.params=[]:f.params=[n,a,u],f}function p(){return tN(e,n,a,u)}function d(f,y,q){return f===rN||y===rN||!Ul(f)||!Ul(y)||!Ul(q)||q>f?NaN:tN(e,f,y,q)}}iN.exports=voe});var aN=s(function(S4e,nN){"use strict";var goe=Cl(),foe=goe();nN.exports=foe});var La=s(function(O4e,uN){"use strict";var doe=require("@stdlib/utils/define-nonenumerable-read-only-property"),sN=aN(),loe=Cl();doe(sN,"factory",loe);uN.exports=sN});var Bl=s(function(E4e,oN){"use strict";var coe=qo(),moe=require("@stdlib/array/dtypes"),hoe=require("@stdlib/array/defaults"),poe=La(),yoe=moe("real_and_generic"),qoe=coe(poe,yoe,hoe.get("dtypes.real"));oN.exports=qoe});var gN=s(function(_4e,vN){"use strict";var boe=Bl(),woe=boe();vN.exports=woe});var lN=s(function(N4e,dN){"use strict";var Soe=require("@stdlib/utils/define-nonenumerable-read-only-property"),fN=gN(),Ooe=Bl();Soe(fN,"factory",Ooe);dN.exports=fN});var pN=s(function(L4e,hN){"use strict";var cN=require("@stdlib/assert/is-positive-number").isPrimitive,mN=require("@stdlib/string/format");function Eoe(r,e){return cN(r)?cN(e)?null:new TypeError(mN("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(mN("invalid argument. First argument must be a positive number. Value: `%s`.",r))}hN.exports=Eoe});var Dl=s(function(R4e,EN){"use strict";var St=require("@stdlib/utils/define-nonenumerable-read-only-property"),xo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),yN=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),qN=require("@stdlib/assert/is-plain-object"),bN=require("@stdlib/assert/is-function"),wN=require("@stdlib/assert/has-own-property"),SN=require("@stdlib/utils/constant-function"),_oe=require("@stdlib/utils/noop"),Ra=Ce().factory,ON=require("@stdlib/math/base/assert/is-nan"),Noe=require("@stdlib/array/to-json"),Ao=require("@stdlib/string/format"),Loe=pN();function Roe(){var r,e,t,i,n,a,u;if(arguments.length===0)r=Ra();else if(arguments.length===1){if(i=arguments[0],!qN(i))throw new TypeError(Ao("invalid argument. Options argument must be an object. Value: `%s`.",i));if(wN(i,"prng")){if(!bN(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],!qN(i))throw new TypeError(Ao("invalid argument. Options argument must be an object. Value: `%s`.",i));if(wN(i,"prng")){if(!bN(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),yN(a,"state",SN(null),_oe),St(a,"stateLength",null),St(a,"byteLength",null),St(a,"toJSON",SN(null))):(xo(a,"seed",o),xo(a,"seedLength",v),yN(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=Noe(n.state),e===void 0?f.params=[]:f.params=[e,t],f}function p(){return 1/r()}function d(f,y){return ON(f)||ON(y)||f<=0||y<=0?NaN:1/r(f,y)}}EN.exports=Roe});var NN=s(function(P4e,_N){"use strict";var Poe=Dl(),Toe=Poe();_N.exports=Toe});var ln=s(function(T4e,RN){"use strict";var joe=require("@stdlib/utils/define-nonenumerable-read-only-property"),LN=NN(),Moe=Dl();joe(LN,"factory",Moe);RN.exports=LN});var Xl=s(function(j4e,PN){"use strict";var xoe=F(),Aoe=require("@stdlib/array/dtypes"),Goe=require("@stdlib/array/defaults"),Voe=ln(),Foe=Aoe("real_floating_point_and_generic"),Woe=xoe(Voe,Foe,Goe.get("dtypes.real_floating_point"));PN.exports=Woe});var jN=s(function(M4e,TN){"use strict";var Ioe=Xl(),koe=Ioe();TN.exports=koe});var AN=s(function(x4e,xN){"use strict";var zoe=require("@stdlib/utils/define-nonenumerable-read-only-property"),MN=jN(),Joe=Xl();zoe(MN,"factory",Joe);xN.exports=MN});var WN=s(function(A4e,FN){"use strict";var GN=require("@stdlib/assert/is-positive-number").isPrimitive,VN=require("@stdlib/string/format");function Uoe(r,e){return GN(r)?GN(e)?null:new TypeError(VN("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(VN("invalid argument. First argument must be a positive number. Value: `%s`.",r))}FN.exports=Uoe});var zN=s(function(G4e,kN){"use strict";var IN=require("@stdlib/math/base/special/pow");function Coe(r,e,t){var i=r();return IN(1-IN(1-i,1/t),1/e)}kN.exports=Coe});var Yl=s(function(V4e,HN){"use strict";var $r=require("@stdlib/utils/define-nonenumerable-read-only-property"),Go=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),JN=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),UN=require("@stdlib/assert/is-plain-object"),CN=require("@stdlib/assert/is-function"),BN=require("@stdlib/assert/has-own-property"),DN=require("@stdlib/utils/constant-function"),Boe=require("@stdlib/utils/noop"),Vo=T().factory,XN=require("@stdlib/math/base/assert/is-nan"),Doe=require("@stdlib/array/to-json"),Fo=require("@stdlib/string/format"),Xoe=WN(),YN=zN();function Yoe(){var r,e,t,i,n,a;if(arguments.length===0)e=Vo();else if(arguments.length===1){if(r=arguments[0],!UN(r))throw new TypeError(Fo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(BN(r,"prng")){if(!CN(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],!UN(r))throw new TypeError(Fo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(BN(r,"prng")){if(!CN(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),JN(t,"state",DN(null),Boe),$r(t,"stateLength",null),$r(t,"byteLength",null),$r(t,"toJSON",DN(null)),$r(t,"PRNG",e)):(Go(t,"seed",u),Go(t,"seedLength",o),JN(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=Doe(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return YN(e,n,a)}function p(d,f){return XN(d)||XN(f)||d<=0||f<=0?NaN:YN(e,d,f)}}HN.exports=Yoe});var QN=s(function(F4e,ZN){"use strict";var Hoe=Yl(),Zoe=Hoe();ZN.exports=Zoe});var Pa=s(function(W4e,KN){"use strict";var Qoe=require("@stdlib/utils/define-nonenumerable-read-only-property"),$N=QN(),$oe=Yl();Qoe($N,"factory",$oe);KN.exports=$N});var Hl=s(function(I4e,eL){"use strict";var Koe=F(),eve=require("@stdlib/array/dtypes"),rve=require("@stdlib/array/defaults"),tve=Pa(),ive=eve("real_floating_point_and_generic"),nve=Koe(tve,ive,rve.get("dtypes.real_floating_point"));eL.exports=nve});var tL=s(function(k4e,rL){"use strict";var ave=Hl(),sve=ave();rL.exports=sve});var aL=s(function(z4e,nL){"use strict";var uve=require("@stdlib/utils/define-nonenumerable-read-only-property"),iL=tL(),ove=Hl();uve(iL,"factory",ove);nL.exports=iL});var oL=s(function(J4e,uL){"use strict";var vve=require("@stdlib/assert/is-number").isPrimitive,gve=require("@stdlib/assert/is-positive-number").isPrimitive,sL=require("@stdlib/string/format"),fve=require("@stdlib/assert/is-nan");function dve(r,e){return!vve(r)||fve(r)?new TypeError(sL("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):gve(e)?null:new TypeError(sL("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}uL.exports=dve});var gL=s(function(U4e,vL){"use strict";var lve=require("@stdlib/math/base/special/signum"),cve=require("@stdlib/math/base/special/abs"),mve=require("@stdlib/math/base/special/ln");function hve(r,e,t){var i=r()-.5;return e-t*lve(i)*mve(1-2*cve(i))}vL.exports=hve});var Zl=s(function(C4e,yL){"use strict";var Kr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),fL=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),dL=require("@stdlib/assert/is-plain-object"),lL=require("@stdlib/assert/is-function"),cL=require("@stdlib/assert/has-own-property"),mL=require("@stdlib/utils/constant-function"),pve=require("@stdlib/utils/noop"),Io=T().factory,hL=require("@stdlib/math/base/assert/is-nan"),yve=require("@stdlib/array/to-json"),ko=require("@stdlib/string/format"),qve=oL(),pL=gL();function bve(){var r,e,t,i,n,a;if(arguments.length===0)e=Io();else if(arguments.length===1){if(r=arguments[0],!dL(r))throw new TypeError(ko("invalid argument. Options argument must be an object. Value: `%s`.",r));if(cL(r,"prng")){if(!lL(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=qve(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!dL(r))throw new TypeError(ko("invalid argument. Options argument must be an object. Value: `%s`.",r));if(cL(r,"prng")){if(!lL(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),fL(t,"state",mL(null),pve),Kr(t,"stateLength",null),Kr(t,"byteLength",null),Kr(t,"toJSON",mL(null)),Kr(t,"PRNG",e)):(Wo(t,"seed",u),Wo(t,"seedLength",o),fL(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=yve(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return pL(e,n,a)}function p(d,f){return hL(d)||hL(f)||f<=0?NaN:pL(e,d,f)}}yL.exports=bve});var bL=s(function(B4e,qL){"use strict";var wve=Zl(),Sve=wve();qL.exports=Sve});var Ta=s(function(D4e,SL){"use strict";var Ove=require("@stdlib/utils/define-nonenumerable-read-only-property"),wL=bL(),Eve=Zl();Ove(wL,"factory",Eve);SL.exports=wL});var Ql=s(function(X4e,OL){"use strict";var _ve=F(),Nve=require("@stdlib/array/dtypes"),Lve=require("@stdlib/array/defaults"),Rve=Ta(),Pve=Nve("real_floating_point_and_generic"),Tve=_ve(Rve,Pve,Lve.get("dtypes.real_floating_point"));OL.exports=Tve});var _L=s(function(Y4e,EL){"use strict";var jve=Ql(),Mve=jve();EL.exports=Mve});var RL=s(function(H4e,LL){"use strict";var xve=require("@stdlib/utils/define-nonenumerable-read-only-property"),NL=_L(),Ave=Ql();xve(NL,"factory",Ave);LL.exports=NL});var jL=s(function(Z4e,TL){"use strict";var Gve=require("@stdlib/assert/is-number").isPrimitive,Vve=require("@stdlib/assert/is-positive-number").isPrimitive,PL=require("@stdlib/string/format"),Fve=require("@stdlib/assert/is-nan");function Wve(r,e){return!Gve(r)||Fve(r)?new TypeError(PL("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Vve(e)?null:new TypeError(PL("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}TL.exports=Wve});var xL=s(function(Q4e,ML){"use strict";var Ive=require("@stdlib/stats/base/dists/normal/quantile");function kve(r,e,t){var i=Ive(1-r()/2,0,1);return e+t/(i*i)}ML.exports=kve});var $l=s(function($4e,zL){"use strict";var et=require("@stdlib/utils/define-nonenumerable-read-only-property"),zo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),AL=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),GL=require("@stdlib/assert/is-plain-object"),VL=require("@stdlib/assert/is-function"),FL=require("@stdlib/assert/has-own-property"),WL=require("@stdlib/utils/constant-function"),zve=require("@stdlib/utils/noop"),Jo=T().factory,IL=require("@stdlib/math/base/assert/is-nan"),Jve=require("@stdlib/array/to-json"),Uo=require("@stdlib/string/format"),Uve=jL(),kL=xL();function Cve(){var r,e,t,i,n,a;if(arguments.length===0)e=Jo();else if(arguments.length===1){if(r=arguments[0],!GL(r))throw new TypeError(Uo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(FL(r,"prng")){if(!VL(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=Uve(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!GL(r))throw new TypeError(Uo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(FL(r,"prng")){if(!VL(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),AL(t,"state",WL(null),zve),et(t,"stateLength",null),et(t,"byteLength",null),et(t,"toJSON",WL(null)),et(t,"PRNG",e)):(zo(t,"seed",u),zo(t,"seedLength",o),AL(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=Jve(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return kL(e,n,a)}function p(d,f){return IL(d)||IL(f)||f<=0?NaN:kL(e,d,f)}}zL.exports=Cve});var UL=s(function(K4e,JL){"use strict";var Bve=$l(),Dve=Bve();JL.exports=Dve});var ja=s(function(eHe,BL){"use strict";var Xve=require("@stdlib/utils/define-nonenumerable-read-only-property"),CL=UL(),Yve=$l();Xve(CL,"factory",Yve);BL.exports=CL});var Kl=s(function(rHe,DL){"use strict";var Hve=F(),Zve=require("@stdlib/array/dtypes"),Qve=require("@stdlib/array/defaults"),$ve=ja(),Kve=Zve("real_floating_point_and_generic"),ege=Hve($ve,Kve,Qve.get("dtypes.real_floating_point"));DL.exports=ege});var YL=s(function(tHe,XL){"use strict";var rge=Kl(),tge=rge();XL.exports=tge});var QL=s(function(iHe,ZL){"use strict";var ige=require("@stdlib/utils/define-nonenumerable-read-only-property"),HL=YL(),nge=Kl();ige(HL,"factory",nge);ZL.exports=HL});var eR=s(function(nHe,KL){"use strict";var age=require("@stdlib/assert/is-number").isPrimitive,sge=require("@stdlib/assert/is-positive-number").isPrimitive,uge=require("@stdlib/assert/is-nan"),$L=require("@stdlib/string/format");function oge(r,e){return!age(r)||uge(r)?new TypeError($L("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):sge(e)?null:new TypeError($L("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}KL.exports=oge});var tR=s(function(aHe,rR){"use strict";var vge=require("@stdlib/math/base/special/ln");function gge(r,e,t){var i=r();return e+t*vge(i/(1-i))}rR.exports=gge});var ec=s(function(sHe,gR){"use strict";var rt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Co=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),iR=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),nR=require("@stdlib/assert/is-plain-object"),aR=require("@stdlib/assert/is-function"),sR=require("@stdlib/assert/has-own-property"),uR=require("@stdlib/utils/constant-function"),fge=require("@stdlib/utils/noop"),Bo=T().factory,oR=require("@stdlib/math/base/assert/is-nan"),dge=require("@stdlib/array/to-json"),Do=require("@stdlib/string/format"),lge=eR(),vR=tR();function cge(){var r,e,t,i,n,a;if(arguments.length===0)e=Bo();else if(arguments.length===1){if(r=arguments[0],!nR(r))throw new TypeError(Do("invalid argument. Options argument must be an object. Value: `%s`.",r));if(sR(r,"prng")){if(!aR(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=lge(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!nR(r))throw new TypeError(Do("invalid argument. Options argument must be an object. Value: `%s`.",r));if(sR(r,"prng")){if(!aR(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),iR(t,"state",uR(null),fge),rt(t,"stateLength",null),rt(t,"byteLength",null),rt(t,"toJSON",uR(null)),rt(t,"PRNG",e)):(Co(t,"seed",u),Co(t,"seedLength",o),iR(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=dge(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return vR(e,n,a)}function p(d,f){return oR(d)||oR(f)||f<=0?NaN:vR(e,d,f)}}gR.exports=cge});var dR=s(function(uHe,fR){"use strict";var mge=ec(),hge=mge();fR.exports=hge});var Ma=s(function(oHe,cR){"use strict";var pge=require("@stdlib/utils/define-nonenumerable-read-only-property"),lR=dR(),yge=ec();pge(lR,"factory",yge);cR.exports=lR});var rc=s(function(vHe,mR){"use strict";var qge=F(),bge=require("@stdlib/array/dtypes"),wge=require("@stdlib/array/defaults"),Sge=Ma(),Oge=bge("real_floating_point_and_generic"),Ege=qge(Sge,Oge,wge.get("dtypes.real_floating_point"));mR.exports=Ege});var pR=s(function(gHe,hR){"use strict";var _ge=rc(),Nge=_ge();hR.exports=Nge});var bR=s(function(fHe,qR){"use strict";var Lge=require("@stdlib/utils/define-nonenumerable-read-only-property"),yR=pR(),Rge=rc();Lge(yR,"factory",Rge);qR.exports=yR});var OR=s(function(dHe,SR){"use strict";var Pge=require("@stdlib/assert/is-number").isPrimitive,Tge=require("@stdlib/assert/is-positive-number").isPrimitive,wR=require("@stdlib/string/format"),jge=require("@stdlib/assert/is-nan");function Mge(r,e){return!Pge(r)||jge(r)?new TypeError(wR("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Tge(e)?null:new TypeError(wR("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}SR.exports=Mge});var _R=s(function(lHe,ER){"use strict";var xge=require("@stdlib/math/base/special/exp");function Age(r,e,t){return xge(e+t*r())}ER.exports=Age});var tc=s(function(cHe,xR){"use strict";var Ot=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),NR=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),LR=require("@stdlib/assert/is-plain-object"),RR=require("@stdlib/assert/is-function"),PR=require("@stdlib/assert/has-own-property"),TR=require("@stdlib/utils/constant-function"),Gge=require("@stdlib/utils/noop"),xa=Q().factory,jR=require("@stdlib/math/base/assert/is-nan"),Vge=require("@stdlib/array/to-json"),Yo=require("@stdlib/string/format"),Fge=OR(),MR=_R();function Wge(){var r,e,t,i,n,a,u;if(arguments.length===0)e=xa();else if(arguments.length===1){if(t=arguments[0],!LR(t))throw new TypeError(Yo("invalid argument. Options argument must be an object. Value: `%s`.",t));if(PR(t,"prng")){if(!RR(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=Fge(u,r),a)throw a;if(arguments.length>2){if(t=arguments[2],!LR(t))throw new TypeError(Yo("invalid argument. Options argument must be an object. Value: `%s`.",t));if(PR(t,"prng")){if(!RR(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),NR(n,"state",TR(null),Gge),Ot(n,"stateLength",null),Ot(n,"byteLength",null),Ot(n,"toJSON",TR(null))):(Xo(n,"seed",o),Xo(n,"seedLength",v),NR(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=Vge(i.state),u===void 0?f.params=[]:f.params=[u,r],f}function p(){return MR(e,u,r)}function d(f,y){return jR(f)||jR(y)||y<=0?NaN:MR(e,f,y)}}xR.exports=Wge});var GR=s(function(mHe,AR){"use strict";var Ige=tc(),kge=Ige();AR.exports=kge});var cn=s(function(hHe,FR){"use strict";var zge=require("@stdlib/utils/define-nonenumerable-read-only-property"),VR=GR(),Jge=tc();zge(VR,"factory",Jge);FR.exports=VR});var ic=s(function(pHe,WR){"use strict";var Uge=F(),Cge=require("@stdlib/array/dtypes"),Bge=require("@stdlib/array/defaults"),Dge=cn(),Xge=Cge("real_floating_point_and_generic"),Yge=Uge(Dge,Xge,Bge.get("dtypes.real_floating_point"));WR.exports=Yge});var kR=s(function(yHe,IR){"use strict";var Hge=ic(),Zge=Hge();IR.exports=Zge});var UR=s(function(qHe,JR){"use strict";var Qge=require("@stdlib/utils/define-nonenumerable-read-only-property"),zR=kR(),$ge=ic();Qge(zR,"factory",$ge);JR.exports=zR});var nc=s(function(bHe,CR){"use strict";var Kge=require("@stdlib/constants/int32/max"),efe=require("@stdlib/math/base/special/floor"),rfe=Kge-1;function tfe(){var r=efe(1+rfe*Math.random());return r|0}CR.exports=tfe});var uc=s(function(wHe,HR){"use strict";var tt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Et=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),BR=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ac=require("@stdlib/assert/has-own-property"),ife=require("@stdlib/assert/is-plain-object"),nfe=require("@stdlib/assert/is-boolean").isPrimitive,afe=require("@stdlib/assert/is-collection"),sfe=require("@stdlib/assert/is-positive-integer").isPrimitive,DR=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"),ufe=require("@stdlib/array/to-json"),XR=nc(),sc=Ho-1|0,ofe=Ho-1|0,vfe=16807,Zo=1,Qo=2,_t=2,X=4,$s=5;function YR(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 gfe(r){var e,t,i,n,a,u;if(i={},arguments.length){if(!ife(r))throw new TypeError(Be("invalid argument. Options argument must be an object. Value: `%s`.",r));if(ac(r,"copy")&&(i.copy=r.copy,!nfe(r.copy)))throw new TypeError(Be("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy));if(ac(r,"state")){if(t=r.state,i.state=!0,!DR(t))throw new TypeError(Be("invalid option. `%s` option must be an Int32Array. Option: `%s`.","state",t));if(u=YR(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(ac(r,"seed"))if(n=r.seed,i.seed=!0,sfe(n)){if(n>ofe)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(afe(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=XR()|0}else n=XR()|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),BR(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),BR(d,"state",l,m),Et(d,"stateLength",g),Et(d,"byteLength",c),tt(d,"toJSON",h),tt(d,"MIN",(p.MIN-1)/sc),tt(d,"MAX",(p.MAX-1)/sc),p;function o(){var f=e[X];return Aa(f,n,1,new D(f),1)}function v(){return e[X]}function g(){return e.length}function c(){return e.byteLength}function l(){var f=e.length;return Aa(f,e,1,new D(f),1)}function m(f){var y;if(!DR(f))throw new TypeError(Be("invalid argument. Must provide an Int32Array. Value: `%s`.",f));if(y=YR(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=ufe(e),f.params=[],f}function p(){var f=t[0]|0;return f=vfe*f%Ho|0,t[0]=f,f|0}function d(){return(p()-1)/sc}}HR.exports=gfe});var QR=s(function(SHe,ZR){"use strict";var ffe=uc(),dfe=nc(),lfe=ffe({seed:dfe()});ZR.exports=lfe});var $=s(function(OHe,KR){"use strict";var cfe=require("@stdlib/utils/define-nonenumerable-read-only-property"),$R=QR(),mfe=uc();cfe($R,"factory",mfe);KR.exports=$R});var eP=s(function(EHe,hfe){hfe.exports={idtype:"float64",ndtype:"float64"}});var tP=s(function(_He,rP){"use strict";var pfe=require("@stdlib/array/typed-real-float-dtypes"),yfe=require("@stdlib/array/typed-real-dtypes"),qfe=require("@stdlib/assert/is-plain-object"),$o=require("@stdlib/assert/has-own-property"),Ks=require("@stdlib/string/format"),eu=yfe(),ru=pfe();eu.push("generic");ru.push("generic");function bfe(r,e,t){if(!qfe(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}rP.exports=bfe});var vc=s(function(NHe,fP){"use strict";var iP=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,nP=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ko=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),wfe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),aP=$(),sP=require("@stdlib/array/typed-real-ctors"),uP=require("@stdlib/array/base/filled-by"),oP=require("@stdlib/strided/base/nullary"),vP=require("@stdlib/string/format"),gP=eP(),oc=tP();function Sfe(){var r,e,t,i,n,a;if(t={idtype:gP.idtype,ndtype:gP.ndtype},e=arguments.length,i=u,e===0)n=aP;else if(e===1&&(r=arguments[0],n=aP.factory(r),a=oc(t,r,0),a))throw a;return Ko(i,"seed",v),Ko(i,"seedLength",g),wfe(i,"state",m,h),Ko(i,"stateLength",c),Ko(i,"byteLength",l),nP(i,"PRNG",n),nP(i,"normalized",o),i;function u(p,d){var f,y,q,b,w;if(!iP(p))throw new TypeError(vP("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=oc(w,d,1),q))throw q;return b=w.dtype||t.idtype,b==="generic"?uP(p,n):(f=sP(b),y=new f(p),oP([y],[p],[1],n),y)}function o(p,d){var f,y,q,b,w;if(!iP(p))throw new TypeError(vP("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=oc(w,d,2),q))throw q;return b=w.dtype||t.ndtype,b==="generic"?uP(p,n.normalized):(f=sP(b),y=new f(p),oP([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}}fP.exports=Sfe});var lP=s(function(LHe,dP){"use strict";var Ofe=vc(),Efe=Ofe();dP.exports=Efe});var hP=s(function(RHe,mP){"use strict";var _fe=require("@stdlib/utils/define-nonenumerable-read-only-property"),cP=lP(),Nfe=vc();_fe(cP,"factory",Nfe);mP.exports=cP});var yP=s(function(PHe,pP){"use strict";var Lfe=require("@stdlib/math/base/assert/is-nan"),Rfe=8;function Pfe(r,e,t){var i,n;for(n=0;n=0;n--)e[n]=r();return e}pP.exports=Pfe});var gc=s(function(THe,qP){"use strict";var Tfe=require("@stdlib/constants/int32/max"),jfe=require("@stdlib/math/base/special/floor"),Mfe=Tfe-1;function xfe(){var r=jfe(1+Mfe*Math.random());return r|0}qP.exports=xfe});var lc=s(function(jHe,_P){"use strict";var it=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nt=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),bP=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),fc=require("@stdlib/assert/has-own-property"),Afe=require("@stdlib/assert/is-plain-object"),Gfe=require("@stdlib/assert/is-boolean").isPrimitive,Vfe=require("@stdlib/assert/is-collection"),Ffe=require("@stdlib/assert/is-positive-integer").isPrimitive,wP=require("@stdlib/assert/is-int32array"),Ga=require("@stdlib/blas/base/gcopy"),Wfe=require("@stdlib/math/base/special/floor"),Y=require("@stdlib/array/int32"),tu=require("@stdlib/constants/int32/max"),Ife=require("@stdlib/array/to-json"),K=require("@stdlib/string/format"),SP=yP(),OP=gc(),dc=tu-1|0,kfe=tu-1|0,zfe=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 EP(r,e){var t;return e?t="option":t="argument",r.lengthkfe)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(Vfe(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=SP(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=OP()|0}else n=OP()|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=SP(p,t,Z),e[ev]=t[0]),it(d,"NAME","minstd-shuffle"),Nt(d,"seed",o),Nt(d,"seedLength",v),bP(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),bP(f,"state",l,m),Nt(f,"stateLength",g),Nt(f,"byteLength",c),it(f,"toJSON",h),it(f,"MIN",(d.MIN-1)/dc),it(f,"MAX",(d.MAX-1)/dc),d;function o(){var y=e[H];return Ga(y,n,1,new Y(y),1)}function v(){return e[H]}function g(){return e.length}function c(){return e.byteLength}function l(){var y=e.length;return Ga(y,e,1,new Y(y),1)}function m(y){var q;if(!wP(y))throw new TypeError(K("invalid argument. Must provide an Int32Array. Value: `%s`.",y));if(q=EP(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=Ife(e),y.params=[],y}function p(){var y=e[rv]|0;return y=zfe*y%tu|0,e[rv]=y,y|0}function d(){var y,q;return y=e[ev],q=Wfe(Z*(y/tu)),y=t[q],e[ev]=y,t[q]=p(),y}function f(){return(d()-1)/dc}}_P.exports=Jfe});var LP=s(function(MHe,NP){"use strict";var Ufe=lc(),Cfe=gc(),Bfe=Ufe({seed:Cfe()});NP.exports=Bfe});var ee=s(function(xHe,PP){"use strict";var Dfe=require("@stdlib/utils/define-nonenumerable-read-only-property"),RP=LP(),Xfe=lc();Dfe(RP,"factory",Xfe);PP.exports=RP});var TP=s(function(AHe,Yfe){Yfe.exports={idtype:"float64",ndtype:"float64"}});var MP=s(function(GHe,jP){"use strict";var Hfe=require("@stdlib/array/typed-real-float-dtypes"),Zfe=require("@stdlib/array/typed-real-dtypes"),Qfe=require("@stdlib/assert/is-plain-object"),nv=require("@stdlib/assert/has-own-property"),nu=require("@stdlib/string/format"),au=Zfe(),su=Hfe();au.push("generic");su.push("generic");function $fe(r,e,t){if(!Qfe(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}jP.exports=$fe});var mc=s(function(VHe,zP){"use strict";var xP=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,AP=require("@stdlib/utils/define-nonenumerable-read-only-property"),av=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Kfe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),GP=ee(),VP=require("@stdlib/array/typed-real-ctors"),FP=require("@stdlib/array/base/filled-by"),WP=require("@stdlib/strided/base/nullary"),IP=require("@stdlib/string/format"),kP=TP(),cc=MP();function ede(){var r,e,t,i,n,a;if(t={idtype:kP.idtype,ndtype:kP.ndtype},e=arguments.length,i=u,e===0)n=GP;else if(e===1&&(r=arguments[0],n=GP.factory(r),a=cc(t,r,0),a))throw a;return av(i,"seed",v),av(i,"seedLength",g),Kfe(i,"state",m,h),av(i,"stateLength",c),av(i,"byteLength",l),AP(i,"PRNG",n),AP(i,"normalized",o),i;function u(p,d){var f,y,q,b,w;if(!xP(p))throw new TypeError(IP("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=cc(w,d,1),q))throw q;return b=w.dtype||t.idtype,b==="generic"?FP(p,n):(f=VP(b),y=new f(p),WP([y],[p],[1],n),y)}function o(p,d){var f,y,q,b,w;if(!xP(p))throw new TypeError(IP("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=cc(w,d,2),q))throw q;return b=w.dtype||t.ndtype,b==="generic"?FP(p,n.normalized):(f=VP(b),y=new f(p),WP([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}}zP.exports=ede});var UP=s(function(FHe,JP){"use strict";var rde=mc(),tde=rde();JP.exports=tde});var DP=s(function(WHe,BP){"use strict";var ide=require("@stdlib/utils/define-nonenumerable-read-only-property"),CP=UP(),nde=mc();ide(CP,"factory",nde);BP.exports=CP});var XP=s(function(IHe,ade){ade.exports={idtype:"float64",ndtype:"float64"}});var HP=s(function(kHe,YP){"use strict";var sde=require("@stdlib/array/typed-real-float-dtypes"),ude=require("@stdlib/array/typed-real-dtypes"),ode=require("@stdlib/assert/is-plain-object"),sv=require("@stdlib/assert/has-own-property"),uu=require("@stdlib/string/format"),ou=ude(),vu=sde();ou.push("generic");vu.push("generic");function vde(r,e,t){if(!ode(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}YP.exports=vde});var pc=s(function(zHe,nT){"use strict";var ZP=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,QP=require("@stdlib/utils/define-nonenumerable-read-only-property"),uv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),gde=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),$P=T(),KP=require("@stdlib/array/typed-real-ctors"),eT=require("@stdlib/array/base/filled-by"),rT=require("@stdlib/strided/base/nullary"),tT=require("@stdlib/string/format"),iT=XP(),hc=HP();function fde(){var r,e,t,i,n,a;if(t={idtype:iT.idtype,ndtype:iT.ndtype},e=arguments.length,i=u,e===0)n=$P;else if(e===1&&(r=arguments[0],n=$P.factory(r),a=hc(t,r,0),a))throw a;return uv(i,"seed",v),uv(i,"seedLength",g),gde(i,"state",m,h),uv(i,"stateLength",c),uv(i,"byteLength",l),QP(i,"PRNG",n),QP(i,"normalized",o),i;function u(p,d){var f,y,q,b,w;if(!ZP(p))throw new TypeError(tT("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=hc(w,d,1),q))throw q;return b=w.dtype||t.idtype,b==="generic"?eT(p,n):(f=KP(b),y=new f(p),rT([y],[p],[1],n),y)}function o(p,d){var f,y,q,b,w;if(!ZP(p))throw new TypeError(tT("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=hc(w,d,2),q))throw q;return b=w.dtype||t.ndtype,b==="generic"?eT(p,n.normalized):(f=KP(b),y=new f(p),rT([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}}nT.exports=fde});var sT=s(function(JHe,aT){"use strict";var dde=pc(),lde=dde();aT.exports=lde});var vT=s(function(UHe,oT){"use strict";var cde=require("@stdlib/utils/define-nonenumerable-read-only-property"),uT=sT(),mde=pc();cde(uT,"factory",mde);oT.exports=uT});var fT=s(function(CHe,gT){"use strict";var hde=require("@stdlib/math/base/special/exp");function pde(r,e){for(var t=r(),i=1;t>hde(-e);)i+=1,t*=r();return i-1}gT.exports=pde});var mT=s(function(BHe,cT){"use strict";var yde=require("@stdlib/math/base/special/factorialln"),dT=require("@stdlib/math/base/special/floor"),qde=require("@stdlib/math/base/special/signum"),bde=require("@stdlib/math/base/special/sqrt"),lT=require("@stdlib/math/base/special/abs"),ov=require("@stdlib/math/base/special/ln"),wde=require("@stdlib/constants/float64/ln-sqrt-two-pi"),Sde=1/12,Ode=1/360;function Ede(r,e){var t,i,n,a,u,o,v,g,c,l;for(t=bde(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-lT(c))+v,c+=e+.445,dT(c);if(l>=u?c=r()-.5:(c=l/u-.93,c=qde(c)*.5-c,l=u*r()),a=.5-lT(c),(a>=.013||a>=l)&&(g=dT((2*o/a+v)*c+e+.445),l*=i/(o/(a*a)+v),c=(g+.5)*ov(e/g),c+=-e-wde+g,c-=(Sde-Ode/(g*g))/g,g>=10&&c>=ov(l*t)||(c=g*ov(e)-e-yde(g),g>=0&&g<=9&&c>=ov(l))))return g}}cT.exports=Ede});var pT=s(function(DHe,hT){"use strict";var _de=fT(),Nde=mT();function Lde(r,e){return e<30?_de(r,e):Nde(r,e)}hT.exports=Lde});var yc=s(function(XHe,ET){"use strict";var nt=require("@stdlib/utils/define-nonenumerable-read-only-property"),vv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),yT=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Rde=require("@stdlib/assert/is-positive-number").isPrimitive,qT=require("@stdlib/assert/is-plain-object"),bT=require("@stdlib/assert/is-function"),wT=require("@stdlib/assert/has-own-property"),ST=require("@stdlib/utils/constant-function"),Pde=require("@stdlib/utils/noop"),gv=T().factory,Tde=require("@stdlib/math/base/assert/is-nan"),jde=require("@stdlib/array/to-json"),fv=require("@stdlib/string/format"),OT=pT();function Mde(){var r,e,t,i;if(arguments.length===0)t=gv();else if(arguments.length===1&&qT(arguments[0]))if(e=arguments[0],wT(e,"prng")){if(!bT(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],!Rde(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],!qT(e))throw new TypeError(fv("invalid argument. Options argument must be an object. Value: `%s`.",e));if(wT(e,"prng")){if(!bT(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),yT(i,"state",ST(null),Pde),nt(i,"stateLength",null),nt(i,"byteLength",null),nt(i,"toJSON",ST(null)),nt(i,"PRNG",t)):(vv(i,"seed",n),vv(i,"seedLength",a),yT(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=jde(t.state),r===void 0?h.params=[]:h.params=[r],h}function l(){return OT(t,r)}function m(h){return Tde(h)||h<=0?NaN:OT(t,h)}}ET.exports=Mde});var NT=s(function(YHe,_T){"use strict";var xde=yc(),Ade=xde();_T.exports=Ade});var mn=s(function(HHe,RT){"use strict";var Gde=require("@stdlib/utils/define-nonenumerable-read-only-property"),LT=NT(),Vde=yc();Gde(LT,"factory",Vde);RT.exports=LT});var TT=s(function(ZHe,PT){"use strict";var Fde=require("@stdlib/assert/is-positive-number").isPrimitive,Wde=require("@stdlib/assert/is-number").isPrimitive,qc=require("@stdlib/string/format"),Ide=require("@stdlib/assert/is-nan");function kde(r,e){return Fde(r)?!Wde(e)||Ide(e)?new TypeError(qc("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):e<=0||e>=1?new RangeError(qc("invalid argument. Second argument must be on the interval: (0, 1). Value: `%f`.",e)):null:new TypeError(qc("invalid argument. First argument must be a positive number. Value: `%s`.",r))}PT.exports=kde});var Oc=s(function(QHe,WT){"use strict";var Rt=require("@stdlib/utils/define-nonenumerable-read-only-property"),dv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),jT=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Fa=require("@stdlib/assert/has-own-property"),MT=require("@stdlib/assert/is-plain-object"),bc=require("@stdlib/assert/is-uint32array"),xT=require("@stdlib/assert/is-boolean").isPrimitive,AT=require("@stdlib/assert/is-function"),GT=require("@stdlib/utils/constant-function"),zde=require("@stdlib/utils/noop"),VT=require("@stdlib/math/base/assert/is-nan"),Wa=mn().factory,lv=Ce().factory,wc=require("@stdlib/blas/base/gcopy"),Sc=require("@stdlib/array/uint32"),FT=require("@stdlib/object/assign"),Jde=require("@stdlib/array/to-json"),at=require("@stdlib/string/format"),Ude=TT();function Cde(){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],!MT(i))throw new TypeError(at("invalid argument. Options argument must be an object. Value: `%s`.",i));if(Fa(i,"copy")&&!xT(i.copy))throw new TypeError(at("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",i.copy));if(Fa(i,"prng")){if(!AT(i.prng))throw new TypeError(at("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));t=Wa({prng:i.prng})}else{if(Fa(i,"state")&&!bc(i.state))throw new TypeError(at("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",i.state));i=FT({},i),i.copy===!1?u=!1:i.state&&(i.state=wc(i.state.length,i.state,1,new Sc(i.state.length),1)),i.copy=!1,t=Wa(i)}}else{if(g=arguments[0],v=arguments[1],o=Ude(g,v),o)throw o;if(arguments.length>2){if(i=arguments[2],!MT(i))throw new TypeError(at("invalid argument. Options argument must be an object. Value: `%s`.",i));if(Fa(i,"copy")&&!xT(i.copy))throw new TypeError(at("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",i.copy));if(Fa(i,"prng")){if(!AT(i.prng))throw new TypeError(at("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));t=Wa({prng:i.prng})}else{if(Fa(i,"state")&&!bc(i.state))throw new TypeError(at("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",i.state));i=FT({},i),i.copy===!1?u=!1:i.state&&(i.state=wc(i.state.length,i.state,1,new Sc(i.state.length),1)),i.copy=!1,t=Wa(i)}}else i={copy:!1},t=Wa(i)}return i&&i.prng?g===void 0?r=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),jT(n,"state",GT(null),zde),Rt(n,"stateLength",null),Rt(n,"byteLength",null),Rt(n,"toJSON",GT(null))):(dv(n,"seed",c),dv(n,"seedLength",l),jT(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(!bc(b))throw new TypeError(at("invalid argument. Must provide a Uint32Array. Value: `%s`.",b));u&&(b=wc(b.length,b,1,new Sc(b.length),1)),a.state=b}function f(){var b={};return b.type="PRNG",b.name=n.NAME,b.state=Jde(a.state),g===void 0?b.params=[]:b.params=[g,v],b}function y(){return t(r())}function q(b,w){return VT(b)||VT(w)||w<=0||w>=1?NaN:t(r(b,w/(1-w)))}}WT.exports=Cde});var kT=s(function($He,IT){"use strict";var Bde=Oc(),Dde=Bde();IT.exports=Dde});var Ia=s(function(KHe,JT){"use strict";var Xde=require("@stdlib/utils/define-nonenumerable-read-only-property"),zT=kT(),Yde=Oc();Xde(zT,"factory",Yde);JT.exports=zT});var Ec=s(function(eZe,UT){"use strict";var Hde=F(),Zde=require("@stdlib/array/dtypes"),Qde=require("@stdlib/array/defaults"),$de=Ia(),Kde=Zde("real_and_generic"),ele=Hde($de,Kde,Qde.get("dtypes.real"));UT.exports=ele});var BT=s(function(rZe,CT){"use strict";var rle=Ec(),tle=rle();CT.exports=tle});var YT=s(function(tZe,XT){"use strict";var ile=require("@stdlib/utils/define-nonenumerable-read-only-property"),DT=BT(),nle=Ec();ile(DT,"factory",nle);XT.exports=DT});var QT=s(function(iZe,ZT){"use strict";var ale=require("@stdlib/assert/is-number").isPrimitive,sle=require("@stdlib/assert/is-positive-number").isPrimitive,HT=require("@stdlib/string/format"),ule=require("@stdlib/assert/is-nan");function ole(r,e){return!ale(r)||ule(r)?new TypeError(HT("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):sle(e)?null:new TypeError(HT("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}ZT.exports=ole});var KT=s(function(nZe,$T){"use strict";function vle(r,e,t){return e+t*r()}$T.exports=vle});var _c=s(function(aZe,uj){"use strict";var Pt=require("@stdlib/utils/define-nonenumerable-read-only-property"),cv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),ej=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),rj=require("@stdlib/assert/is-plain-object"),tj=require("@stdlib/assert/is-function"),ij=require("@stdlib/assert/has-own-property"),nj=require("@stdlib/utils/constant-function"),gle=require("@stdlib/utils/noop"),ka=Q().factory,aj=require("@stdlib/math/base/assert/is-nan"),fle=require("@stdlib/array/to-json"),mv=require("@stdlib/string/format"),dle=QT(),sj=KT();function lle(){var r,e,t,i,n,a,u;if(arguments.length===0)e=ka();else if(arguments.length===1){if(t=arguments[0],!rj(t))throw new TypeError(mv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(ij(t,"prng")){if(!tj(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=dle(u,r),a)throw a;if(arguments.length>2){if(t=arguments[2],!rj(t))throw new TypeError(mv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(ij(t,"prng")){if(!tj(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),ej(n,"state",nj(null),gle),Pt(n,"stateLength",null),Pt(n,"byteLength",null),Pt(n,"toJSON",nj(null))):(cv(n,"seed",o),cv(n,"seedLength",v),ej(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=fle(i.state),u===void 0?f.params=[]:f.params=[u,r],f}function p(){return sj(e,u,r)}function d(f,y){return aj(f)||aj(y)||y<=0?NaN:sj(e,f,y)}}uj.exports=lle});var vj=s(function(sZe,oj){"use strict";var cle=_c(),mle=cle();oj.exports=mle});var hn=s(function(uZe,fj){"use strict";var hle=require("@stdlib/utils/define-nonenumerable-read-only-property"),gj=vj(),ple=_c();hle(gj,"factory",ple);fj.exports=gj});var Nc=s(function(oZe,dj){"use strict";var yle=F(),qle=require("@stdlib/array/dtypes"),ble=require("@stdlib/array/defaults"),wle=hn(),Sle=qle("real_floating_point_and_generic"),Ole=yle(wle,Sle,ble.get("dtypes.real_floating_point"));dj.exports=Ole});var cj=s(function(vZe,lj){"use strict";var Ele=Nc(),_le=Ele();lj.exports=_le});var pj=s(function(gZe,hj){"use strict";var Nle=require("@stdlib/utils/define-nonenumerable-read-only-property"),mj=cj(),Lle=Nc();Nle(mj,"factory",Lle);hj.exports=mj});var wj=s(function(fZe,bj){"use strict";var yj=require("@stdlib/assert/is-positive-number").isPrimitive,qj=require("@stdlib/string/format");function Rle(r,e){return yj(r)?yj(e)?null:new TypeError(qj("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(qj("invalid argument. First argument must be a positive number. Value: `%s`.",r))}bj.exports=Rle});var Oj=s(function(dZe,Sj){"use strict";var Ple=require("@stdlib/math/base/special/pow");function Tle(r,e,t){return t/Ple(r(),1/e)}Sj.exports=Tle});var Lc=s(function(lZe,jj){"use strict";var st=require("@stdlib/utils/define-nonenumerable-read-only-property"),hv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Ej=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),_j=require("@stdlib/assert/is-plain-object"),Nj=require("@stdlib/assert/is-function"),Lj=require("@stdlib/assert/has-own-property"),Rj=require("@stdlib/utils/constant-function"),jle=require("@stdlib/utils/noop"),pv=T().factory,Pj=require("@stdlib/math/base/assert/is-nan"),Mle=require("@stdlib/array/to-json"),yv=require("@stdlib/string/format"),xle=wj(),Tj=Oj();function Ale(){var r,e,t,i,n,a;if(arguments.length===0)i=pv();else if(arguments.length===1){if(t=arguments[0],!_j(t))throw new TypeError(yv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(Lj(t,"prng")){if(!Nj(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=xle(r,e),a)throw a;if(arguments.length>2){if(t=arguments[2],!_j(t))throw new TypeError(yv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(Lj(t,"prng")){if(!Nj(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),Ej(n,"state",Rj(null),jle),st(n,"stateLength",null),st(n,"byteLength",null),st(n,"toJSON",Rj(null)),st(n,"PRNG",i)):(hv(n,"seed",u),hv(n,"seedLength",o),Ej(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=Mle(i.state),r===void 0?d.params=[]:d.params=[r,e],d}function h(){return Tj(i,r,e)}function p(d,f){return Pj(d)||Pj(f)||d<=0||f<=0?NaN:Tj(i,d,f)}}jj.exports=Ale});var xj=s(function(cZe,Mj){"use strict";var Gle=Lc(),Vle=Gle();Mj.exports=Vle});var za=s(function(mZe,Gj){"use strict";var Fle=require("@stdlib/utils/define-nonenumerable-read-only-property"),Aj=xj(),Wle=Lc();Fle(Aj,"factory",Wle);Gj.exports=Aj});var Rc=s(function(hZe,Vj){"use strict";var Ile=F(),kle=require("@stdlib/array/dtypes"),zle=require("@stdlib/array/defaults"),Jle=za(),Ule=kle("real_floating_point_and_generic"),Cle=Ile(Jle,Ule,zle.get("dtypes.real_floating_point"));Vj.exports=Cle});var Wj=s(function(pZe,Fj){"use strict";var Ble=Rc(),Dle=Ble();Fj.exports=Dle});var zj=s(function(yZe,kj){"use strict";var Xle=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ij=Wj(),Yle=Rc();Xle(Ij,"factory",Yle);kj.exports=Ij});var Pc=s(function(qZe,Jj){"use strict";var Hle=Vr(),Zle=require("@stdlib/array/dtypes"),Qle=require("@stdlib/array/defaults"),$le=mn(),Kle=Zle("real_and_generic"),ece=Hle($le,Kle,Qle.get("dtypes.real"));Jj.exports=ece});var Cj=s(function(bZe,Uj){"use strict";var rce=Pc(),tce=rce();Uj.exports=tce});var Xj=s(function(wZe,Dj){"use strict";var ice=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bj=Cj(),nce=Pc();ice(Bj,"factory",nce);Dj.exports=Bj});var Yj=s(function(SZe,ace){ace.exports={name:"mt19937",copy:!0}});var Zj=s(function(OZe,Hj){"use strict";var sce=$(),uce=ee(),oce=T(),qv={};qv.minstd=sce;qv["minstd-shuffle"]=uce;qv.mt19937=oce;Hj.exports=qv});var Tc=s(function(EZe,$j){"use strict";var gu=require("@stdlib/utils/define-nonenumerable-read-only-property"),bv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),vce=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),gce=require("@stdlib/assert/is-plain-object"),fce=require("@stdlib/assert/is-boolean").isPrimitive,wv=require("@stdlib/assert/has-own-property"),dce=require("@stdlib/array/to-json"),fu=require("@stdlib/string/format"),Qj=Yj(),lce=Zj();function cce(r){var e,t,i;if(e={name:Qj.name,copy:Qj.copy},arguments.length){if(!gce(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,!fce(e.copy)))throw new TypeError(fu("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",e.copy))}if(i=lce[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),vce(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=dce(t.state),m.params=[],m}function l(){return t.normalized()}}$j.exports=cce});var e0=s(function(_Ze,Kj){"use strict";var mce=Tc(),hce=mce();Kj.exports=hce});var Tt=s(function(NZe,t0){"use strict";var pce=require("@stdlib/utils/define-nonenumerable-read-only-property"),r0=e0(),yce=Tc();pce(r0,"factory",yce);t0.exports=r0});var i0=s(function(LZe,qce){qce.exports={dtype:"float64"}});var s0=s(function(RZe,a0){"use strict";var bce=require("@stdlib/array/typed-real-float-dtypes"),wce=require("@stdlib/assert/is-plain-object"),Sce=require("@stdlib/assert/has-own-property"),n0=require("@stdlib/string/format"),jc=bce();jc.push("generic");function Oce(r,e){return wce(e)?Sce(e,"dtype")&&(r.dtype=e.dtype,jc.indexOf(r.dtype)<0)?new TypeError(n0('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",jc.join('", "'),r.dtype)):null:new TypeError(n0("invalid argument. Options argument must be an object. Value: `%s`.",e))}a0.exports=Oce});var Mc=s(function(PZe,v0){"use strict";var Ece=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,_ce=require("@stdlib/utils/define-nonenumerable-read-only-property"),Sv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Nce=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),u0=Tt(),Lce=require("@stdlib/array/typed-real-float-ctors"),Rce=require("@stdlib/array/base/filled-by"),Pce=require("@stdlib/strided/base/nullary"),Tce=require("@stdlib/string/format"),jce=i0(),o0=s0();function Mce(){var r,e,t,i,n,a;if(t={dtype:jce.dtype},e=arguments.length,i=u,e===0)n=u0;else if(e===1&&(r=arguments[0],n=u0.factory(r),a=o0(t,r),a))throw a;return Sv(i,"seed",o),Sv(i,"seedLength",v),Nce(i,"state",l,m),Sv(i,"stateLength",g),Sv(i,"byteLength",c),_ce(i,"PRNG",n.PRNG),i;function u(h,p){var d,f,y,q,b;if(!Ece(h))throw new TypeError(Tce("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",h));if(b={},arguments.length>1&&(y=o0(b,p),y))throw y;return q=b.dtype||t.dtype,q==="generic"?Rce(h,n):(d=Lce(q),f=new d(h),Pce([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}}v0.exports=Mce});var f0=s(function(TZe,g0){"use strict";var xce=Mc(),Ace=xce();g0.exports=Ace});var c0=s(function(jZe,l0){"use strict";var Gce=require("@stdlib/utils/define-nonenumerable-read-only-property"),d0=f0(),Vce=Mc();Gce(d0,"factory",Vce);l0.exports=d0});var h0=s(function(MZe,m0){"use strict";var Fce=require("@stdlib/math/base/special/sqrt"),Wce=require("@stdlib/math/base/special/ln");function Ice(r,e){return e*Fce(-2*Wce(r()))}m0.exports=Ice});var xc=s(function(xZe,O0){"use strict";var ut=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ov=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),p0=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),kce=require("@stdlib/assert/is-positive-number").isPrimitive,y0=require("@stdlib/assert/is-plain-object"),q0=require("@stdlib/assert/is-function"),b0=require("@stdlib/assert/has-own-property"),w0=require("@stdlib/utils/constant-function"),zce=require("@stdlib/utils/noop"),Ev=T().factory,Jce=require("@stdlib/math/base/assert/is-nan"),Uce=require("@stdlib/array/to-json"),_v=require("@stdlib/string/format"),S0=h0();function Cce(){var r,e,t,i;if(arguments.length===0)t=Ev();else if(arguments.length===1&&y0(arguments[0]))if(e=arguments[0],b0(e,"prng")){if(!q0(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],!kce(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],!y0(e))throw new TypeError(_v("invalid argument. Options argument must be an object. Value: `%s`.",e));if(b0(e,"prng")){if(!q0(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),p0(i,"state",w0(null),zce),ut(i,"stateLength",null),ut(i,"byteLength",null),ut(i,"toJSON",w0(null)),ut(i,"PRNG",t)):(Ov(i,"seed",n),Ov(i,"seedLength",a),p0(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=Uce(t.state),r===void 0?h.params=[]:h.params=[r],h}function l(){return S0(t,r)}function m(h){return Jce(h)||h<=0?NaN:S0(t,h)}}O0.exports=Cce});var _0=s(function(AZe,E0){"use strict";var Bce=xc(),Dce=Bce();E0.exports=Dce});var Ja=s(function(GZe,L0){"use strict";var Xce=require("@stdlib/utils/define-nonenumerable-read-only-property"),N0=_0(),Yce=xc();Xce(N0,"factory",Yce);L0.exports=N0});var Ac=s(function(VZe,R0){"use strict";var Hce=Vr(),Zce=require("@stdlib/array/dtypes"),Qce=require("@stdlib/array/defaults"),$ce=Ja(),Kce=Zce("real_floating_point_and_generic"),eme=Hce($ce,Kce,Qce.get("dtypes.real_floating_point"));R0.exports=eme});var T0=s(function(FZe,P0){"use strict";var rme=Ac(),tme=rme();P0.exports=tme});var x0=s(function(WZe,M0){"use strict";var ime=require("@stdlib/utils/define-nonenumerable-read-only-property"),j0=T0(),nme=Ac();ime(j0,"factory",nme);M0.exports=j0});var Wc=s(function(IZe,J0){"use strict";var jt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),A0=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ua=require("@stdlib/assert/has-own-property"),G0=require("@stdlib/assert/is-positive-number").isPrimitive,V0=require("@stdlib/assert/is-plain-object"),Gc=require("@stdlib/assert/is-uint32array"),F0=require("@stdlib/assert/is-boolean").isPrimitive,ame=require("@stdlib/math/base/assert/is-nan"),W0=require("@stdlib/assert/is-function"),I0=require("@stdlib/utils/constant-function"),sme=require("@stdlib/utils/noop"),Lv=Ur().factory,Ca=Q().factory,Vc=require("@stdlib/blas/base/gcopy"),Fc=require("@stdlib/array/uint32"),k0=require("@stdlib/object/assign"),ume=require("@stdlib/array/to-json"),Xe=require("@stdlib/string/format"),z0=require("@stdlib/math/base/special/sqrt");function ome(){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(V0(arguments[0])){if(n=arguments[0],Ua(n,"copy")&&!F0(n.copy))throw new TypeError(Xe("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(Ua(n,"prng")){if(!W0(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")&&!Gc(n.state))throw new TypeError(Xe("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=k0({},n),n.copy===!1?u=!1:n.state&&(n.state=Vc(n.state.length,n.state,1,new Fc(n.state.length),1)),n.copy=!1,t=Ca(n)}}else{if(o=arguments[0],!G0(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],!G0(o))throw new TypeError(Xe("invalid argument. First argument must be a positive number. Value: `%s`.",o));if(n=arguments[1],!V0(n))throw new TypeError(Xe("invalid argument. Options argument must be an object. Value: `%s`.",n));if(Ua(n,"copy")&&!F0(n.copy))throw new TypeError(Xe("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(Ua(n,"prng")){if(!W0(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")&&!Gc(n.state))throw new TypeError(Xe("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=k0({},n),n.copy===!1?u=!1:n.state&&(n.state=Vc(n.state.length,n.state,1,new Fc(n.state.length),1)),n.copy=!1,t=Ca(n)}}return n&&n.prng?o===void 0?r=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),A0(a,"state",I0(null),sme),jt(a,"stateLength",null),jt(a,"byteLength",null),jt(a,"toJSON",I0(null))):(Nv(a,"seed",v),Nv(a,"seedLength",g),A0(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(!Gc(y))throw new TypeError(Xe("invalid argument. Must provide a Uint32Array. Value: `%s`.",y));u&&(y=Vc(y.length,y,1,new Fc(y.length),1)),i.state=y}function p(){var y={};return y.type="PRNG",y.name=a.NAME,y.state=ume(i.state),o===void 0?y.params=[]:y.params=[o],y}function d(){return t()/z0(r()/o)}function f(y){return ame(y)||y<=0?NaN:t()/z0(r(y)/y)}}J0.exports=ome});var C0=s(function(kZe,U0){"use strict";var vme=Wc(),gme=vme();U0.exports=gme});var Ba=s(function(zZe,D0){"use strict";var fme=require("@stdlib/utils/define-nonenumerable-read-only-property"),B0=C0(),dme=Wc();fme(B0,"factory",dme);D0.exports=B0});var Ic=s(function(JZe,X0){"use strict";var lme=Vr(),cme=require("@stdlib/array/dtypes"),mme=require("@stdlib/array/defaults"),hme=Ba(),pme=cme("real_floating_point_and_generic"),yme=lme(hme,pme,mme.get("dtypes.real_floating_point"));X0.exports=yme});var H0=s(function(UZe,Y0){"use strict";var qme=Ic(),bme=qme();Y0.exports=bme});var $0=s(function(CZe,Q0){"use strict";var wme=require("@stdlib/utils/define-nonenumerable-read-only-property"),Z0=H0(),Sme=Ic();wme(Z0,"factory",Sme);Q0.exports=Z0});var eM=s(function(BZe,K0){"use strict";var kc=require("@stdlib/assert/is-number").isPrimitive,Rv=require("@stdlib/string/format"),zc=require("@stdlib/assert/is-nan");function Ome(r,e,t){return!kc(r)||zc(r)?new TypeError(Rv("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):!kc(e)||zc(e)?new TypeError(Rv("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):!kc(t)||zc(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))}K0.exports=Ome});var iM=s(function(DZe,tM){"use strict";var rM=require("@stdlib/math/base/special/sqrt");function Eme(r,e,t,i){var n,a,u;return n=(i-e)/(t-e),u=r(),u3){if(r=arguments[3],!aM(r))throw new TypeError(jv("invalid argument. Options argument must be an object. Value: `%s`.",r));if(uM(r,"prng")){if(!sM(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),nM(t,"state",oM(null),_me),ot(t,"stateLength",null),ot(t,"byteLength",null),ot(t,"toJSON",oM(null)),ot(t,"PRNG",e)):(Pv(t,"seed",o),Pv(t,"seedLength",v),nM(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=Nme(e.state),n===void 0?f.params=[]:f.params=[n,a,u],f}function p(){return vM(e,n,a,u)}function d(f,y,q){return Jc(f)||Jc(y)||Jc(q)||!(f<=q&&q<=y)?NaN:vM(e,f,y,q)}}gM.exports=Rme});var dM=s(function(YZe,fM){"use strict";var Pme=Uc(),Tme=Pme();fM.exports=Tme});var Da=s(function(HZe,cM){"use strict";var jme=require("@stdlib/utils/define-nonenumerable-read-only-property"),lM=dM(),Mme=Uc();jme(lM,"factory",Mme);cM.exports=lM});var Cc=s(function(ZZe,mM){"use strict";var xme=qo(),Ame=require("@stdlib/array/dtypes"),Gme=require("@stdlib/array/defaults"),Vme=Da(),Fme=Ame("real_floating_point_and_generic"),Wme=xme(Vme,Fme,Gme.get("dtypes.real_floating_point"));mM.exports=Wme});var pM=s(function(QZe,hM){"use strict";var Ime=Cc(),kme=Ime();hM.exports=kme});var bM=s(function($Ze,qM){"use strict";var zme=require("@stdlib/utils/define-nonenumerable-read-only-property"),yM=pM(),Jme=Cc();zme(yM,"factory",Jme);qM.exports=yM});var EM=s(function(KZe,OM){"use strict";var wM=require("@stdlib/assert/is-number").isPrimitive,Bc=require("@stdlib/string/format"),SM=require("@stdlib/assert/is-nan");function Ume(r,e){return!wM(r)||SM(r)?new TypeError(Bc("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):!wM(e)||SM(e)?new TypeError(Bc("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):r>=e?new RangeError(Bc("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e)):null}OM.exports=Ume});var NM=s(function(eQe,_M){"use strict";function Cme(r,e,t){var i=r();return t*i+(1-i)*e}_M.exports=Cme});var Dc=s(function(rQe,AM){"use strict";var vt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Mv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),LM=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),RM=require("@stdlib/assert/is-plain-object"),PM=require("@stdlib/assert/is-function"),TM=require("@stdlib/assert/has-own-property"),jM=require("@stdlib/utils/constant-function"),Bme=require("@stdlib/utils/noop"),xv=T().factory,MM=require("@stdlib/math/base/assert/is-nan"),Dme=require("@stdlib/array/to-json"),Av=require("@stdlib/string/format"),Xme=EM(),xM=NM();function Yme(){var r,e,t,i,n,a;if(arguments.length===0)e=xv();else if(arguments.length===1){if(r=arguments[0],!RM(r))throw new TypeError(Av("invalid argument. Options argument must be an object. Value: `%s`.",r));if(TM(r,"prng")){if(!PM(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],!RM(r))throw new TypeError(Av("invalid argument. Options argument must be an object. Value: `%s`.",r));if(TM(r,"prng")){if(!PM(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),LM(t,"state",jM(null),Bme),vt(t,"stateLength",null),vt(t,"byteLength",null),vt(t,"toJSON",jM(null)),vt(t,"PRNG",e)):(Mv(t,"seed",u),Mv(t,"seedLength",o),LM(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=Dme(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return xM(e,n,a)}function p(d,f){return MM(d)||MM(f)||d>=f?NaN:xM(e,d,f)}}AM.exports=Yme});var VM=s(function(tQe,GM){"use strict";var Hme=Dc(),Zme=Hme();GM.exports=Zme});var pn=s(function(iQe,WM){"use strict";var Qme=require("@stdlib/utils/define-nonenumerable-read-only-property"),FM=VM(),$me=Dc();Qme(FM,"factory",$me);WM.exports=FM});var Xc=s(function(nQe,IM){"use strict";var Kme=F(),ehe=require("@stdlib/array/dtypes"),rhe=require("@stdlib/array/defaults"),the=pn(),ihe=ehe("real_floating_point_and_generic"),nhe=Kme(the,ihe,rhe.get("dtypes.real_floating_point"));IM.exports=nhe});var zM=s(function(aQe,kM){"use strict";var ahe=Xc(),she=ahe();kM.exports=she});var CM=s(function(sQe,UM){"use strict";var uhe=require("@stdlib/utils/define-nonenumerable-read-only-property"),JM=zM(),ohe=Xc();uhe(JM,"factory",ohe);UM.exports=JM});var YM=s(function(uQe,XM){"use strict";var BM=require("@stdlib/assert/is-positive-number").isPrimitive,DM=require("@stdlib/string/format");function vhe(r,e){return BM(r)?BM(e)?null:new TypeError(DM("invalid argument. Shape parameter must be a positive number. Value: `%s`.",e)):new TypeError(DM("invalid argument. Scale parameter must be a positive number. Value: `%s`.",r))}XM.exports=vhe});var ZM=s(function(oQe,HM){"use strict";var ghe=require("@stdlib/math/base/special/pow"),fhe=require("@stdlib/math/base/special/ln");function dhe(r,e,t){return t*ghe(-fhe(1-r()),1/e)}HM.exports=dhe});var Yc=s(function(vQe,nx){"use strict";var gt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Gv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),QM=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),$M=require("@stdlib/assert/is-plain-object"),KM=require("@stdlib/assert/is-function"),ex=require("@stdlib/assert/has-own-property"),rx=require("@stdlib/utils/constant-function"),lhe=require("@stdlib/utils/noop"),Vv=T().factory,tx=require("@stdlib/math/base/assert/is-nan"),che=require("@stdlib/array/to-json"),Fv=require("@stdlib/string/format"),mhe=YM(),ix=ZM();function hhe(){var r,e,t,i,n,a;if(arguments.length===0)t=Vv();else if(arguments.length===1){if(e=arguments[0],!$M(e))throw new TypeError(Fv("invalid argument. Options argument must be an object. Value: `%s`.",e));if(ex(e,"prng")){if(!KM(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=mhe(r,a),n)throw n;if(arguments.length>2){if(e=arguments[2],!$M(e))throw new TypeError(Fv("invalid argument. Options argument must be an object. Value: `%s`.",e));if(ex(e,"prng")){if(!KM(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),QM(i,"state",rx(null),lhe),gt(i,"stateLength",null),gt(i,"byteLength",null),gt(i,"toJSON",rx(null)),gt(i,"PRNG",t)):(Gv(i,"seed",u),Gv(i,"seedLength",o),QM(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=che(t.state),a===void 0?d.params=[]:d.params=[a,r],d}function h(){return ix(t,a,r)}function p(d,f){return tx(d)||tx(f)||d<=0||f<=0?NaN:ix(t,d,f)}}nx.exports=hhe});var sx=s(function(gQe,ax){"use strict";var phe=Yc(),yhe=phe();ax.exports=yhe});var yn=s(function(fQe,ox){"use strict";var qhe=require("@stdlib/utils/define-nonenumerable-read-only-property"),ux=sx(),bhe=Yc();qhe(ux,"factory",bhe);ox.exports=ux});var Hc=s(function(dQe,vx){"use strict";var whe=F(),She=require("@stdlib/array/dtypes"),Ohe=require("@stdlib/array/defaults"),Ehe=yn(),_he=She("real_floating_point_and_generic"),Nhe=whe(Ehe,_he,Ohe.get("dtypes.real_floating_point"));vx.exports=Nhe});var fx=s(function(lQe,gx){"use strict";var Lhe=Hc(),Rhe=Lhe();gx.exports=Rhe});var cx=s(function(cQe,lx){"use strict";var Phe=require("@stdlib/utils/define-nonenumerable-read-only-property"),dx=fx(),The=Hc();Phe(dx,"factory",The);lx.exports=dx});var hx=s(function(mQe,mx){"use strict";var M=require("@stdlib/utils/define-read-only-property"),j={};M(j,"arcsine",ry());M(j,"bernoulli",jy());M(j,"beta",Fq());M(j,"betaprime",Lb());M(j,"binomial",iw());M(j,"cauchy",Nw());M(j,"chi",Kw());M(j,"chisquare",aS());M(j,"cosine",RS());M(j,"discreteUniform",KS());M(j,"erlang",SO());M(j,"exponential",zO());M(j,"f",fE());M(j,"frechet",XE());M(j,"gamma",KE());M(j,"geometric",q_());M(j,"gumbel",U_());M(j,"hypergeometric",lN());M(j,"invgamma",AN());M(j,"kumaraswamy",aL());M(j,"laplace",RL());M(j,"levy",QL());M(j,"logistic",bR());M(j,"lognormal",UR());M(j,"minstd",hP());M(j,"minstdShuffle",DP());M(j,"mt19937",vT());M(j,"negativeBinomial",YT());M(j,"normal",pj());M(j,"pareto1",zj());M(j,"poisson",Xj());M(j,"randu",c0());M(j,"rayleigh",x0());M(j,"t",$0());M(j,"triangular",bM());M(j,"uniform",CM());M(j,"weibull",cx());mx.exports=j});var yx=s(function(hQe,px){"use strict";var jhe=require("@stdlib/math/base/special/sqrt"),Mhe=require("@stdlib/math/base/special/ln"),xhe=require("@stdlib/math/base/special/sin"),Ahe=require("@stdlib/math/base/special/cos"),Ghe=require("@stdlib/constants/float64/two-pi");function Vhe(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=jhe(-2*Mhe(n)),o=Ghe*a,t=u*Ahe(o),e=!1,u*xhe(o)}return e=!0,t}}px.exports=Vhe});var bx=s(function(pQe,qx){"use strict";var Fhe=require("@stdlib/math/base/special/sqrt"),Whe=require("@stdlib/math/base/special/ln"),Ihe=require("@stdlib/math/base/special/cos"),khe=require("@stdlib/constants/float64/pi"),zhe=Ihe(khe);function Jhe(r){var e=Fhe(-2*Whe(r));return e*zhe}qx.exports=Jhe});var Sx=s(function(yQe,wx){"use strict";var Uhe=require("@stdlib/math/base/special/sqrt"),Che=require("@stdlib/math/base/special/ln"),Bhe=require("@stdlib/math/base/special/cos"),Dhe=require("@stdlib/constants/float64/two-pi");function Xhe(r){var e=Uhe(-2*Che(r)),t=Dhe*r;return e*Bhe(t)}wx.exports=Xhe});var Zc=s(function(qQe,Nx){"use strict";var re=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Ox=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Yhe=require("@stdlib/assert/is-plain-object"),Hhe=require("@stdlib/assert/is-function"),Zhe=require("@stdlib/assert/is-boolean").isPrimitive,du=require("@stdlib/assert/has-own-property"),Qhe=require("@stdlib/assert/is-uint32array"),Ex=T().factory,_x=require("@stdlib/utils/constant-function"),$he=require("@stdlib/utils/noop"),Khe=require("@stdlib/array/to-json"),lu=require("@stdlib/string/format"),epe=yx(),rpe=bx(),tpe=Sx();function ipe(r){var e,t,i,n;if(n={copy:!0},arguments.length){if(!Yhe(r))throw new TypeError(lu("invalid argument. Must provide an object. Value: `%s`.",r));if(du(r,"copy")&&(n.copy=r.copy,!Zhe(r.copy)))throw new TypeError(lu("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy));if(du(r,"prng")){if(!Hhe(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,!Qhe(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=Ex(n),e=i.normalized):n.seed=null:(i=Ex(n),e=i.normalized),t=epe(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?(Ox(t,"state",_x(null),$he),re(t,"stateLength",null),re(t,"byteLength",null),re(t,"toJSON",_x(null))):(Ox(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",rpe(e.MIN)),re(t,"MAX",tpe(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=Khe(i.state),m.params=[],m}}Nx.exports=ipe});var Rx=s(function(bQe,Lx){"use strict";var npe=Zc(),ape=npe();Lx.exports=ape});var Xa=s(function(wQe,Tx){"use strict";var spe=require("@stdlib/utils/define-nonenumerable-read-only-property"),Px=Rx(),upe=Zc();spe(Px,"factory",upe);Tx.exports=Px});var jx=s(function(SQe,ope){ope.exports={name:"mt19937",copy:!0}});var xx=s(function(OQe,Mx){"use strict";var vpe=$(),gpe=ee(),fpe=T(),Iv={};Iv.minstd=vpe;Iv["minstd-shuffle"]=gpe;Iv.mt19937=fpe;Mx.exports=Iv});var Qc=s(function(EQe,Gx){"use strict";var cu=require("@stdlib/utils/define-nonenumerable-read-only-property"),kv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),dpe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),lpe=require("@stdlib/assert/is-plain-object"),cpe=require("@stdlib/assert/is-boolean").isPrimitive,zv=require("@stdlib/assert/has-own-property"),mpe=require("@stdlib/array/to-json"),mu=require("@stdlib/string/format"),Ax=jx(),hpe=xx();function ppe(r){var e,t,i;if(e={name:Ax.name,copy:Ax.copy},arguments.length){if(!lpe(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,!cpe(e.copy)))throw new TypeError(mu("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",e.copy))}if(i=hpe[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),dpe(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=mpe(t.state),m.params=[],m}function l(){return t()}}Gx.exports=ppe});var Fx=s(function(_Qe,Vx){"use strict";var ype=Qc(),qpe=ype();Vx.exports=qpe});var hu=s(function(NQe,Ix){"use strict";var bpe=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wx=Fx(),wpe=Qc();bpe(Wx,"factory",wpe);Ix.exports=Wx});var kx=s(function(LQe,Spe){Spe.exports={name:"improved-ziggurat",copy:!0}});var Jx=s(function(RQe,zx){"use strict";var Ope=Xa(),Epe=Q(),$c={};$c["box-muller"]=Ope;$c["improved-ziggurat"]=Epe;zx.exports=$c});var Kc=s(function(PQe,Dx){"use strict";var Mt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Jv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Ux=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),_pe=require("@stdlib/assert/is-plain-object"),Npe=require("@stdlib/assert/is-boolean").isPrimitive,pu=require("@stdlib/assert/has-own-property"),Cx=require("@stdlib/utils/constant-function"),Ya=require("@stdlib/string/format"),Lpe=require("@stdlib/utils/noop"),Rpe=require("@stdlib/array/to-json"),Bx=kx(),Ppe=Jx();function Tpe(r){var e,t,i;if(e={name:Bx.name,copy:Bx.copy},arguments.length){if(!_pe(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,!Npe(e.copy)))throw new TypeError(Ya("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",e.copy))}if(i=Ppe[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),Ux(l,"state",Cx(null),Lpe),Mt(l,"stateLength",null),Mt(l,"byteLength",null),Mt(l,"toJSON",Cx(null))):(Jv(l,"seed",n),Jv(l,"seedLength",a),Ux(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=Rpe(t.state),m.params=[],m}function l(){return t()}}Dx.exports=Tpe});var Yx=s(function(TQe,Xx){"use strict";var jpe=Kc(),Mpe=jpe();Xx.exports=Mpe});var yu=s(function(jQe,Zx){"use strict";var xpe=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hx=Yx(),Ape=Kc();xpe(Hx,"factory",Ape);Zx.exports=Hx});var $x=s(function(MQe,Qx){"use strict";var Gpe=nn(),Vpe=an(),Fpe=un(),Wpe=on(),Ipe=la(),kpe=Xa(),zpe=ma(),Jpe=vn(),Upe=Ur(),Cpe=gn(),Bpe=fn(),Dpe=ba(),Xpe=dn(),Ype=Sa(),Hpe=Ea(),Zpe=Ce(),Qpe=_a(),$pe=Na(),Kpe=La(),eye=Q(),rye=ln(),tye=Pa(),iye=Ta(),nye=ja(),aye=Ma(),sye=cn(),uye=$(),oye=ee(),vye=T(),gye=Ia(),fye=hn(),dye=za(),lye=mn(),cye=hu(),mye=yu(),hye=Tt(),pye=Ja(),yye=Ba(),qye=Da(),bye=pn(),wye=yn(),E={};E.arcsine=Gpe.factory;E.bernoulli=Vpe.factory;E.beta=Fpe.factory;E.betaprime=Wpe.factory;E.binomial=Ipe.factory;E["box-muller"]=kpe.factory;E.cauchy=zpe.factory;E.chi=Jpe.factory;E.chisquare=Upe.factory;E.cosine=Cpe.factory;E["discrete-uniform"]=Bpe.factory;E.erlang=Dpe.factory;E.exponential=Xpe.factory;E.f=Ype.factory;E.frechet=Hpe.factory;E.gamma=Zpe.factory;E.geometric=Qpe.factory;E.gumbel=$pe.factory;E.hypergeometric=Kpe.factory;E["improved-ziggurat"]=eye.factory;E.invgamma=rye.factory;E.kumaraswamy=tye.factory;E.laplace=iye.factory;E.levy=nye.factory;E.logistic=aye.factory;E.lognormal=sye.factory;E.minstd=uye.factory;E["minstd-shuffle"]=oye.factory;E.mt19937=vye.factory;E["negative-binomial"]=gye.factory;E.normal=fye.factory;E["pareto-type1"]=dye.factory;E.poisson=lye.factory;E.randi=cye.factory;E.randn=mye.factory;E.randu=hye.factory;E.rayleigh=pye.factory;E.t=yye.factory;E.triangular=qye.factory;E.uniform=bye.factory;E.weibull=wye.factory;Qx.exports=E});var i1=s(function(xQe,t1){"use strict";var Kx=require("@stdlib/assert/is-string").isPrimitive,Sye=require("@stdlib/assert/is-plain-object"),e1=require("@stdlib/assert/is-array"),Oye=require("@stdlib/assert/contains"),Eye=require("@stdlib/array/int32"),_ye=require("@stdlib/array/uint32"),r1=$x(),Nye={Int32Array:Eye,Uint32Array:_ye},Lye=["randi","randn","randu"];function Rye(r,e){var t,i,n,a,u;if(e&&e.type==="PRNG"&&Kx(e.name)&&Sye(e.state)&&e1(e.params)&&Kx(e.state.type)&&e1(e.state.data)&&(i={},t=r1[e.name],t===void 0&&(u=e.name.split("-"),Oye(Lye,u[0])&&(t=r1[u[0]],i.name=u.slice(1).join("-"))),t&&(a=Nye[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}t1.exports=Rye});var a1=s(function(AQe,n1){"use strict";var Pye=i1();n1.exports=Pye});var u1=s(function(GQe,s1){"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",la());_(O,"boxMuller",Xa());_(O,"cauchy",ma());_(O,"chi",vn());_(O,"chisquare",Ur());_(O,"cosine",gn());_(O,"discreteUniform",fn());_(O,"erlang",ba());_(O,"exponential",dn());_(O,"f",Sa());_(O,"frechet",Ea());_(O,"gamma",Ce());_(O,"geometric",_a());_(O,"gumbel",Na());_(O,"hypergeometric",La());_(O,"improvedZiggurat",Q());_(O,"invgamma",ln());_(O,"kumaraswamy",Pa());_(O,"laplace",Ta());_(O,"levy",ja());_(O,"logistic",Ma());_(O,"lognormal",cn());_(O,"minstd",$());_(O,"minstdShuffle",ee());_(O,"mt19937",T());_(O,"negativeBinomial",Ia());_(O,"normal",hn());_(O,"pareto1",za());_(O,"poisson",mn());_(O,"randi",hu());_(O,"randn",yu());_(O,"randu",Tt());_(O,"rayleigh",Ja());_(O,"reviveBasePRNG",a1());_(O,"t",Ba());_(O,"triangular",Da());_(O,"uniform",pn());_(O,"weibull",yn());s1.exports=O});var h1=s(function(VQe,m1){"use strict";var xt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Uv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),o1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Tye=require("@stdlib/utils/constant-function"),jye=require("@stdlib/utils/noop"),Mye=require("@stdlib/object/assign"),v1=require("@stdlib/assert/is-number").isPrimitive,g1=require("@stdlib/math/base/assert/is-nan"),xye=require("@stdlib/assert/is-plain-object"),Aye=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Gye=require("@stdlib/assert/has-own-property"),f1=require("@stdlib/constants/float64/max"),d1=nn().factory,l1=require("@stdlib/symbol/iterator"),qu=require("@stdlib/string/format");function c1(r,e,t){var i,n,a,u,o;if(!v1(r)||g1(r))throw new TypeError(qu("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!v1(e)||g1(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(!xye(t))throw new TypeError(qu("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Mye({},t),Gye(i,"iter")){if(!Aye(i.iter))throw new TypeError(qu("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=f1;a=d1(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=d1(r,e),i={iter:f1,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),o1(n,"state",Tye(null),jye),xt(n,"stateLength",null),xt(n,"byteLength",null)):(Uv(n,"seed",l),Uv(n,"seedLength",m),o1(n,"state",d,f),Uv(n,"stateLength",h),Uv(n,"byteLength",p)),xt(n,"PRNG",a.PRNG),l1&&xt(n,l1,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 c1(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}}m1.exports=c1});var y1=s(function(FQe,p1){"use strict";var Vye=h1();p1.exports=Vye});var _1=s(function(WQe,E1){"use strict";var At=require("@stdlib/utils/define-nonenumerable-read-only-property"),Cv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),q1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Fye=require("@stdlib/utils/constant-function"),Wye=require("@stdlib/utils/noop"),Iye=require("@stdlib/object/assign"),kye=require("@stdlib/assert/is-probability").isPrimitive,zye=require("@stdlib/assert/is-plain-object"),Jye=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Uye=require("@stdlib/assert/has-own-property"),b1=require("@stdlib/constants/float64/max"),w1=an().factory,S1=require("@stdlib/symbol/iterator"),em=require("@stdlib/string/format");function O1(r,e){var t,i,n,a,u;if(!kye(r))throw new TypeError(em("invalid argument. First argument must be a probability. Value: `%s`.",r));if(arguments.length>1){if(!zye(e))throw new TypeError(em("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=Iye({},e),Uye(t,"iter")){if(!Jye(t.iter))throw new TypeError(em("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=b1;n=w1(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=w1(r),t={iter:b1,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),q1(i,"state",Fye(null),Wye),At(i,"stateLength",null),At(i,"byteLength",null)):(Cv(i,"seed",c),Cv(i,"seedLength",l),q1(i,"state",p,d),Cv(i,"stateLength",m),Cv(i,"byteLength",h)),At(i,"PRNG",n.PRNG),S1&&At(i,S1,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 O1(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}}E1.exports=O1});var L1=s(function(IQe,N1){"use strict";var Cye=_1();N1.exports=Cye});var G1=s(function(kQe,A1){"use strict";var Gt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),R1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Bye=require("@stdlib/utils/constant-function"),Dye=require("@stdlib/utils/noop"),Xye=require("@stdlib/object/assign"),P1=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"),T1=require("@stdlib/constants/float64/max"),j1=un().factory,M1=require("@stdlib/symbol/iterator"),Dv=require("@stdlib/string/format");function x1(r,e,t){var i,n,a,u,o;if(!P1(r))throw new TypeError(Dv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!P1(e))throw new TypeError(Dv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Yye(t))throw new TypeError(Dv("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(Dv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=T1;a=j1(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=j1(r,e),i={iter:T1,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),R1(n,"state",Bye(null),Dye),Gt(n,"stateLength",null),Gt(n,"byteLength",null)):(Bv(n,"seed",l),Bv(n,"seedLength",m),R1(n,"state",d,f),Bv(n,"stateLength",h),Bv(n,"byteLength",p)),Gt(n,"PRNG",a.PRNG),M1&&Gt(n,M1,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return x1(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}}A1.exports=x1});var F1=s(function(zQe,V1){"use strict";var Qye=G1();V1.exports=Qye});var B1=s(function(JQe,C1){"use strict";var Vt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),W1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),$ye=require("@stdlib/utils/constant-function"),Kye=require("@stdlib/utils/noop"),eqe=require("@stdlib/object/assign"),I1=require("@stdlib/assert/is-positive-number").isPrimitive,rqe=require("@stdlib/assert/is-plain-object"),tqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,iqe=require("@stdlib/assert/has-own-property"),k1=require("@stdlib/constants/float64/max"),z1=on().factory,J1=require("@stdlib/symbol/iterator"),Yv=require("@stdlib/string/format");function U1(r,e,t){var i,n,a,u,o;if(!I1(r))throw new TypeError(Yv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!I1(e))throw new TypeError(Yv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!rqe(t))throw new TypeError(Yv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=eqe({},t),iqe(i,"iter")){if(!tqe(i.iter))throw new TypeError(Yv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=k1;a=z1(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=z1(r,e),i={iter:k1,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),W1(n,"state",$ye(null),Kye),Vt(n,"stateLength",null),Vt(n,"byteLength",null)):(Xv(n,"seed",l),Xv(n,"seedLength",m),W1(n,"state",d,f),Xv(n,"stateLength",h),Xv(n,"byteLength",p)),Vt(n,"PRNG",a.PRNG),J1&&Vt(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 U1(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=U1});var X1=s(function(UQe,D1){"use strict";var nqe=B1();D1.exports=nqe});var eA=s(function(CQe,K1){"use strict";var Ft=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Y1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),aqe=require("@stdlib/utils/constant-function"),sqe=require("@stdlib/utils/noop"),uqe=require("@stdlib/object/assign"),oqe=require("@stdlib/assert/is-probability").isPrimitive,vqe=require("@stdlib/assert/is-plain-object"),gqe=require("@stdlib/assert/is-positive-integer").isPrimitive,fqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,dqe=require("@stdlib/assert/has-own-property"),H1=require("@stdlib/constants/float64/max"),Z1=la().factory,Q1=require("@stdlib/symbol/iterator"),Zv=require("@stdlib/string/format");function $1(r,e,t){var i,n,a,u,o;if(!gqe(r))throw new TypeError(Zv("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!oqe(e))throw new TypeError(Zv("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(arguments.length>2){if(!vqe(t))throw new TypeError(Zv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=uqe({},t),dqe(i,"iter")){if(!fqe(i.iter))throw new TypeError(Zv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=H1;a=Z1(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=Z1(r,e),i={iter:H1,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),Y1(n,"state",aqe(null),sqe),Ft(n,"stateLength",null),Ft(n,"byteLength",null)):(Hv(n,"seed",l),Hv(n,"seedLength",m),Y1(n,"state",d,f),Hv(n,"stateLength",h),Hv(n,"byteLength",p)),Ft(n,"PRNG",a.PRNG),Q1&&Ft(n,Q1,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 $1(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}}K1.exports=$1});var tA=s(function(BQe,rA){"use strict";var lqe=eA();rA.exports=lqe});var gA=s(function(DQe,vA){"use strict";var Wt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),iA=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-plain-object"),yqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,qqe=require("@stdlib/assert/has-own-property"),nA=require("@stdlib/constants/float64/max"),aA=Xa().factory,sA=require("@stdlib/symbol/iterator"),uA=require("@stdlib/string/format");function oA(r){var e,t,i,n,a;if(arguments.length>0){if(!pqe(r))throw new TypeError(uA("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=hqe({},r),qqe(e,"iter")){if(!yqe(e.iter))throw new TypeError(uA("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=nA;i=aA(e),e.prng===void 0&&e.copy!==!1&&(e.state=i.state)}else i=aA(),e={iter:nA,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),iA(t,"state",cqe(null),mqe),Wt(t,"stateLength",null),Wt(t,"byteLength",null)):(Qv(t,"seed",g),Qv(t,"seedLength",c),iA(t,"state",h,p),Qv(t,"stateLength",l),Qv(t,"byteLength",m)),Wt(t,"PRNG",i.PRNG),sA&&Wt(t,sA,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 oA(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}}vA.exports=oA});var dA=s(function(XQe,fA){"use strict";var bqe=gA();fA.exports=bqe});var qA=s(function(YQe,yA){"use strict";var It=require("@stdlib/utils/define-nonenumerable-read-only-property"),$v=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),lA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),wqe=require("@stdlib/utils/constant-function"),Sqe=require("@stdlib/utils/noop"),Oqe=require("@stdlib/object/assign"),Eqe=require("@stdlib/assert/is-number").isPrimitive,_qe=require("@stdlib/math/base/assert/is-nan"),Nqe=require("@stdlib/assert/is-plain-object"),Lqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Rqe=require("@stdlib/assert/is-positive-number").isPrimitive,Pqe=require("@stdlib/assert/has-own-property"),cA=require("@stdlib/constants/float64/max"),mA=ma().factory,hA=require("@stdlib/symbol/iterator"),Kv=require("@stdlib/string/format");function pA(r,e,t){var i,n,a,u,o;if(!Eqe(r)||_qe(r))throw new TypeError(Kv("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Rqe(e))throw new TypeError(Kv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Nqe(t))throw new TypeError(Kv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Oqe({},t),Pqe(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=cA;a=mA(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=mA(r,e),i={iter:cA,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),lA(n,"state",wqe(null),Sqe),It(n,"stateLength",null),It(n,"byteLength",null)):($v(n,"seed",l),$v(n,"seedLength",m),lA(n,"state",d,f),$v(n,"stateLength",h),$v(n,"byteLength",p)),It(n,"PRNG",a.PRNG),hA&&It(n,hA,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 pA(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}yA.exports=pA});var wA=s(function(HQe,bA){"use strict";var Tqe=qA();bA.exports=Tqe});var RA=s(function(ZQe,LA){"use strict";var kt=require("@stdlib/utils/define-nonenumerable-read-only-property"),eg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),SA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),jqe=require("@stdlib/utils/constant-function"),Mqe=require("@stdlib/utils/noop"),xqe=require("@stdlib/object/assign"),Aqe=require("@stdlib/assert/is-positive-number").isPrimitive,Gqe=require("@stdlib/assert/is-plain-object"),Vqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Fqe=require("@stdlib/assert/has-own-property"),OA=require("@stdlib/constants/float64/max"),EA=vn().factory,_A=require("@stdlib/symbol/iterator"),rm=require("@stdlib/string/format");function NA(r,e){var t,i,n,a,u;if(!Aqe(r))throw new TypeError(rm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!Gqe(e))throw new TypeError(rm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=xqe({},e),Fqe(t,"iter")){if(!Vqe(t.iter))throw new TypeError(rm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=OA;n=EA(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=EA(r),t={iter:OA,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),SA(i,"state",jqe(null),Mqe),kt(i,"stateLength",null),kt(i,"byteLength",null)):(eg(i,"seed",c),eg(i,"seedLength",l),SA(i,"state",p,d),eg(i,"stateLength",m),eg(i,"byteLength",h)),kt(i,"PRNG",n.PRNG),_A&&kt(i,_A,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 NA(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}}LA.exports=NA});var TA=s(function(QQe,PA){"use strict";var Wqe=RA();PA.exports=Wqe});var FA=s(function($Qe,VA){"use strict";var zt=require("@stdlib/utils/define-nonenumerable-read-only-property"),rg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),jA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Iqe=require("@stdlib/utils/constant-function"),kqe=require("@stdlib/utils/noop"),zqe=require("@stdlib/object/assign"),Jqe=require("@stdlib/assert/is-positive-number").isPrimitive,Uqe=require("@stdlib/assert/is-plain-object"),Cqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Bqe=require("@stdlib/assert/has-own-property"),MA=require("@stdlib/constants/float64/max"),xA=Ur().factory,AA=require("@stdlib/symbol/iterator"),tm=require("@stdlib/string/format");function GA(r,e){var t,i,n,a,u;if(!Jqe(r))throw new TypeError(tm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!Uqe(e))throw new TypeError(tm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=zqe({},e),Bqe(t,"iter")){if(!Cqe(t.iter))throw new TypeError(tm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=MA;n=xA(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=xA(r),t={iter:MA,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),jA(i,"state",Iqe(null),kqe),zt(i,"stateLength",null),zt(i,"byteLength",null)):(rg(i,"seed",c),rg(i,"seedLength",l),jA(i,"state",p,d),rg(i,"stateLength",m),rg(i,"byteLength",h)),zt(i,"PRNG",n.PRNG),AA&&zt(i,AA,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 GA(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}}VA.exports=GA});var IA=s(function(KQe,WA){"use strict";var Dqe=FA();WA.exports=Dqe});var DA=s(function(e$e,BA){"use strict";var Jt=require("@stdlib/utils/define-nonenumerable-read-only-property"),tg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),kA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Xqe=require("@stdlib/utils/constant-function"),Yqe=require("@stdlib/utils/noop"),Hqe=require("@stdlib/object/assign"),Zqe=require("@stdlib/assert/is-number").isPrimitive,Qqe=require("@stdlib/math/base/assert/is-nan"),$qe=require("@stdlib/assert/is-plain-object"),Kqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ebe=require("@stdlib/assert/is-positive-number").isPrimitive,rbe=require("@stdlib/assert/has-own-property"),zA=require("@stdlib/constants/float64/max"),JA=gn().factory,UA=require("@stdlib/symbol/iterator"),ig=require("@stdlib/string/format");function CA(r,e,t){var i,n,a,u,o;if(!Zqe(r)||Qqe(r))throw new TypeError(ig("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!ebe(e))throw new TypeError(ig("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!$qe(t))throw new TypeError(ig("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Hqe({},t),rbe(i,"iter")){if(!Kqe(i.iter))throw new TypeError(ig("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=zA;a=JA(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=JA(r,e),i={iter:zA,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),kA(n,"state",Xqe(null),Yqe),Jt(n,"stateLength",null),Jt(n,"byteLength",null)):(tg(n,"seed",l),tg(n,"seedLength",m),kA(n,"state",d,f),tg(n,"stateLength",h),tg(n,"byteLength",p)),Jt(n,"PRNG",a.PRNG),UA&&Jt(n,UA,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}}BA.exports=CA});var YA=s(function(r$e,XA){"use strict";var tbe=DA();XA.exports=tbe});var tG=s(function(t$e,rG){"use strict";var Ut=require("@stdlib/utils/define-nonenumerable-read-only-property"),ng=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),HA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ibe=require("@stdlib/utils/constant-function"),nbe=require("@stdlib/utils/noop"),abe=require("@stdlib/object/assign"),ZA=require("@stdlib/assert/is-number").isPrimitive,sbe=require("@stdlib/assert/is-plain-object"),ube=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,obe=require("@stdlib/assert/has-own-property"),QA=require("@stdlib/constants/float64/max"),$A=fn().factory,KA=require("@stdlib/symbol/iterator"),bu=require("@stdlib/string/format");function eG(r,e,t){var i,n,a,u,o;if(!ZA(r))throw new TypeError(bu("invalid argument. First argument must be an integer. Value: `%s`.",r));if(!ZA(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(!sbe(t))throw new TypeError(bu("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=abe({},t),obe(i,"iter")){if(!ube(i.iter))throw new TypeError(bu("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=QA;a=$A(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=$A(r,e),i={iter:QA,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),HA(n,"state",ibe(null),nbe),Ut(n,"stateLength",null),Ut(n,"byteLength",null)):(ng(n,"seed",l),ng(n,"seedLength",m),HA(n,"state",d,f),ng(n,"stateLength",h),ng(n,"byteLength",p)),Ut(n,"PRNG",a.PRNG),KA&&Ut(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 eG(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=eG});var nG=s(function(i$e,iG){"use strict";var vbe=tG();iG.exports=vbe});var fG=s(function(n$e,gG){"use strict";var Ct=require("@stdlib/utils/define-nonenumerable-read-only-property"),ag=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),aG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),gbe=require("@stdlib/utils/constant-function"),fbe=require("@stdlib/utils/noop"),dbe=require("@stdlib/object/assign"),lbe=require("@stdlib/assert/is-positive-number").isPrimitive,cbe=require("@stdlib/assert/is-plain-object"),mbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,hbe=require("@stdlib/assert/is-positive-integer").isPrimitive,pbe=require("@stdlib/assert/has-own-property"),sG=require("@stdlib/constants/float64/max"),uG=ba().factory,oG=require("@stdlib/symbol/iterator"),sg=require("@stdlib/string/format");function vG(r,e,t){var i,n,a,u,o;if(!hbe(r))throw new TypeError(sg("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!lbe(e))throw new TypeError(sg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!cbe(t))throw new TypeError(sg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=dbe({},t),pbe(i,"iter")){if(!mbe(i.iter))throw new TypeError(sg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=sG;a=uG(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=uG(r,e),i={iter:sG,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),aG(n,"state",gbe(null),fbe),Ct(n,"stateLength",null),Ct(n,"byteLength",null)):(ag(n,"seed",l),ag(n,"seedLength",m),aG(n,"state",d,f),ag(n,"stateLength",h),ag(n,"byteLength",p)),Ct(n,"PRNG",a.PRNG),oG&&Ct(n,oG,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 vG(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}}gG.exports=vG});var lG=s(function(a$e,dG){"use strict";var ybe=fG();dG.exports=ybe});var bG=s(function(s$e,qG){"use strict";var Bt=require("@stdlib/utils/define-nonenumerable-read-only-property"),ug=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),cG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),qbe=require("@stdlib/utils/constant-function"),bbe=require("@stdlib/utils/noop"),wbe=require("@stdlib/object/assign"),Sbe=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"),mG=require("@stdlib/constants/float64/max"),hG=dn().factory,pG=require("@stdlib/symbol/iterator"),im=require("@stdlib/string/format");function yG(r,e){var t,i,n,a,u;if(!Sbe(r))throw new TypeError(im("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!Obe(e))throw new TypeError(im("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=wbe({},e),_be(t,"iter")){if(!Ebe(t.iter))throw new TypeError(im("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=mG;n=hG(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=hG(r),t={iter:mG,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),cG(i,"state",qbe(null),bbe),Bt(i,"stateLength",null),Bt(i,"byteLength",null)):(ug(i,"seed",c),ug(i,"seedLength",l),cG(i,"state",p,d),ug(i,"stateLength",m),ug(i,"byteLength",h)),Bt(i,"PRNG",n.PRNG),pG&&Bt(i,pG,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 yG(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}}qG.exports=yG});var SG=s(function(u$e,wG){"use strict";var Nbe=bG();wG.exports=Nbe});var TG=s(function(o$e,PG){"use strict";var Dt=require("@stdlib/utils/define-nonenumerable-read-only-property"),og=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),OG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Lbe=require("@stdlib/utils/constant-function"),Rbe=require("@stdlib/utils/noop"),Pbe=require("@stdlib/object/assign"),EG=require("@stdlib/assert/is-positive-number").isPrimitive,Tbe=require("@stdlib/assert/is-plain-object"),jbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Mbe=require("@stdlib/assert/has-own-property"),_G=require("@stdlib/constants/float64/max"),NG=Sa().factory,LG=require("@stdlib/symbol/iterator"),vg=require("@stdlib/string/format");function RG(r,e,t){var i,n,a,u,o;if(!EG(r))throw new TypeError(vg("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!EG(e))throw new TypeError(vg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Tbe(t))throw new TypeError(vg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Pbe({},t),Mbe(i,"iter")){if(!jbe(i.iter))throw new TypeError(vg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=_G;a=NG(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=NG(r,e),i={iter:_G,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),OG(n,"state",Lbe(null),Rbe),Dt(n,"stateLength",null),Dt(n,"byteLength",null)):(og(n,"seed",l),og(n,"seedLength",m),OG(n,"state",d,f),og(n,"stateLength",h),og(n,"byteLength",p)),Dt(n,"PRNG",a.PRNG),LG&&Dt(n,LG,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 RG(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}}PG.exports=RG});var MG=s(function(v$e,jG){"use strict";var xbe=TG();jG.exports=xbe});var kG=s(function(g$e,IG){"use strict";var Xt=require("@stdlib/utils/define-nonenumerable-read-only-property"),gg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),xG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Abe=require("@stdlib/utils/constant-function"),Gbe=require("@stdlib/utils/noop"),Vbe=require("@stdlib/object/assign"),AG=require("@stdlib/assert/is-positive-number").isPrimitive,Fbe=require("@stdlib/assert/is-plain-object"),Wbe=require("@stdlib/assert/is-number").isPrimitive,Ibe=require("@stdlib/math/base/assert/is-nan"),kbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,zbe=require("@stdlib/assert/has-own-property"),GG=require("@stdlib/constants/float64/max"),VG=Ea().factory,FG=require("@stdlib/symbol/iterator"),wu=require("@stdlib/string/format");function WG(r,e,t,i){var n,a,u,o,v;if(!AG(r))throw new TypeError(wu("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!AG(e))throw new TypeError(wu("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(!Wbe(t)||Ibe(t))throw new TypeError(wu("invalid argument. Third argument must be a number. Value: `%s`.",t));if(arguments.length>3){if(!Fbe(i))throw new TypeError(wu("invalid argument. Options argument must be an object. Value: `%s`.",i));if(n=Vbe({},i),zbe(n,"iter")){if(!kbe(n.iter))throw new TypeError(wu("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",n.iter))}else n.iter=GG;u=VG(r,e,t,n),n.prng===void 0&&n.copy!==!1&&(n.state=u.state)}else u=VG(r,e,t),n={iter:GG,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),xG(a,"state",Abe(null),Gbe),Xt(a,"stateLength",null),Xt(a,"byteLength",null)):(gg(a,"seed",m),gg(a,"seedLength",h),xG(a,"state",f,y),gg(a,"stateLength",p),gg(a,"byteLength",d)),Xt(a,"PRNG",u.PRNG),FG&&Xt(a,FG,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 WG(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}}IG.exports=WG});var JG=s(function(f$e,zG){"use strict";var Jbe=kG();zG.exports=Jbe});var ZG=s(function(d$e,HG){"use strict";var Yt=require("@stdlib/utils/define-nonenumerable-read-only-property"),fg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),UG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ube=require("@stdlib/utils/constant-function"),Cbe=require("@stdlib/utils/noop"),Bbe=require("@stdlib/object/assign"),CG=require("@stdlib/assert/is-positive-number").isPrimitive,Dbe=require("@stdlib/assert/is-plain-object"),Xbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ybe=require("@stdlib/assert/has-own-property"),BG=require("@stdlib/constants/float64/max"),DG=Ce().factory,XG=require("@stdlib/symbol/iterator"),dg=require("@stdlib/string/format");function YG(r,e,t){var i,n,a,u,o;if(!CG(r))throw new TypeError(dg("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!CG(e))throw new TypeError(dg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Dbe(t))throw new TypeError(dg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Bbe({},t),Ybe(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=BG;a=DG(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=DG(r,e),i={iter:BG,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),UG(n,"state",Ube(null),Cbe),Yt(n,"stateLength",null),Yt(n,"byteLength",null)):(fg(n,"seed",l),fg(n,"seedLength",m),UG(n,"state",d,f),fg(n,"stateLength",h),fg(n,"byteLength",p)),Yt(n,"PRNG",a.PRNG),XG&&Yt(n,XG,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 YG(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}}HG.exports=YG});var $G=s(function(l$e,QG){"use strict";var Hbe=ZG();QG.exports=Hbe});var aV=s(function(c$e,nV){"use strict";var Ht=require("@stdlib/utils/define-nonenumerable-read-only-property"),lg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),KG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Zbe=require("@stdlib/utils/constant-function"),Qbe=require("@stdlib/utils/noop"),$be=require("@stdlib/object/assign"),Kbe=require("@stdlib/assert/is-probability").isPrimitive,ewe=require("@stdlib/assert/is-plain-object"),rwe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,twe=require("@stdlib/assert/has-own-property"),eV=require("@stdlib/constants/float64/max"),rV=_a().factory,tV=require("@stdlib/symbol/iterator"),nm=require("@stdlib/string/format");function iV(r,e){var t,i,n,a,u;if(!Kbe(r))throw new TypeError(nm("invalid argument. First argument must be a probability. Value: `%s`.",r));if(arguments.length>1){if(!ewe(e))throw new TypeError(nm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=$be({},e),twe(t,"iter")){if(!rwe(t.iter))throw new TypeError(nm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=eV;n=rV(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=rV(r),t={iter:eV,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),KG(i,"state",Zbe(null),Qbe),Ht(i,"stateLength",null),Ht(i,"byteLength",null)):(lg(i,"seed",c),lg(i,"seedLength",l),KG(i,"state",p,d),lg(i,"stateLength",m),lg(i,"byteLength",h)),Ht(i,"PRNG",n.PRNG),tV&&Ht(i,tV,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 iV(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}}nV.exports=iV});var uV=s(function(m$e,sV){"use strict";var iwe=aV();sV.exports=iwe});var cV=s(function(h$e,lV){"use strict";var Zt=require("@stdlib/utils/define-nonenumerable-read-only-property"),cg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),oV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),nwe=require("@stdlib/utils/constant-function"),awe=require("@stdlib/utils/noop"),swe=require("@stdlib/object/assign"),uwe=require("@stdlib/assert/is-number").isPrimitive,owe=require("@stdlib/math/base/assert/is-nan"),vwe=require("@stdlib/assert/is-plain-object"),gwe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,fwe=require("@stdlib/assert/is-positive-number").isPrimitive,dwe=require("@stdlib/assert/has-own-property"),vV=require("@stdlib/constants/float64/max"),gV=Na().factory,fV=require("@stdlib/symbol/iterator"),mg=require("@stdlib/string/format");function dV(r,e,t){var i,n,a,u,o;if(!uwe(r)||owe(r))throw new TypeError(mg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!fwe(e))throw new TypeError(mg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!vwe(t))throw new TypeError(mg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=swe({},t),dwe(i,"iter")){if(!gwe(i.iter))throw new TypeError(mg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=vV;a=gV(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=gV(r,e),i={iter:vV,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),oV(n,"state",nwe(null),awe),Zt(n,"stateLength",null),Zt(n,"byteLength",null)):(cg(n,"seed",l),cg(n,"seedLength",m),oV(n,"state",d,f),cg(n,"stateLength",h),cg(n,"byteLength",p)),Zt(n,"PRNG",a.PRNG),fV&&Zt(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 dV(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}}lV.exports=dV});var hV=s(function(p$e,mV){"use strict";var lwe=cV();mV.exports=lwe});var OV=s(function(y$e,SV){"use strict";var Qt=require("@stdlib/utils/define-nonenumerable-read-only-property"),hg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),pV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),cwe=require("@stdlib/utils/constant-function"),mwe=require("@stdlib/utils/noop"),hwe=require("@stdlib/object/assign"),pwe=require("@stdlib/assert/is-plain-object"),pg=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ywe=require("@stdlib/assert/has-own-property"),yV=require("@stdlib/constants/float64/max"),qV=La().factory,bV=require("@stdlib/symbol/iterator"),qn=require("@stdlib/string/format");function wV(r,e,t,i){var n,a,u,o,v;if(!pg(r))throw new TypeError(qn("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r));if(!pg(e))throw new TypeError(qn("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",e));if(!pg(t))throw new TypeError(qn("invalid argument. Third argument must be a nonnegative integer. Value: `%s`.",t));if(t>r)throw new RangeError(qn("invalid argument. Number of draws must be less than or equal to the population size. Value: `%u`.",t));if(e>r)throw new RangeError(qn("invalid argument. Subpopulation size must be less than or equal to the population size. Value: `%u`.",e));if(arguments.length>3){if(!pwe(i))throw new TypeError(qn("invalid argument. Options argument must be an object. Value: `%s`.",i));if(n=hwe({},i),ywe(n,"iter")){if(!pg(n.iter))throw new TypeError(qn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",n.iter))}else n.iter=yV;u=qV(r,e,t,n),n.prng===void 0&&n.copy!==!1&&(n.state=u.state)}else u=qV(r,e,t),n={iter:yV,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),pV(a,"state",cwe(null),mwe),Qt(a,"stateLength",null),Qt(a,"byteLength",null)):(hg(a,"seed",m),hg(a,"seedLength",h),pV(a,"state",f,y),hg(a,"stateLength",p),hg(a,"byteLength",d)),Qt(a,"PRNG",u.PRNG),bV&&Qt(a,bV,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 wV(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}}SV.exports=wV});var _V=s(function(q$e,EV){"use strict";var qwe=OV();EV.exports=qwe});var xV=s(function(b$e,MV){"use strict";var $t=require("@stdlib/utils/define-nonenumerable-read-only-property"),yg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),NV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),bwe=require("@stdlib/utils/constant-function"),wwe=require("@stdlib/utils/noop"),Swe=require("@stdlib/object/assign"),Owe=require("@stdlib/assert/is-plain-object"),Ewe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,_we=require("@stdlib/assert/has-own-property"),LV=require("@stdlib/constants/float64/max"),RV=Q().factory,PV=require("@stdlib/symbol/iterator"),TV=require("@stdlib/string/format");function jV(r){var e,t,i,n,a;if(arguments.length>0){if(!Owe(r))throw new TypeError(TV("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=Swe({},r),_we(e,"iter")){if(!Ewe(e.iter))throw new TypeError(TV("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=LV;i=RV(e),e.prng===void 0&&e.copy!==!1&&(e.state=i.state)}else i=RV(),e={iter:LV,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),NV(t,"state",bwe(null),wwe),$t(t,"stateLength",null),$t(t,"byteLength",null)):(yg(t,"seed",g),yg(t,"seedLength",c),NV(t,"state",h,p),yg(t,"stateLength",l),yg(t,"byteLength",m)),$t(t,"PRNG",i.PRNG),PV&&$t(t,PV,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 jV(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}}MV.exports=jV});var GV=s(function(w$e,AV){"use strict";var Nwe=xV();AV.exports=Nwe});var UV=s(function(S$e,JV){"use strict";var Kt=require("@stdlib/utils/define-nonenumerable-read-only-property"),qg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),VV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Lwe=require("@stdlib/utils/constant-function"),Rwe=require("@stdlib/utils/noop"),Pwe=require("@stdlib/object/assign"),FV=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"),WV=require("@stdlib/constants/float64/max"),IV=ln().factory,kV=require("@stdlib/symbol/iterator"),bg=require("@stdlib/string/format");function zV(r,e,t){var i,n,a,u,o;if(!FV(r))throw new TypeError(bg("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!FV(e))throw new TypeError(bg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Twe(t))throw new TypeError(bg("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(bg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=WV;a=IV(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=IV(r,e),i={iter:WV,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),VV(n,"state",Lwe(null),Rwe),Kt(n,"stateLength",null),Kt(n,"byteLength",null)):(qg(n,"seed",l),qg(n,"seedLength",m),VV(n,"state",d,f),qg(n,"stateLength",h),qg(n,"byteLength",p)),Kt(n,"PRNG",a.PRNG),kV&&Kt(n,kV,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return 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}}JV.exports=zV});var BV=s(function(O$e,CV){"use strict";var xwe=UV();CV.exports=xwe});var KV=s(function(E$e,$V){"use strict";var ei=require("@stdlib/utils/define-nonenumerable-read-only-property"),wg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),DV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Awe=require("@stdlib/utils/constant-function"),Gwe=require("@stdlib/utils/noop"),Vwe=require("@stdlib/object/assign"),XV=require("@stdlib/assert/is-positive-number").isPrimitive,Fwe=require("@stdlib/assert/is-plain-object"),Wwe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Iwe=require("@stdlib/assert/has-own-property"),YV=require("@stdlib/constants/float64/max"),HV=Pa().factory,ZV=require("@stdlib/symbol/iterator"),Sg=require("@stdlib/string/format");function QV(r,e,t){var i,n,a,u,o;if(!XV(r))throw new TypeError(Sg("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!XV(e))throw new TypeError(Sg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Fwe(t))throw new TypeError(Sg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Vwe({},t),Iwe(i,"iter")){if(!Wwe(i.iter))throw new TypeError(Sg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=YV;a=HV(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=HV(r,e),i={iter:YV,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),DV(n,"state",Awe(null),Gwe),ei(n,"stateLength",null),ei(n,"byteLength",null)):(wg(n,"seed",l),wg(n,"seedLength",m),DV(n,"state",d,f),wg(n,"stateLength",h),wg(n,"byteLength",p)),ei(n,"PRNG",a.PRNG),ZV&&ei(n,ZV,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 QV(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}}$V.exports=QV});var r2=s(function(_$e,e2){"use strict";var kwe=KV();e2.exports=kwe});var o2=s(function(N$e,u2){"use strict";var ri=require("@stdlib/utils/define-nonenumerable-read-only-property"),Og=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),t2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),zwe=require("@stdlib/utils/constant-function"),Jwe=require("@stdlib/utils/noop"),Uwe=require("@stdlib/object/assign"),Cwe=require("@stdlib/assert/is-number").isPrimitive,Bwe=require("@stdlib/math/base/assert/is-nan"),Dwe=require("@stdlib/assert/is-plain-object"),Xwe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ywe=require("@stdlib/assert/is-positive-number").isPrimitive,Hwe=require("@stdlib/assert/has-own-property"),i2=require("@stdlib/constants/float64/max"),n2=Ta().factory,a2=require("@stdlib/symbol/iterator"),Eg=require("@stdlib/string/format");function s2(r,e,t){var i,n,a,u,o;if(!Cwe(r)||Bwe(r))throw new TypeError(Eg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Ywe(e))throw new TypeError(Eg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Dwe(t))throw new TypeError(Eg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Uwe({},t),Hwe(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=i2;a=n2(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=n2(r,e),i={iter:i2,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),t2(n,"state",zwe(null),Jwe),ri(n,"stateLength",null),ri(n,"byteLength",null)):(Og(n,"seed",l),Og(n,"seedLength",m),t2(n,"state",d,f),Og(n,"stateLength",h),Og(n,"byteLength",p)),ri(n,"PRNG",a.PRNG),a2&&ri(n,a2,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return s2(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}}u2.exports=s2});var g2=s(function(L$e,v2){"use strict";var Zwe=o2();v2.exports=Zwe});var p2=s(function(R$e,h2){"use strict";var ti=require("@stdlib/utils/define-nonenumerable-read-only-property"),_g=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),f2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Qwe=require("@stdlib/utils/constant-function"),$we=require("@stdlib/utils/noop"),Kwe=require("@stdlib/object/assign"),eSe=require("@stdlib/assert/is-number").isPrimitive,rSe=require("@stdlib/math/base/assert/is-nan"),tSe=require("@stdlib/assert/is-plain-object"),iSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,nSe=require("@stdlib/assert/is-positive-number").isPrimitive,aSe=require("@stdlib/assert/has-own-property"),d2=require("@stdlib/constants/float64/max"),l2=ja().factory,c2=require("@stdlib/symbol/iterator"),Ng=require("@stdlib/string/format");function m2(r,e,t){var i,n,a,u,o;if(!eSe(r)||rSe(r))throw new TypeError(Ng("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!nSe(e))throw new TypeError(Ng("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!tSe(t))throw new TypeError(Ng("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Kwe({},t),aSe(i,"iter")){if(!iSe(i.iter))throw new TypeError(Ng("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=d2;a=l2(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=l2(r,e),i={iter:d2,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),f2(n,"state",Qwe(null),$we),ti(n,"stateLength",null),ti(n,"byteLength",null)):(_g(n,"seed",l),_g(n,"seedLength",m),f2(n,"state",d,f),_g(n,"stateLength",h),_g(n,"byteLength",p)),ti(n,"PRNG",a.PRNG),c2&&ti(n,c2,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}}h2.exports=m2});var q2=s(function(P$e,y2){"use strict";var sSe=p2();y2.exports=sSe});var N2=s(function(T$e,_2){"use strict";var ii=require("@stdlib/utils/define-nonenumerable-read-only-property"),Lg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),b2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),uSe=require("@stdlib/utils/constant-function"),oSe=require("@stdlib/utils/noop"),vSe=require("@stdlib/object/assign"),gSe=require("@stdlib/assert/is-number").isPrimitive,fSe=require("@stdlib/math/base/assert/is-nan"),dSe=require("@stdlib/assert/is-plain-object"),lSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,cSe=require("@stdlib/assert/is-positive-number").isPrimitive,mSe=require("@stdlib/assert/has-own-property"),w2=require("@stdlib/constants/float64/max"),S2=Ma().factory,O2=require("@stdlib/symbol/iterator"),Rg=require("@stdlib/string/format");function E2(r,e,t){var i,n,a,u,o;if(!gSe(r)||fSe(r))throw new TypeError(Rg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!cSe(e))throw new TypeError(Rg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!dSe(t))throw new TypeError(Rg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=vSe({},t),mSe(i,"iter")){if(!lSe(i.iter))throw new TypeError(Rg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=w2;a=S2(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=S2(r,e),i={iter:w2,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),b2(n,"state",uSe(null),oSe),ii(n,"stateLength",null),ii(n,"byteLength",null)):(Lg(n,"seed",l),Lg(n,"seedLength",m),b2(n,"state",d,f),Lg(n,"stateLength",h),Lg(n,"byteLength",p)),ii(n,"PRNG",a.PRNG),O2&&ii(n,O2,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return E2(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}_2.exports=E2});var R2=s(function(j$e,L2){"use strict";var hSe=N2();L2.exports=hSe});var G2=s(function(M$e,A2){"use strict";var ni=require("@stdlib/utils/define-nonenumerable-read-only-property"),Pg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),P2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),pSe=require("@stdlib/utils/constant-function"),ySe=require("@stdlib/utils/noop"),qSe=require("@stdlib/object/assign"),bSe=require("@stdlib/assert/is-number").isPrimitive,wSe=require("@stdlib/math/base/assert/is-nan"),SSe=require("@stdlib/assert/is-plain-object"),OSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ESe=require("@stdlib/assert/is-positive-number").isPrimitive,_Se=require("@stdlib/assert/has-own-property"),T2=require("@stdlib/constants/float64/max"),j2=cn().factory,M2=require("@stdlib/symbol/iterator"),Tg=require("@stdlib/string/format");function x2(r,e,t){var i,n,a,u,o;if(!bSe(r)||wSe(r))throw new TypeError(Tg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!ESe(e))throw new TypeError(Tg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!SSe(t))throw new TypeError(Tg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=qSe({},t),_Se(i,"iter")){if(!OSe(i.iter))throw new TypeError(Tg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=T2;a=j2(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=j2(r,e),i={iter:T2,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),P2(n,"state",pSe(null),ySe),ni(n,"stateLength",null),ni(n,"byteLength",null)):(Pg(n,"seed",l),Pg(n,"seedLength",m),P2(n,"state",d,f),Pg(n,"stateLength",h),Pg(n,"byteLength",p)),ni(n,"PRNG",a.PRNG),M2&&ni(n,M2,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 x2(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}}A2.exports=x2});var F2=s(function(x$e,V2){"use strict";var NSe=G2();V2.exports=NSe});var C2=s(function(A$e,U2){"use strict";var am=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"),RSe=require("@stdlib/object/assign"),PSe=require("@stdlib/assert/is-plain-object"),TSe=require("@stdlib/assert/is-boolean").isPrimitive,jSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,W2=require("@stdlib/assert/has-own-property"),I2=require("@stdlib/constants/float64/max"),k2=$().factory,z2=require("@stdlib/symbol/iterator"),sm=require("@stdlib/string/format");function J2(r){var e,t,i,n,a;if(arguments.length>0){if(!PSe(r))throw new TypeError(sm("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=RSe({},r),W2(e,"normalized")&&!TSe(e.normalized))throw new TypeError(sm("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",e.normalized));if(W2(e,"iter")){if(!jSe(e.iter))throw new TypeError(sm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=I2;i=k2(e),e.copy!==!1&&(e.state=i.state)}else i=k2(),e={iter:I2,state:i.state};return e.normalized&&(i=i.normalized),a=0,t={},am(t,"next",u),am(t,"return",o),jg(t,"seed",g),jg(t,"seedLength",c),LSe(t,"state",h,p),jg(t,"stateLength",l),jg(t,"byteLength",m),z2&&am(t,z2,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 J2(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}}U2.exports=J2});var D2=s(function(G$e,B2){"use strict";var MSe=C2();B2.exports=MSe});var K2=s(function(V$e,$2){"use strict";var um=require("@stdlib/utils/define-nonenumerable-read-only-property"),Mg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),xSe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ASe=require("@stdlib/object/assign"),GSe=require("@stdlib/assert/is-plain-object"),VSe=require("@stdlib/assert/is-boolean").isPrimitive,FSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,X2=require("@stdlib/assert/has-own-property"),Y2=require("@stdlib/constants/float64/max"),H2=ee().factory,Z2=require("@stdlib/symbol/iterator"),om=require("@stdlib/string/format");function Q2(r){var e,t,i,n,a;if(arguments.length>0){if(!GSe(r))throw new TypeError(om("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=ASe({},r),X2(e,"normalized")&&!VSe(e.normalized))throw new TypeError(om("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",e.normalized));if(X2(e,"iter")){if(!FSe(e.iter))throw new TypeError(om("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=Y2;i=H2(e),e.copy!==!1&&(e.state=i.state)}else i=H2(),e={iter:Y2,state:i.state};return e.normalized&&(i=i.normalized),a=0,t={},um(t,"next",u),um(t,"return",o),Mg(t,"seed",g),Mg(t,"seedLength",c),xSe(t,"state",h,p),Mg(t,"stateLength",l),Mg(t,"byteLength",m),Z2&&um(t,Z2,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 Q2(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}}$2.exports=Q2});var rF=s(function(F$e,eF){"use strict";var WSe=K2();eF.exports=WSe});var oF=s(function(W$e,uF){"use strict";var vm=require("@stdlib/utils/define-nonenumerable-read-only-property"),xg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),ISe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),kSe=require("@stdlib/object/assign"),zSe=require("@stdlib/assert/is-plain-object"),JSe=require("@stdlib/assert/is-boolean").isPrimitive,USe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,tF=require("@stdlib/assert/has-own-property"),iF=require("@stdlib/constants/float64/max"),nF=T().factory,aF=require("@stdlib/symbol/iterator"),gm=require("@stdlib/string/format");function sF(r){var e,t,i,n,a;if(arguments.length>0){if(!zSe(r))throw new TypeError(gm("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=kSe({},r),tF(e,"normalized")&&!JSe(e.normalized))throw new TypeError(gm("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",e.normalized));if(tF(e,"iter")){if(!USe(e.iter))throw new TypeError(gm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=iF;i=nF(e),e.copy!==!1&&(e.state=i.state)}else i=nF(),e={iter:iF,state:i.state};return e.normalized&&(i=i.normalized),a=0,t={},vm(t,"next",u),vm(t,"return",o),xg(t,"seed",g),xg(t,"seedLength",c),ISe(t,"state",h,p),xg(t,"stateLength",l),xg(t,"byteLength",m),aF&&vm(t,aF,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 sF(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}}uF.exports=sF});var gF=s(function(I$e,vF){"use strict";var CSe=oF();vF.exports=CSe});var pF=s(function(k$e,hF){"use strict";var ai=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ag=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),fF=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),BSe=require("@stdlib/utils/constant-function"),DSe=require("@stdlib/utils/noop"),XSe=require("@stdlib/object/assign"),YSe=require("@stdlib/assert/is-probability").isPrimitive,HSe=require("@stdlib/assert/is-plain-object"),ZSe=require("@stdlib/assert/is-positive-number").isPrimitive,QSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,$Se=require("@stdlib/assert/has-own-property"),dF=require("@stdlib/constants/float64/max"),lF=Ia().factory,cF=require("@stdlib/symbol/iterator"),Gg=require("@stdlib/string/format");function mF(r,e,t){var i,n,a,u,o;if(!ZSe(r))throw new TypeError(Gg("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!YSe(e))throw new TypeError(Gg("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(arguments.length>2){if(!HSe(t))throw new TypeError(Gg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=XSe({},t),$Se(i,"iter")){if(!QSe(i.iter))throw new TypeError(Gg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=dF;a=lF(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=lF(r,e),i={iter:dF,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),fF(n,"state",BSe(null),DSe),ai(n,"stateLength",null),ai(n,"byteLength",null)):(Ag(n,"seed",l),Ag(n,"seedLength",m),fF(n,"state",d,f),Ag(n,"stateLength",h),Ag(n,"byteLength",p)),ai(n,"PRNG",a.PRNG),cF&&ai(n,cF,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 mF(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}}hF.exports=mF});var qF=s(function(z$e,yF){"use strict";var KSe=pF();yF.exports=KSe});var NF=s(function(J$e,_F){"use strict";var si=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),bF=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),eOe=require("@stdlib/utils/constant-function"),rOe=require("@stdlib/utils/noop"),tOe=require("@stdlib/object/assign"),iOe=require("@stdlib/assert/is-number").isPrimitive,nOe=require("@stdlib/math/base/assert/is-nan"),aOe=require("@stdlib/assert/is-plain-object"),sOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,uOe=require("@stdlib/assert/is-positive-number").isPrimitive,oOe=require("@stdlib/assert/has-own-property"),wF=require("@stdlib/constants/float64/max"),SF=hn().factory,OF=require("@stdlib/symbol/iterator"),Fg=require("@stdlib/string/format");function EF(r,e,t){var i,n,a,u,o;if(!iOe(r)||nOe(r))throw new TypeError(Fg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!uOe(e))throw new TypeError(Fg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!aOe(t))throw new TypeError(Fg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=tOe({},t),oOe(i,"iter")){if(!sOe(i.iter))throw new TypeError(Fg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=wF;a=SF(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=SF(r,e),i={iter:wF,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),bF(n,"state",eOe(null),rOe),si(n,"stateLength",null),si(n,"byteLength",null)):(Vg(n,"seed",l),Vg(n,"seedLength",m),bF(n,"state",d,f),Vg(n,"stateLength",h),Vg(n,"byteLength",p)),si(n,"PRNG",a.PRNG),OF&&si(n,OF,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 EF(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}}_F.exports=EF});var RF=s(function(U$e,LF){"use strict";var vOe=NF();LF.exports=vOe});var VF=s(function(C$e,GF){"use strict";var ui=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),PF=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),gOe=require("@stdlib/utils/constant-function"),fOe=require("@stdlib/utils/noop"),dOe=require("@stdlib/object/assign"),TF=require("@stdlib/assert/is-positive-number").isPrimitive,lOe=require("@stdlib/assert/is-plain-object"),cOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,mOe=require("@stdlib/assert/has-own-property"),jF=require("@stdlib/constants/float64/max"),MF=za().factory,xF=require("@stdlib/symbol/iterator"),Ig=require("@stdlib/string/format");function AF(r,e,t){var i,n,a,u,o;if(!TF(r))throw new TypeError(Ig("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!TF(e))throw new TypeError(Ig("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!lOe(t))throw new TypeError(Ig("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=dOe({},t),mOe(i,"iter")){if(!cOe(i.iter))throw new TypeError(Ig("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=jF;a=MF(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=MF(r,e),i={iter:jF,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),PF(n,"state",gOe(null),fOe),ui(n,"stateLength",null),ui(n,"byteLength",null)):(Wg(n,"seed",l),Wg(n,"seedLength",m),PF(n,"state",d,f),Wg(n,"stateLength",h),Wg(n,"byteLength",p)),ui(n,"PRNG",a.PRNG),xF&&ui(n,xF,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 AF(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}}GF.exports=AF});var WF=s(function(B$e,FF){"use strict";var hOe=VF();FF.exports=hOe});var BF=s(function(D$e,CF){"use strict";var oi=require("@stdlib/utils/define-nonenumerable-read-only-property"),kg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),IF=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-positive-number").isPrimitive,wOe=require("@stdlib/assert/is-plain-object"),SOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,OOe=require("@stdlib/assert/has-own-property"),kF=require("@stdlib/constants/float64/max"),zF=mn().factory,JF=require("@stdlib/symbol/iterator"),fm=require("@stdlib/string/format");function UF(r,e){var t,i,n,a,u;if(!bOe(r))throw new TypeError(fm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!wOe(e))throw new TypeError(fm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=qOe({},e),OOe(t,"iter")){if(!SOe(t.iter))throw new TypeError(fm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=kF;n=zF(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=zF(r),t={iter:kF,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),IF(i,"state",pOe(null),yOe),oi(i,"stateLength",null),oi(i,"byteLength",null)):(kg(i,"seed",c),kg(i,"seedLength",l),IF(i,"state",p,d),kg(i,"stateLength",m),kg(i,"byteLength",h)),oi(i,"PRNG",n.PRNG),JF&&oi(i,JF,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 UF(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}}CF.exports=UF});var XF=s(function(X$e,DF){"use strict";var EOe=BF();DF.exports=EOe});var eW=s(function(Y$e,KF){"use strict";var zg=require("@stdlib/utils/define-nonenumerable-read-only-property"),Jg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),_Oe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),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"),YF=require("@stdlib/constants/float64/max"),HF=hu().factory,ZF=require("@stdlib/symbol/iterator"),QF=require("@stdlib/string/format");function $F(r){var e,t,i,n,a;if(arguments.length>0){if(!LOe(r))throw new TypeError(QF("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(QF("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=YF;i=HF(e),e.copy!==!1&&(e.state=i.state)}else i=HF(),e={iter:YF,state:i.state};return a=0,t={},zg(t,"next",u),zg(t,"return",o),Jg(t,"seed",g),Jg(t,"seedLength",c),_Oe(t,"state",h,p),Jg(t,"stateLength",l),Jg(t,"byteLength",m),zg(t,"PRNG",i.PRNG),ZF&&zg(t,ZF,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 $F(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}}KF.exports=$F});var tW=s(function(H$e,rW){"use strict";var TOe=eW();rW.exports=TOe});var gW=s(function(Z$e,vW){"use strict";var vi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ug=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),iW=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),jOe=require("@stdlib/utils/constant-function"),MOe=require("@stdlib/utils/noop"),xOe=require("@stdlib/object/assign"),AOe=require("@stdlib/assert/is-plain-object"),GOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,VOe=require("@stdlib/assert/has-own-property"),nW=require("@stdlib/constants/float64/max"),aW=yu().factory,sW=require("@stdlib/symbol/iterator"),uW=require("@stdlib/string/format");function oW(r){var e,t,i,n,a;if(arguments.length>0){if(!AOe(r))throw new TypeError(uW("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=xOe({},r),VOe(e,"iter")){if(!GOe(e.iter))throw new TypeError(uW("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=nW;i=aW(e),e.prng===void 0&&e.copy!==!1&&(e.state=i.state)}else i=aW(),e={iter:nW,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),iW(t,"state",jOe(null),MOe),vi(t,"stateLength",null),vi(t,"byteLength",null)):(Ug(t,"seed",g),Ug(t,"seedLength",c),iW(t,"state",h,p),Ug(t,"stateLength",l),Ug(t,"byteLength",m)),vi(t,"PRNG",i.PRNG),sW&&vi(t,sW,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 oW(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}}vW.exports=oW});var dW=s(function(Q$e,fW){"use strict";var FOe=gW();fW.exports=FOe});var qW=s(function($$e,yW){"use strict";var Cg=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),WOe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),IOe=require("@stdlib/object/assign"),kOe=require("@stdlib/assert/is-plain-object"),zOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,JOe=require("@stdlib/assert/has-own-property"),lW=require("@stdlib/constants/float64/max"),cW=Tt().factory,mW=require("@stdlib/symbol/iterator"),hW=require("@stdlib/string/format");function pW(r){var e,t,i,n,a;if(arguments.length>0){if(!kOe(r))throw new TypeError(hW("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=IOe({},r),JOe(e,"iter")){if(!zOe(e.iter))throw new TypeError(hW("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=lW;i=cW(e),e.copy!==!1&&(e.state=i.state)}else i=cW(),e={iter:lW,state:i.state};return a=0,t={},Cg(t,"next",u),Cg(t,"return",o),Bg(t,"seed",g),Bg(t,"seedLength",c),WOe(t,"state",h,p),Bg(t,"stateLength",l),Bg(t,"byteLength",m),Cg(t,"PRNG",i.PRNG),mW&&Cg(t,mW,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 pW(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}}yW.exports=pW});var wW=s(function(K$e,bW){"use strict";var UOe=qW();bW.exports=UOe});var RW=s(function(eKe,LW){"use strict";var gi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Dg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),SW=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),COe=require("@stdlib/utils/constant-function"),BOe=require("@stdlib/utils/noop"),DOe=require("@stdlib/object/assign"),XOe=require("@stdlib/assert/is-positive-number").isPrimitive,YOe=require("@stdlib/assert/is-plain-object"),HOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ZOe=require("@stdlib/assert/has-own-property"),OW=require("@stdlib/constants/float64/max"),EW=Ja().factory,_W=require("@stdlib/symbol/iterator"),dm=require("@stdlib/string/format");function NW(r,e){var t,i,n,a,u;if(!XOe(r))throw new TypeError(dm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!YOe(e))throw new TypeError(dm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=DOe({},e),ZOe(t,"iter")){if(!HOe(t.iter))throw new TypeError(dm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=OW;n=EW(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=EW(r),t={iter:OW,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),SW(i,"state",COe(null),BOe),gi(i,"stateLength",null),gi(i,"byteLength",null)):(Dg(i,"seed",c),Dg(i,"seedLength",l),SW(i,"state",p,d),Dg(i,"stateLength",m),Dg(i,"byteLength",h)),gi(i,"PRNG",n.PRNG),_W&&gi(i,_W,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 NW(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}}LW.exports=NW});var TW=s(function(rKe,PW){"use strict";var QOe=RW();PW.exports=QOe});var FW=s(function(tKe,VW){"use strict";var fi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),jW=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),$Oe=require("@stdlib/utils/constant-function"),KOe=require("@stdlib/utils/noop"),eEe=require("@stdlib/object/assign"),rEe=require("@stdlib/assert/is-positive-number").isPrimitive,tEe=require("@stdlib/assert/is-plain-object"),iEe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,nEe=require("@stdlib/assert/has-own-property"),MW=require("@stdlib/constants/float64/max"),xW=Ba().factory,AW=require("@stdlib/symbol/iterator"),lm=require("@stdlib/string/format");function GW(r,e){var t,i,n,a,u;if(!rEe(r))throw new TypeError(lm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!tEe(e))throw new TypeError(lm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=eEe({},e),nEe(t,"iter")){if(!iEe(t.iter))throw new TypeError(lm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=MW;n=xW(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=xW(r),t={iter:MW,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),jW(i,"state",$Oe(null),KOe),fi(i,"stateLength",null),fi(i,"byteLength",null)):(Xg(i,"seed",c),Xg(i,"seedLength",l),jW(i,"state",p,d),Xg(i,"stateLength",m),Xg(i,"byteLength",h)),fi(i,"PRNG",n.PRNG),AW&&fi(i,AW,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 GW(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}}VW.exports=GW});var IW=s(function(iKe,WW){"use strict";var aEe=FW();WW.exports=aEe});var DW=s(function(nKe,BW){"use strict";var di=require("@stdlib/utils/define-nonenumerable-read-only-property"),Yg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),kW=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),sEe=require("@stdlib/utils/constant-function"),uEe=require("@stdlib/utils/noop"),oEe=require("@stdlib/object/assign"),cm=require("@stdlib/assert/is-number").isPrimitive,mm=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"),zW=require("@stdlib/constants/float64/max"),JW=Da().factory,UW=require("@stdlib/symbol/iterator"),Ha=require("@stdlib/string/format");function CW(r,e,t,i){var n,a,u,o,v;if(!cm(r)||mm(r))throw new TypeError(Ha("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!cm(e)||mm(e))throw new TypeError(Ha("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(!cm(t)||mm(t))throw new TypeError(Ha("invalid argument. Third argument must be a number and not NaN. Value: `%s`.",t));if(!(r<=t&&t<=e))throw new RangeError(Ha("invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.","a <= c <= b",r,e,t));if(arguments.length>3){if(!vEe(i))throw new TypeError(Ha("invalid argument. Options argument must be an object. Value: `%s`.",i));if(n=oEe({},i),fEe(n,"iter")){if(!gEe(n.iter))throw new TypeError(Ha("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",n.iter))}else n.iter=zW;u=JW(r,e,t,n),n.prng===void 0&&n.copy!==!1&&(n.state=u.state)}else u=JW(r,e,t),n={iter:zW,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),kW(a,"state",sEe(null),uEe),di(a,"stateLength",null),di(a,"byteLength",null)):(Yg(a,"seed",m),Yg(a,"seedLength",h),kW(a,"state",f,y),Yg(a,"stateLength",p),Yg(a,"byteLength",d)),di(a,"PRNG",u.PRNG),UW&&di(a,UW,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 CW(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}}BW.exports=CW});var YW=s(function(aKe,XW){"use strict";var dEe=DW();XW.exports=dEe});var iI=s(function(sKe,tI){"use strict";var li=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),HW=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),lEe=require("@stdlib/utils/constant-function"),cEe=require("@stdlib/utils/noop"),mEe=require("@stdlib/object/assign"),ZW=require("@stdlib/assert/is-number").isPrimitive,QW=require("@stdlib/math/base/assert/is-nan"),hEe=require("@stdlib/assert/is-plain-object"),pEe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,yEe=require("@stdlib/assert/has-own-property"),$W=require("@stdlib/constants/float64/max"),KW=pn().factory,eI=require("@stdlib/symbol/iterator"),Su=require("@stdlib/string/format");function rI(r,e,t){var i,n,a,u,o;if(!ZW(r)||QW(r))throw new TypeError(Su("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!ZW(e)||QW(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(!hEe(t))throw new TypeError(Su("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(Su("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=$W;a=KW(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=KW(r,e),i={iter:$W,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),HW(n,"state",lEe(null),cEe),li(n,"stateLength",null),li(n,"byteLength",null)):(Hg(n,"seed",l),Hg(n,"seedLength",m),HW(n,"state",d,f),Hg(n,"stateLength",h),Hg(n,"byteLength",p)),li(n,"PRNG",a.PRNG),eI&&li(n,eI,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 rI(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}}tI.exports=rI});var aI=s(function(uKe,nI){"use strict";var qEe=iI();nI.exports=qEe});var lI=s(function(oKe,dI){"use strict";var ci=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),sI=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),bEe=require("@stdlib/utils/constant-function"),wEe=require("@stdlib/utils/noop"),SEe=require("@stdlib/object/assign"),uI=require("@stdlib/assert/is-positive-number").isPrimitive,OEe=require("@stdlib/assert/is-plain-object"),EEe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,_Ee=require("@stdlib/assert/has-own-property"),oI=require("@stdlib/constants/float64/max"),vI=yn().factory,gI=require("@stdlib/symbol/iterator"),Qg=require("@stdlib/string/format");function fI(r,e,t){var i,n,a,u,o;if(!uI(r))throw new TypeError(Qg("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!uI(e))throw new TypeError(Qg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!OEe(t))throw new TypeError(Qg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=SEe({},t),_Ee(i,"iter")){if(!EEe(i.iter))throw new TypeError(Qg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=oI;a=vI(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=vI(r,e),i={iter:oI,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),sI(n,"state",bEe(null),wEe),ci(n,"stateLength",null),ci(n,"byteLength",null)):(Zg(n,"seed",l),Zg(n,"seedLength",m),sI(n,"state",d,f),Zg(n,"stateLength",h),Zg(n,"byteLength",p)),ci(n,"PRNG",a.PRNG),gI&&ci(n,gI,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 fI(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}}dI.exports=fI});var mI=s(function(vKe,cI){"use strict";var NEe=lI();cI.exports=NEe});var pI=s(function(gKe,hI){"use strict";var R=require("@stdlib/utils/define-read-only-property"),N={};R(N,"arcsine",y1());R(N,"bernoulli",L1());R(N,"beta",F1());R(N,"betaprime",X1());R(N,"binomial",tA());R(N,"boxMuller",dA());R(N,"cauchy",wA());R(N,"chi",TA());R(N,"chisquare",IA());R(N,"cosine",YA());R(N,"discreteUniform",nG());R(N,"erlang",lG());R(N,"exponential",SG());R(N,"f",MG());R(N,"frechet",JG());R(N,"gamma",$G());R(N,"geometric",uV());R(N,"gumbel",hV());R(N,"hypergeometric",_V());R(N,"improvedZiggurat",GV());R(N,"invgamma",BV());R(N,"kumaraswamy",r2());R(N,"laplace",g2());R(N,"levy",q2());R(N,"logistic",R2());R(N,"lognormal",F2());R(N,"minstd",D2());R(N,"minstdShuffle",rF());R(N,"mt19937",gF());R(N,"negativeBinomial",qF());R(N,"normal",RF());R(N,"pareto1",WF());R(N,"poisson",XF());R(N,"randi",tW());R(N,"randn",dW());R(N,"randu",wW());R(N,"rayleigh",TW());R(N,"t",IW());R(N,"triangular",YW());R(N,"uniform",aI());R(N,"weibull",mI());hI.exports=N});var qI=s(function(fKe,yI){"use strict";var LEe=require("@stdlib/math/base/special/floor");function REe(r,e,t){var i,n,a,u;for(a=r.length,n=new Array(e),u=0;u0;a--)u=TEe(t()*(a+1)),i=r[a],r[a]=r[u],r[u]=i;return jEe.call(r,0,e)}SI.exports=MEe});var _I=s(function(cKe,EI){"use strict";var xEe=require("@stdlib/math/base/special/floor");function AEe(r,e,t,i){var n,a,u,o,v,g,c,l,m,h;for(u=i.slice(),g=r.length,n=[],a=[],m=0;m1){if(e=arguments[0],r=arguments[1],!(hm(e)||pm(e)))throw new TypeError(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=MI({seed:r.seed}):i=MI(),e===void 0?a=u:(jI(e)?e=e.split(""):e=xI(e),a=o),TI(a,"seed",i.seed),TI(a,"PRNG",i),i=i.normalized,a;function u(v,g){var c,l,m,h,p,d;if(!(hm(v)||pm(v)))throw new TypeError(Kg("invalid argument. First argument must be array-like. Value: `%s`.",v));if(jI(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?zEe(v,p,i,m):kEe(v,p,i,m):c?AI(v,p,i):(l=UEe.call(v),GI(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?AI(e,m,i):(p=GI(e,m,i),c&&(e=e.slice(m,e.length)),p)}}VI.exports=CEe});var WI=s(function(yKe,FI){"use strict";var BEe=ym(),DEe=BEe();FI.exports=DEe});var zI=s(function(qKe,kI){"use strict";var XEe=require("@stdlib/utils/define-nonenumerable-read-only-property"),II=WI(),YEe=ym();XEe(II,"factory",YEe);kI.exports=II});var JI=s(function(bKe,HEe){HEe.exports={copy:"shallow"}});var BI=s(function(wKe,CI){"use strict";var ZEe=require("@stdlib/assert/has-own-property"),QEe=require("@stdlib/assert/is-string").isPrimitive,$Ee=require("@stdlib/assert/is-plain-object"),KEe=require("@stdlib/utils/index-of"),qm=require("@stdlib/string/format"),UI=["deep","shallow","none"];function e_e(r,e){if(!$Ee(e))return new TypeError(qm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(ZEe(e,"copy")){if(r.copy=e.copy,!QEe(r.copy))return new TypeError(qm("invalid option. `%s` option must be a string. Option: `%s`.","copy",r.copy));if(KEe(UI,r.copy)===-1)return new TypeError(qm('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"copy",UI.join('", "'),r.copy))}return null}CI.exports=e_e});var bm=s(function(SKe,ZI){"use strict";var DI=require("@stdlib/utils/define-nonenumerable-read-only-property"),r_e=require("@stdlib/assert/is-array-like"),t_e=require("@stdlib/assert/is-typed-array-like"),i_e=require("@stdlib/assert/is-string").isPrimitive,XI=require("@stdlib/utils/copy"),n_e=require("@stdlib/math/base/special/floor"),YI=T().factory,a_e=require("@stdlib/string/format"),s_e=JI(),HI=BI();function u_e(r){var e,t,i;if(e=XI(s_e),arguments.length&&(i=HI(e,r),i))throw i;return r&&r.seed?t=YI({seed:r.seed}):t=YI(),DI(n,"seed",t.seed),DI(n,"PRNG",t),t=t.normalized,n;function n(a,u){var o,v,g,c,l,m,h,p,d,f;if(!(r_e(a)||t_e(a)))throw new TypeError(a_e("invalid argument. First argument must be array-like. Value: `%s`.",a));if(arguments.length>1&&(c={},l=HI(c,u),l))throw l;for(g=c&&c.copy?c.copy:e.copy,o=i_e(a),o&&(a=a.split(""),g="none"),v=0,g==="shallow"?v+=1:g==="deep"&&(v+=2),p=a.length,m=XI(a,v),d=p-1;d>0;d--)f=n_e(t()*(d+1)),h=m[d],m[d]=m[f],m[f]=h;return o&&(m=a.join("")),m}}ZI.exports=u_e});var $I=s(function(OKe,QI){"use strict";var o_e=bm(),v_e=o_e();QI.exports=v_e});var rk=s(function(EKe,ek){"use strict";var g_e=require("@stdlib/utils/define-nonenumerable-read-only-property"),KI=$I(),f_e=bm();g_e(KI,"factory",f_e);ek.exports=KI});var tk=s(function(_Ke,d_e){d_e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var ak=s(function(NKe,nk){"use strict";var l_e=require("@stdlib/assert/is-plain-object"),Ye=require("@stdlib/assert/has-own-property"),c_e=require("@stdlib/assert/is-boolean").isPrimitive,m_e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,ik=require("@stdlib/assert/is-string").isPrimitive,h_e=require("@stdlib/assert/is-positive-integer").isPrimitive,p_e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,bn=require("@stdlib/string/format");function y_e(r,e){return l_e(e)?Ye(e,"sep")&&(r.sep=e.sep,!ik(r.sep))?new TypeError(bn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Ye(e,"objectMode")&&(r.objectMode=e.objectMode,!c_e(r.objectMode))?new TypeError(bn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Ye(e,"encoding")&&(r.encoding=e.encoding,!ik(r.encoding)&&r.encoding!==null)?new TypeError(bn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Ye(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!m_e(r.highWaterMark))?new TypeError(bn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Ye(e,"iter")&&(r.iter=e.iter,!p_e(r.iter))?new TypeError(bn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Ye(e,"siter")&&(r.siter=e.siter,!h_e(r.siter))?new TypeError(bn("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(bn("invalid argument. Options argument must be an object. Value: `%s`.",e))}nk.exports=y_e});var uk=s(function(LKe,sk){"use strict";var q_e=require("debug"),b_e=q_e("random:streams:arcsine");sk.exports=b_e});var tf=s(function(RKe,lk){"use strict";var dk=require("readable-stream").Readable,ok=require("@stdlib/assert/is-number").isPrimitive,vk=require("@stdlib/math/base/assert/is-nan"),w_e=require("@stdlib/assert/is-error"),S_e=require("@stdlib/object/assign"),O_e=require("@stdlib/utils/inherit"),gk=require("@stdlib/utils/define-nonenumerable-property"),mi=require("@stdlib/utils/define-nonenumerable-read-only-property"),rf=require("@stdlib/utils/define-read-only-accessor"),E_e=require("@stdlib/utils/define-read-write-accessor"),__e=nn().factory,fk=require("@stdlib/buffer/from-string"),N_e=require("@stdlib/utils/next-tick"),wm=require("@stdlib/string/format"),L_e=tk(),R_e=ak(),Za=uk();function P_e(){return this._prng.seed}function T_e(){return this._prng.seedLength}function j_e(){return this._prng.stateLength}function M_e(){return this._prng.byteLength}function x_e(){return this._prng.state}function A_e(r){this._prng.state=r}function G_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=fk(e):e=fk(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function V_e(r){var e;if(this._destroyed)return Za("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,N_e(t),this;function t(){r&&(Za("Stream was destroyed due to an error. Error: %s.",w_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(!ok(r)||vk(r))throw new TypeError(wm("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!ok(e)||vk(e))throw new TypeError(wm("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(r>=e)throw new RangeError(wm("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e));if(i=S_e({},L_e),arguments.length>2&&(n=R_e(i,t),n))throw n;return Za("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),dk.call(this,i),gk(this,"_destroyed",!1),mi(this,"_objectMode",i.objectMode),mi(this,"_sep",i.sep),mi(this,"_iter",i.iter),mi(this,"_siter",i.siter),gk(this,"_i",0),mi(this,"_prng",__e(r,e,i)),mi(this,"PRNG",this._prng.PRNG),this}O_e(te,dk);rf(te.prototype,"seed",P_e);rf(te.prototype,"seedLength",T_e);E_e(te.prototype,"state",x_e,A_e);rf(te.prototype,"stateLength",j_e);rf(te.prototype,"byteLength",M_e);mi(te.prototype,"_read",G_e);mi(te.prototype,"destroy",V_e);lk.exports=te});var mk=s(function(PKe,ck){"use strict";var F_e=require("@stdlib/assert/is-plain-object"),W_e=require("@stdlib/string/format"),I_e=require("@stdlib/object/assign"),k_e=tf();function z_e(r,e,t){var i;if(arguments.length>2){if(i=t,!F_e(i))throw new TypeError(W_e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=I_e({},t)}else i={};return i.objectMode=!0,new k_e(r,e,i)}ck.exports=z_e});var wk=s(function(TKe,bk){"use strict";var hk=require("@stdlib/assert/is-plain-object"),pk=require("@stdlib/object/assign"),yk=require("@stdlib/string/format"),qk=tf();function J_e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!hk(r))throw new TypeError(yk("invalid argument. Options argument must be an object. Value: `%s`.",r));n=pk({},r)}else if(i>2){if(!hk(t))throw new TypeError(yk("invalid argument. Options argument must be an object. Value: `%s`.",t));n=pk({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new qk(v,g,n)}function o(){return new qk(r,e,n)}}bk.exports=J_e});var Ek=s(function(jKe,Ok){"use strict";var Sk=require("@stdlib/utils/define-nonenumerable-read-only-property"),Sm=tf(),U_e=mk(),C_e=wk();Sk(Sm,"objectMode",U_e);Sk(Sm,"factory",C_e);Ok.exports=Sm});var _k=s(function(MKe,B_e){B_e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var Rk=s(function(xKe,Lk){"use strict";var D_e=require("@stdlib/assert/is-plain-object"),He=require("@stdlib/assert/has-own-property"),X_e=require("@stdlib/assert/is-boolean").isPrimitive,Y_e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,Nk=require("@stdlib/assert/is-string").isPrimitive,H_e=require("@stdlib/assert/is-positive-integer").isPrimitive,Z_e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,wn=require("@stdlib/string/format");function Q_e(r,e){return D_e(e)?He(e,"sep")&&(r.sep=e.sep,!Nk(r.sep))?new TypeError(wn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):He(e,"objectMode")&&(r.objectMode=e.objectMode,!X_e(r.objectMode))?new TypeError(wn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):He(e,"encoding")&&(r.encoding=e.encoding,!Nk(r.encoding)&&r.encoding!==null)?new TypeError(wn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):He(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!Y_e(r.highWaterMark))?new TypeError(wn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):He(e,"iter")&&(r.iter=e.iter,!Z_e(r.iter))?new TypeError(wn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):He(e,"siter")&&(r.siter=e.siter,!H_e(r.siter))?new TypeError(wn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(He(e,"prng")&&(r.prng=e.prng),He(e,"seed")&&(r.seed=e.seed),He(e,"state")&&(r.state=e.state),He(e,"copy")&&(r.copy=e.copy),null):new TypeError(wn("invalid argument. Options argument must be an object. Value: `%s`.",e))}Lk.exports=Q_e});var Tk=s(function(AKe,Pk){"use strict";var $_e=require("debug"),K_e=$_e("random:streams:bernoulli");Pk.exports=K_e});var af=s(function(GKe,Ak){"use strict";var xk=require("readable-stream").Readable,eNe=require("@stdlib/assert/is-probability").isPrimitive,rNe=require("@stdlib/assert/is-error"),tNe=require("@stdlib/object/assign"),iNe=require("@stdlib/utils/inherit"),jk=require("@stdlib/utils/define-nonenumerable-property"),hi=require("@stdlib/utils/define-nonenumerable-read-only-property"),nf=require("@stdlib/utils/define-read-only-accessor"),nNe=require("@stdlib/utils/define-read-write-accessor"),aNe=an().factory,Mk=require("@stdlib/buffer/from-string"),sNe=require("@stdlib/utils/next-tick"),uNe=require("@stdlib/string/format"),oNe=_k(),vNe=Rk(),Qa=Tk();function gNe(){return this._prng.seed}function fNe(){return this._prng.seedLength}function dNe(){return this._prng.stateLength}function lNe(){return this._prng.byteLength}function cNe(){return this._prng.state}function mNe(r){this._prng.state=r}function hNe(){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=Mk(e):e=Mk(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function pNe(r){var e;if(this._destroyed)return Qa("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,sNe(t),this;function t(){r&&(Qa("Stream was destroyed due to an error. Error: %s.",rNe(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(!eNe(r))throw new TypeError(uNe("invalid argument. First argument must be a probability. Value: `%s`.",r));if(t=tNe({},oNe),arguments.length>1&&(i=vNe(t,e),i))throw i;return Qa("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),xk.call(this,t),jk(this,"_destroyed",!1),hi(this,"_objectMode",t.objectMode),hi(this,"_sep",t.sep),hi(this,"_iter",t.iter),hi(this,"_siter",t.siter),jk(this,"_i",0),hi(this,"_prng",aNe(r,t)),hi(this,"PRNG",this._prng.PRNG),this}iNe(ie,xk);nf(ie.prototype,"seed",gNe);nf(ie.prototype,"seedLength",fNe);nNe(ie.prototype,"state",cNe,mNe);nf(ie.prototype,"stateLength",dNe);nf(ie.prototype,"byteLength",lNe);hi(ie.prototype,"_read",hNe);hi(ie.prototype,"destroy",pNe);Ak.exports=ie});var Vk=s(function(VKe,Gk){"use strict";var yNe=require("@stdlib/assert/is-plain-object"),qNe=require("@stdlib/string/format"),bNe=require("@stdlib/object/assign"),wNe=af();function SNe(r,e){var t;if(arguments.length>1){if(t=e,!yNe(t))throw new TypeError(qNe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=bNe({},e)}else t={};return t.objectMode=!0,new wNe(r,t)}Gk.exports=SNe});var Jk=s(function(FKe,zk){"use strict";var Fk=require("@stdlib/assert/is-plain-object"),ONe=require("@stdlib/assert/is-probability").isPrimitive,Wk=require("@stdlib/string/format"),Ik=require("@stdlib/object/assign"),kk=af();function ENe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!Fk(e))throw new TypeError(Wk("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=Ik({},e)}else if(t===1)if(ONe(r))n=u,i={};else{if(!Fk(r))throw new TypeError(Wk("invalid argument. Options argument must be an object. Value: `%s`.",r));i=Ik({},r),n=a}else i={},n=a;return n;function a(o){return new kk(o,i)}function u(){return new kk(r,i)}}zk.exports=ENe});var Bk=s(function(WKe,Ck){"use strict";var Uk=require("@stdlib/utils/define-nonenumerable-read-only-property"),Om=af(),_Ne=Vk(),NNe=Jk();Uk(Om,"objectMode",_Ne);Uk(Om,"factory",NNe);Ck.exports=Om});var Dk=s(function(IKe,LNe){LNe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var Hk=s(function(kKe,Yk){"use strict";var RNe=require("@stdlib/assert/is-plain-object"),Ze=require("@stdlib/assert/has-own-property"),PNe=require("@stdlib/assert/is-boolean").isPrimitive,TNe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,Xk=require("@stdlib/assert/is-string").isPrimitive,jNe=require("@stdlib/assert/is-positive-integer").isPrimitive,MNe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Sn=require("@stdlib/string/format");function xNe(r,e){return RNe(e)?Ze(e,"sep")&&(r.sep=e.sep,!Xk(r.sep))?new TypeError(Sn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Ze(e,"objectMode")&&(r.objectMode=e.objectMode,!PNe(r.objectMode))?new TypeError(Sn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Ze(e,"encoding")&&(r.encoding=e.encoding,!Xk(r.encoding)&&r.encoding!==null)?new TypeError(Sn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Ze(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!TNe(r.highWaterMark))?new TypeError(Sn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Ze(e,"iter")&&(r.iter=e.iter,!MNe(r.iter))?new TypeError(Sn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Ze(e,"siter")&&(r.siter=e.siter,!jNe(r.siter))?new TypeError(Sn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Ze(e,"prng")&&(r.prng=e.prng),Ze(e,"seed")&&(r.seed=e.seed),Ze(e,"state")&&(r.state=e.state),Ze(e,"copy")&&(r.copy=e.copy),null):new TypeError(Sn("invalid argument. Options argument must be an object. Value: `%s`.",e))}Yk.exports=xNe});var Qk=s(function(zKe,Zk){"use strict";var ANe=require("debug"),GNe=ANe("random:streams:beta");Zk.exports=GNe});var uf=s(function(JKe,iz){"use strict";var tz=require("readable-stream").Readable,$k=require("@stdlib/assert/is-positive-number").isPrimitive,VNe=require("@stdlib/assert/is-error"),FNe=require("@stdlib/object/assign"),WNe=require("@stdlib/utils/inherit"),Kk=require("@stdlib/utils/define-nonenumerable-property"),pi=require("@stdlib/utils/define-nonenumerable-read-only-property"),sf=require("@stdlib/utils/define-read-only-accessor"),INe=require("@stdlib/utils/define-read-write-accessor"),kNe=un().factory,ez=require("@stdlib/buffer/from-string"),zNe=require("@stdlib/utils/next-tick"),rz=require("@stdlib/string/format"),JNe=Dk(),UNe=Hk(),$a=Qk();function CNe(){return this._prng.seed}function BNe(){return this._prng.seedLength}function DNe(){return this._prng.stateLength}function XNe(){return this._prng.byteLength}function YNe(){return this._prng.state}function HNe(r){this._prng.state=r}function ZNe(){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=ez(e):e=ez(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function QNe(r){var e;if(this._destroyed)return $a("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,zNe(t),this;function t(){r&&($a("Stream was destroyed due to an error. Error: %s.",VNe(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(!$k(r))throw new TypeError(rz("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!$k(e))throw new TypeError(rz("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=FNe({},JNe),arguments.length>2&&(n=UNe(i,t),n))throw n;return $a("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),tz.call(this,i),Kk(this,"_destroyed",!1),pi(this,"_objectMode",i.objectMode),pi(this,"_sep",i.sep),pi(this,"_iter",i.iter),pi(this,"_siter",i.siter),Kk(this,"_i",0),pi(this,"_prng",kNe(r,e,i)),pi(this,"PRNG",this._prng.PRNG),this}WNe(ne,tz);sf(ne.prototype,"seed",CNe);sf(ne.prototype,"seedLength",BNe);INe(ne.prototype,"state",YNe,HNe);sf(ne.prototype,"stateLength",DNe);sf(ne.prototype,"byteLength",XNe);pi(ne.prototype,"_read",ZNe);pi(ne.prototype,"destroy",QNe);iz.exports=ne});var az=s(function(UKe,nz){"use strict";var $Ne=require("@stdlib/assert/is-plain-object"),KNe=require("@stdlib/string/format"),eLe=require("@stdlib/object/assign"),rLe=uf();function tLe(r,e,t){var i;if(arguments.length>2){if(i=t,!$Ne(i))throw new TypeError(KNe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=eLe({},t)}else i={};return i.objectMode=!0,new rLe(r,e,i)}nz.exports=tLe});var fz=s(function(CKe,gz){"use strict";var sz=require("@stdlib/assert/is-plain-object"),uz=require("@stdlib/object/assign"),oz=require("@stdlib/string/format"),vz=uf();function iLe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!sz(r))throw new TypeError(oz("invalid argument. Options argument must be an object. Value: `%s`.",r));n=uz({},r)}else if(i>2){if(!sz(t))throw new TypeError(oz("invalid argument. Options argument must be an object. Value: `%s`.",t));n=uz({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new vz(v,g,n)}function o(){return new vz(r,e,n)}}gz.exports=iLe});var cz=s(function(BKe,lz){"use strict";var dz=require("@stdlib/utils/define-nonenumerable-read-only-property"),Em=uf(),nLe=az(),aLe=fz();dz(Em,"objectMode",nLe);dz(Em,"factory",aLe);lz.exports=Em});var mz=s(function(DKe,sLe){sLe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var yz=s(function(XKe,pz){"use strict";var uLe=require("@stdlib/assert/is-plain-object"),Qe=require("@stdlib/assert/has-own-property"),oLe=require("@stdlib/assert/is-boolean").isPrimitive,vLe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,hz=require("@stdlib/assert/is-string").isPrimitive,gLe=require("@stdlib/assert/is-positive-integer").isPrimitive,fLe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,On=require("@stdlib/string/format");function dLe(r,e){return uLe(e)?Qe(e,"sep")&&(r.sep=e.sep,!hz(r.sep))?new TypeError(On("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Qe(e,"objectMode")&&(r.objectMode=e.objectMode,!oLe(r.objectMode))?new TypeError(On("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Qe(e,"encoding")&&(r.encoding=e.encoding,!hz(r.encoding)&&r.encoding!==null)?new TypeError(On("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Qe(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!vLe(r.highWaterMark))?new TypeError(On("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Qe(e,"iter")&&(r.iter=e.iter,!fLe(r.iter))?new TypeError(On("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Qe(e,"siter")&&(r.siter=e.siter,!gLe(r.siter))?new TypeError(On("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Qe(e,"prng")&&(r.prng=e.prng),Qe(e,"seed")&&(r.seed=e.seed),Qe(e,"state")&&(r.state=e.state),Qe(e,"copy")&&(r.copy=e.copy),null):new TypeError(On("invalid argument. Options argument must be an object. Value: `%s`.",e))}pz.exports=dLe});var bz=s(function(YKe,qz){"use strict";var lLe=require("debug"),cLe=lLe("random:streams:betaprime");qz.exports=cLe});var vf=s(function(HKe,Nz){"use strict";var _z=require("readable-stream").Readable,wz=require("@stdlib/assert/is-positive-number").isPrimitive,mLe=require("@stdlib/assert/is-error"),hLe=require("@stdlib/object/assign"),pLe=require("@stdlib/utils/inherit"),Sz=require("@stdlib/utils/define-nonenumerable-property"),yi=require("@stdlib/utils/define-nonenumerable-read-only-property"),of=require("@stdlib/utils/define-read-only-accessor"),yLe=require("@stdlib/utils/define-read-write-accessor"),qLe=on().factory,Oz=require("@stdlib/buffer/from-string"),bLe=require("@stdlib/utils/next-tick"),Ez=require("@stdlib/string/format"),wLe=mz(),SLe=yz(),Ka=bz();function OLe(){return this._prng.seed}function ELe(){return this._prng.seedLength}function _Le(){return this._prng.stateLength}function NLe(){return this._prng.byteLength}function LLe(){return this._prng.state}function RLe(r){this._prng.state=r}function PLe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ka("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ka("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=Oz(e):e=Oz(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function TLe(r){var e;if(this._destroyed)return Ka("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,bLe(t),this;function t(){r&&(Ka("Stream was destroyed due to an error. Error: %s.",mLe(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(!wz(r))throw new TypeError(Ez("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!wz(e))throw new TypeError(Ez("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=hLe({},wLe),arguments.length>2&&(n=SLe(i,t),n))throw n;return Ka("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),_z.call(this,i),Sz(this,"_destroyed",!1),yi(this,"_objectMode",i.objectMode),yi(this,"_sep",i.sep),yi(this,"_iter",i.iter),yi(this,"_siter",i.siter),Sz(this,"_i",0),yi(this,"_prng",qLe(r,e,i)),yi(this,"PRNG",this._prng.PRNG),this}pLe(ae,_z);of(ae.prototype,"seed",OLe);of(ae.prototype,"seedLength",ELe);yLe(ae.prototype,"state",LLe,RLe);of(ae.prototype,"stateLength",_Le);of(ae.prototype,"byteLength",NLe);yi(ae.prototype,"_read",PLe);yi(ae.prototype,"destroy",TLe);Nz.exports=ae});var Rz=s(function(ZKe,Lz){"use strict";var jLe=require("@stdlib/assert/is-plain-object"),MLe=require("@stdlib/string/format"),xLe=require("@stdlib/object/assign"),ALe=vf();function GLe(r,e,t){var i;if(arguments.length>2){if(i=t,!jLe(i))throw new TypeError(MLe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=xLe({},t)}else i={};return i.objectMode=!0,new ALe(r,e,i)}Lz.exports=GLe});var Az=s(function(QKe,xz){"use strict";var Pz=require("@stdlib/assert/is-plain-object"),Tz=require("@stdlib/object/assign"),jz=require("@stdlib/string/format"),Mz=vf();function VLe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!Pz(r))throw new TypeError(jz("invalid argument. Options argument must be an object. Value: `%s`.",r));n=Tz({},r)}else if(i>2){if(!Pz(t))throw new TypeError(jz("invalid argument. Options argument must be an object. Value: `%s`.",t));n=Tz({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new Mz(v,g,n)}function o(){return new Mz(r,e,n)}}xz.exports=VLe});var Fz=s(function($Ke,Vz){"use strict";var Gz=require("@stdlib/utils/define-nonenumerable-read-only-property"),_m=vf(),FLe=Rz(),WLe=Az();Gz(_m,"objectMode",FLe);Gz(_m,"factory",WLe);Vz.exports=_m});var Wz=s(function(KKe,ILe){ILe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var zz=s(function(eer,kz){"use strict";var kLe=require("@stdlib/assert/is-plain-object"),$e=require("@stdlib/assert/has-own-property"),zLe=require("@stdlib/assert/is-boolean").isPrimitive,JLe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,Iz=require("@stdlib/assert/is-string").isPrimitive,ULe=require("@stdlib/assert/is-positive-integer").isPrimitive,CLe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,En=require("@stdlib/string/format");function BLe(r,e){return kLe(e)?$e(e,"sep")&&(r.sep=e.sep,!Iz(r.sep))?new TypeError(En("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):$e(e,"objectMode")&&(r.objectMode=e.objectMode,!zLe(r.objectMode))?new TypeError(En("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):$e(e,"encoding")&&(r.encoding=e.encoding,!Iz(r.encoding)&&r.encoding!==null)?new TypeError(En("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):$e(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!JLe(r.highWaterMark))?new TypeError(En("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):$e(e,"iter")&&(r.iter=e.iter,!CLe(r.iter))?new TypeError(En("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):$e(e,"siter")&&(r.siter=e.siter,!ULe(r.siter))?new TypeError(En("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):($e(e,"prng")&&(r.prng=e.prng),$e(e,"seed")&&(r.seed=e.seed),$e(e,"state")&&(r.state=e.state),$e(e,"copy")&&(r.copy=e.copy),null):new TypeError(En("invalid argument. Options argument must be an object. Value: `%s`.",e))}kz.exports=BLe});var Uz=s(function(rer,Jz){"use strict";var DLe=require("debug"),XLe=DLe("random:streams:binomial");Jz.exports=XLe});var ff=s(function(ter,Yz){"use strict";var Xz=require("readable-stream").Readable,YLe=require("@stdlib/assert/is-positive-integer").isPrimitive,HLe=require("@stdlib/assert/is-probability").isPrimitive,ZLe=require("@stdlib/assert/is-error"),QLe=require("@stdlib/object/assign"),$Le=require("@stdlib/utils/inherit"),Cz=require("@stdlib/utils/define-nonenumerable-property"),qi=require("@stdlib/utils/define-nonenumerable-read-only-property"),gf=require("@stdlib/utils/define-read-only-accessor"),KLe=require("@stdlib/utils/define-read-write-accessor"),eRe=la().factory,Bz=require("@stdlib/buffer/from-string"),rRe=require("@stdlib/utils/next-tick"),Dz=require("@stdlib/string/format"),tRe=Wz(),iRe=zz(),es=Uz();function nRe(){return this._prng.seed}function aRe(){return this._prng.seedLength}function sRe(){return this._prng.stateLength}function uRe(){return this._prng.byteLength}function oRe(){return this._prng.state}function vRe(r){this._prng.state=r}function gRe(){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=Bz(e):e=Bz(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 es("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,rRe(t),this;function t(){r&&(es("Stream was destroyed due to an error. Error: %s.",ZLe(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(!YLe(r))throw new TypeError(Dz("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!HLe(e))throw new TypeError(Dz("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(i=QLe({},tRe),arguments.length>2&&(n=iRe(i,t),n))throw n;return es("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),Xz.call(this,i),Cz(this,"_destroyed",!1),qi(this,"_objectMode",i.objectMode),qi(this,"_sep",i.sep),qi(this,"_iter",i.iter),qi(this,"_siter",i.siter),Cz(this,"_i",0),qi(this,"_prng",eRe(r,e,i)),qi(this,"PRNG",this._prng.PRNG),this}$Le(se,Xz);gf(se.prototype,"seed",nRe);gf(se.prototype,"seedLength",aRe);KLe(se.prototype,"state",oRe,vRe);gf(se.prototype,"stateLength",sRe);gf(se.prototype,"byteLength",uRe);qi(se.prototype,"_read",gRe);qi(se.prototype,"destroy",fRe);Yz.exports=se});var Zz=s(function(ier,Hz){"use strict";var dRe=require("@stdlib/assert/is-plain-object"),lRe=require("@stdlib/object/assign"),cRe=require("@stdlib/string/format"),mRe=ff();function hRe(r,e,t){var i;if(arguments.length>2){if(i=t,!dRe(i))throw new TypeError(cRe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=lRe({},t)}else i={};return i.objectMode=!0,new mRe(r,e,i)}Hz.exports=hRe});var t3=s(function(ner,r3){"use strict";var Qz=require("@stdlib/assert/is-plain-object"),$z=require("@stdlib/object/assign"),Kz=require("@stdlib/string/format"),e3=ff();function pRe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!Qz(r))throw new TypeError(Kz("invalid argument. Options argument must be an object. Value: `%s`.",r));n=$z({},r)}else if(i>2){if(!Qz(t))throw new TypeError(Kz("invalid argument. Options argument must be an object. Value: `%s`.",t));n=$z({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new e3(v,g,n)}function o(){return new e3(r,e,n)}}r3.exports=pRe});var a3=s(function(aer,n3){"use strict";var i3=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nm=ff(),yRe=Zz(),qRe=t3();i3(Nm,"objectMode",yRe);i3(Nm,"factory",qRe);n3.exports=Nm});var s3=s(function(ser,bRe){bRe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var v3=s(function(uer,o3){"use strict";var wRe=require("@stdlib/assert/is-plain-object"),Ke=require("@stdlib/assert/has-own-property"),SRe=require("@stdlib/assert/is-boolean").isPrimitive,ORe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,u3=require("@stdlib/assert/is-string").isPrimitive,ERe=require("@stdlib/assert/is-positive-integer").isPrimitive,_Re=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,_n=require("@stdlib/string/format");function NRe(r,e){return wRe(e)?Ke(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)):Ke(e,"objectMode")&&(r.objectMode=e.objectMode,!SRe(r.objectMode))?new TypeError(_n("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Ke(e,"encoding")&&(r.encoding=e.encoding,!u3(r.encoding)&&r.encoding!==null)?new TypeError(_n("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Ke(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!ORe(r.highWaterMark))?new TypeError(_n("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Ke(e,"iter")&&(r.iter=e.iter,!_Re(r.iter))?new TypeError(_n("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Ke(e,"siter")&&(r.siter=e.siter,!ERe(r.siter))?new TypeError(_n("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Ke(e,"prng")&&(r.prng=e.prng),Ke(e,"seed")&&(r.seed=e.seed),Ke(e,"state")&&(r.state=e.state),Ke(e,"copy")&&(r.copy=e.copy),null):new TypeError(_n("invalid argument. Options argument must be an object. Value: `%s`.",e))}o3.exports=NRe});var f3=s(function(oer,g3){"use strict";var LRe=require("debug"),RRe=LRe("random:streams:box-muller");g3.exports=RRe});var lf=s(function(ver,m3){"use strict";var c3=require("readable-stream").Readable,PRe=require("@stdlib/assert/is-error"),TRe=require("@stdlib/object/assign"),jRe=require("@stdlib/utils/inherit"),d3=require("@stdlib/utils/define-nonenumerable-property"),bi=require("@stdlib/utils/define-nonenumerable-read-only-property"),df=require("@stdlib/utils/define-read-only-accessor"),MRe=require("@stdlib/utils/define-read-write-accessor"),xRe=Xa().factory,l3=require("@stdlib/buffer/from-string"),ARe=require("@stdlib/utils/next-tick"),GRe=s3(),VRe=v3(),rs=f3();function FRe(){return this._prng.seed}function WRe(){return this._prng.seedLength}function IRe(){return this._prng.stateLength}function kRe(){return this._prng.byteLength}function zRe(){return this._prng.state}function JRe(r){this._prng.state=r}function URe(){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=l3(e):e=l3(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function CRe(r){var e;if(this._destroyed)return rs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,ARe(t),this;function t(){r&&(rs("Stream was destroyed due to an error. Error: %s.",PRe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),rs("Closing the stream..."),e.emit("close")}}function ue(r){var e,t;if(!(this instanceof ue))return arguments.length>0?new ue(r):new ue;if(e=TRe({},GRe),arguments.length>0&&(t=VRe(e,r),t))throw t;return rs("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),c3.call(this,e),d3(this,"_destroyed",!1),bi(this,"_objectMode",e.objectMode),bi(this,"_sep",e.sep),bi(this,"_iter",e.iter),bi(this,"_siter",e.siter),d3(this,"_i",0),bi(this,"_prng",xRe(e)),bi(this,"PRNG",this._prng.PRNG),this}jRe(ue,c3);df(ue.prototype,"seed",FRe);df(ue.prototype,"seedLength",WRe);MRe(ue.prototype,"state",zRe,JRe);df(ue.prototype,"stateLength",IRe);df(ue.prototype,"byteLength",kRe);bi(ue.prototype,"_read",URe);bi(ue.prototype,"destroy",CRe);m3.exports=ue});var p3=s(function(ger,h3){"use strict";var BRe=require("@stdlib/assert/is-plain-object"),DRe=require("@stdlib/object/assign"),XRe=require("@stdlib/string/format"),YRe=lf();function HRe(r){var e;if(arguments.length>0){if(e=r,!BRe(e))throw new TypeError(XRe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=DRe({},r)}else e={};return e.objectMode=!0,new YRe(e)}h3.exports=HRe});var q3=s(function(fer,y3){"use strict";var ZRe=require("@stdlib/assert/is-plain-object"),QRe=require("@stdlib/object/assign"),$Re=require("@stdlib/string/format"),KRe=lf();function ePe(r){var e;if(arguments.length>0){if(!ZRe(r))throw new TypeError($Re("invalid argument. Options argument must be an object. Value: `%s`.",r));e=QRe({},r)}else e={};return t;function t(){return new KRe(e)}}y3.exports=ePe});var S3=s(function(der,w3){"use strict";var b3=require("@stdlib/utils/define-nonenumerable-read-only-property"),Lm=lf(),rPe=p3(),tPe=q3();b3(Lm,"objectMode",rPe);b3(Lm,"factory",tPe);w3.exports=Lm});var O3=s(function(ler,iPe){iPe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var N3=s(function(cer,_3){"use strict";var nPe=require("@stdlib/assert/is-plain-object"),er=require("@stdlib/assert/has-own-property"),aPe=require("@stdlib/assert/is-boolean").isPrimitive,sPe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,E3=require("@stdlib/assert/is-string").isPrimitive,uPe=require("@stdlib/assert/is-positive-integer").isPrimitive,oPe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Nn=require("@stdlib/string/format");function vPe(r,e){return nPe(e)?er(e,"sep")&&(r.sep=e.sep,!E3(r.sep))?new TypeError(Nn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):er(e,"objectMode")&&(r.objectMode=e.objectMode,!aPe(r.objectMode))?new TypeError(Nn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):er(e,"encoding")&&(r.encoding=e.encoding,!E3(r.encoding)&&r.encoding!==null)?new TypeError(Nn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):er(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!sPe(r.highWaterMark))?new TypeError(Nn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):er(e,"iter")&&(r.iter=e.iter,!oPe(r.iter))?new TypeError(Nn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):er(e,"siter")&&(r.siter=e.siter,!uPe(r.siter))?new TypeError(Nn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(er(e,"prng")&&(r.prng=e.prng),er(e,"seed")&&(r.seed=e.seed),er(e,"state")&&(r.state=e.state),er(e,"copy")&&(r.copy=e.copy),null):new TypeError(Nn("invalid argument. Options argument must be an object. Value: `%s`.",e))}_3.exports=vPe});var R3=s(function(mer,L3){"use strict";var gPe=require("debug"),fPe=gPe("random:streams:cauchy");L3.exports=fPe});var mf=s(function(her,x3){"use strict";var M3=require("readable-stream").Readable,dPe=require("@stdlib/assert/is-positive-number").isPrimitive,lPe=require("@stdlib/assert/is-number").isPrimitive,cPe=require("@stdlib/math/base/assert/is-nan"),mPe=require("@stdlib/assert/is-error"),hPe=require("@stdlib/object/assign"),pPe=require("@stdlib/utils/inherit"),P3=require("@stdlib/utils/define-nonenumerable-property"),wi=require("@stdlib/utils/define-nonenumerable-read-only-property"),cf=require("@stdlib/utils/define-read-only-accessor"),yPe=require("@stdlib/utils/define-read-write-accessor"),qPe=ma().factory,T3=require("@stdlib/buffer/from-string"),bPe=require("@stdlib/utils/next-tick"),j3=require("@stdlib/string/format"),wPe=O3(),SPe=N3(),ts=R3();function OPe(){return this._prng.seed}function EPe(){return this._prng.seedLength}function _Pe(){return this._prng.stateLength}function NPe(){return this._prng.byteLength}function LPe(){return this._prng.state}function RPe(r){this._prng.state=r}function PPe(){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=T3(e):e=T3(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function TPe(r){var e;if(this._destroyed)return ts("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,bPe(t),this;function t(){r&&(ts("Stream was destroyed due to an error. Error: %s.",mPe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ts("Closing the stream..."),e.emit("close")}}function oe(r,e,t){var i,n;if(!(this instanceof oe))return arguments.length>2?new oe(r,e,t):new oe(r,e);if(!lPe(r)||cPe(r))throw new TypeError(j3("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!dPe(e))throw new TypeError(j3("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=hPe({},wPe),arguments.length>2&&(n=SPe(i,t),n))throw n;return ts("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),M3.call(this,i),P3(this,"_destroyed",!1),wi(this,"_objectMode",i.objectMode),wi(this,"_sep",i.sep),wi(this,"_iter",i.iter),wi(this,"_siter",i.siter),P3(this,"_i",0),wi(this,"_prng",qPe(r,e,i)),wi(this,"PRNG",this._prng.PRNG),this}pPe(oe,M3);cf(oe.prototype,"seed",OPe);cf(oe.prototype,"seedLength",EPe);yPe(oe.prototype,"state",LPe,RPe);cf(oe.prototype,"stateLength",_Pe);cf(oe.prototype,"byteLength",NPe);wi(oe.prototype,"_read",PPe);wi(oe.prototype,"destroy",TPe);x3.exports=oe});var G3=s(function(per,A3){"use strict";var jPe=require("@stdlib/assert/is-plain-object"),MPe=require("@stdlib/object/assign"),xPe=require("@stdlib/string/format"),APe=mf();function GPe(r,e,t){var i;if(arguments.length>2){if(i=t,!jPe(i))throw new TypeError(xPe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=MPe({},t)}else i={};return i.objectMode=!0,new APe(r,e,i)}A3.exports=GPe});var z3=s(function(yer,k3){"use strict";var V3=require("@stdlib/assert/is-plain-object"),F3=require("@stdlib/object/assign"),W3=require("@stdlib/string/format"),I3=mf();function VPe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!V3(r))throw new TypeError(W3("invalid argument. Options argument must be an object. Value: `%s`.",r));n=F3({},r)}else if(i>2){if(!V3(t))throw new TypeError(W3("invalid argument. Options argument must be an object. Value: `%s`.",t));n=F3({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new I3(v,g,n)}function o(){return new I3(r,e,n)}}k3.exports=VPe});var C3=s(function(qer,U3){"use strict";var J3=require("@stdlib/utils/define-nonenumerable-read-only-property"),Rm=mf(),FPe=G3(),WPe=z3();J3(Rm,"objectMode",FPe);J3(Rm,"factory",WPe);U3.exports=Rm});var B3=s(function(ber,IPe){IPe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var Y3=s(function(wer,X3){"use strict";var kPe=require("@stdlib/assert/is-plain-object"),rr=require("@stdlib/assert/has-own-property"),zPe=require("@stdlib/assert/is-boolean").isPrimitive,JPe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,D3=require("@stdlib/assert/is-string").isPrimitive,UPe=require("@stdlib/assert/is-positive-integer").isPrimitive,CPe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ln=require("@stdlib/string/format");function BPe(r,e){return kPe(e)?rr(e,"sep")&&(r.sep=e.sep,!D3(r.sep))?new TypeError(Ln("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):rr(e,"objectMode")&&(r.objectMode=e.objectMode,!zPe(r.objectMode))?new TypeError(Ln("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):rr(e,"encoding")&&(r.encoding=e.encoding,!D3(r.encoding)&&r.encoding!==null)?new TypeError(Ln("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):rr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!JPe(r.highWaterMark))?new TypeError(Ln("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):rr(e,"iter")&&(r.iter=e.iter,!CPe(r.iter))?new TypeError(Ln("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):rr(e,"siter")&&(r.siter=e.siter,!UPe(r.siter))?new TypeError(Ln("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(rr(e,"prng")&&(r.prng=e.prng),rr(e,"seed")&&(r.seed=e.seed),rr(e,"state")&&(r.state=e.state),rr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Ln("invalid argument. Options argument must be an object. Value: `%s`.",e))}X3.exports=BPe});var Z3=s(function(Ser,H3){"use strict";var DPe=require("debug"),XPe=DPe("random:streams:chi");H3.exports=XPe});var pf=s(function(Oer,eJ){"use strict";var K3=require("readable-stream").Readable,YPe=require("@stdlib/assert/is-positive-number").isPrimitive,HPe=require("@stdlib/assert/is-error"),ZPe=require("@stdlib/object/assign"),QPe=require("@stdlib/utils/inherit"),Q3=require("@stdlib/utils/define-nonenumerable-property"),Si=require("@stdlib/utils/define-nonenumerable-read-only-property"),hf=require("@stdlib/utils/define-read-only-accessor"),$Pe=require("@stdlib/utils/define-read-write-accessor"),KPe=vn().factory,$3=require("@stdlib/buffer/from-string"),eTe=require("@stdlib/utils/next-tick"),rTe=require("@stdlib/string/format"),tTe=B3(),iTe=Y3(),is=Z3();function nTe(){return this._prng.seed}function aTe(){return this._prng.seedLength}function sTe(){return this._prng.stateLength}function uTe(){return this._prng.byteLength}function oTe(){return this._prng.state}function vTe(r){this._prng.state=r}function gTe(){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=$3(e):e=$3(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function fTe(r){var e;if(this._destroyed)return is("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,eTe(t),this;function t(){r&&(is("Stream was destroyed due to an error. Error: %s.",HPe(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(!YPe(r))throw new TypeError(rTe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=ZPe({},tTe),arguments.length>1&&(i=iTe(t,e),i))throw i;return is("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),K3.call(this,t),Q3(this,"_destroyed",!1),Si(this,"_objectMode",t.objectMode),Si(this,"_sep",t.sep),Si(this,"_iter",t.iter),Si(this,"_siter",t.siter),Q3(this,"_i",0),Si(this,"_prng",KPe(r,t)),Si(this,"PRNG",this._prng.PRNG),this}QPe(ve,K3);hf(ve.prototype,"seed",nTe);hf(ve.prototype,"seedLength",aTe);$Pe(ve.prototype,"state",oTe,vTe);hf(ve.prototype,"stateLength",sTe);hf(ve.prototype,"byteLength",uTe);Si(ve.prototype,"_read",gTe);Si(ve.prototype,"destroy",fTe);eJ.exports=ve});var tJ=s(function(Eer,rJ){"use strict";var dTe=require("@stdlib/assert/is-plain-object"),lTe=require("@stdlib/object/assign"),cTe=require("@stdlib/string/format"),mTe=pf();function hTe(r,e){var t;if(arguments.length>1){if(t=e,!dTe(t))throw new TypeError(cTe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=lTe({},e)}else t={};return t.objectMode=!0,new mTe(r,t)}rJ.exports=hTe});var oJ=s(function(_er,uJ){"use strict";var iJ=require("@stdlib/assert/is-plain-object"),pTe=require("@stdlib/assert/is-positive-number").isPrimitive,nJ=require("@stdlib/object/assign"),aJ=require("@stdlib/string/format"),sJ=pf();function yTe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!iJ(e))throw new TypeError(aJ("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=nJ({},e)}else if(t===1)if(pTe(r))n=u,i={};else{if(!iJ(r))throw new TypeError(aJ("invalid argument. Options argument must be an object. Value: `%s`.",r));i=nJ({},r),n=a}else i={},n=a;return n;function a(o){return new sJ(o,i)}function u(){return new sJ(r,i)}}uJ.exports=yTe});var fJ=s(function(Ner,gJ){"use strict";var vJ=require("@stdlib/utils/define-nonenumerable-read-only-property"),Pm=pf(),qTe=tJ(),bTe=oJ();vJ(Pm,"objectMode",qTe);vJ(Pm,"factory",bTe);gJ.exports=Pm});var dJ=s(function(Ler,wTe){wTe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var mJ=s(function(Rer,cJ){"use strict";var STe=require("@stdlib/assert/is-plain-object"),tr=require("@stdlib/assert/has-own-property"),OTe=require("@stdlib/assert/is-boolean").isPrimitive,ETe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,lJ=require("@stdlib/assert/is-string").isPrimitive,_Te=require("@stdlib/assert/is-positive-integer").isPrimitive,NTe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Rn=require("@stdlib/string/format");function LTe(r,e){return STe(e)?tr(e,"sep")&&(r.sep=e.sep,!lJ(r.sep))?new TypeError(Rn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):tr(e,"objectMode")&&(r.objectMode=e.objectMode,!OTe(r.objectMode))?new TypeError(Rn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):tr(e,"encoding")&&(r.encoding=e.encoding,!lJ(r.encoding)&&r.encoding!==null)?new TypeError(Rn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):tr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!ETe(r.highWaterMark))?new TypeError(Rn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):tr(e,"iter")&&(r.iter=e.iter,!NTe(r.iter))?new TypeError(Rn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):tr(e,"siter")&&(r.siter=e.siter,!_Te(r.siter))?new TypeError(Rn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(tr(e,"prng")&&(r.prng=e.prng),tr(e,"seed")&&(r.seed=e.seed),tr(e,"state")&&(r.state=e.state),tr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Rn("invalid argument. Options argument must be an object. Value: `%s`.",e))}cJ.exports=LTe});var pJ=s(function(Per,hJ){"use strict";var RTe=require("debug"),PTe=RTe("random:streams:chisquare");hJ.exports=PTe});var qf=s(function(Ter,wJ){"use strict";var bJ=require("readable-stream").Readable,TTe=require("@stdlib/assert/is-positive-number").isPrimitive,jTe=require("@stdlib/assert/is-error"),MTe=require("@stdlib/object/assign"),xTe=require("@stdlib/utils/inherit"),yJ=require("@stdlib/utils/define-nonenumerable-property"),Oi=require("@stdlib/utils/define-nonenumerable-read-only-property"),yf=require("@stdlib/utils/define-read-only-accessor"),ATe=require("@stdlib/utils/define-read-write-accessor"),GTe=Ur().factory,qJ=require("@stdlib/buffer/from-string"),VTe=require("@stdlib/utils/next-tick"),FTe=require("@stdlib/string/format"),WTe=dJ(),ITe=mJ(),ns=pJ();function kTe(){return this._prng.seed}function zTe(){return this._prng.seedLength}function JTe(){return this._prng.stateLength}function UTe(){return this._prng.byteLength}function CTe(){return this._prng.state}function BTe(r){this._prng.state=r}function DTe(){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=qJ(e):e=qJ(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,VTe(t),this;function t(){r&&(ns("Stream was destroyed due to an error. Error: %s.",jTe(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(!TTe(r))throw new TypeError(FTe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=MTe({},WTe),arguments.length>1&&(i=ITe(t,e),i))throw i;return ns("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),bJ.call(this,t),yJ(this,"_destroyed",!1),Oi(this,"_objectMode",t.objectMode),Oi(this,"_sep",t.sep),Oi(this,"_iter",t.iter),Oi(this,"_siter",t.siter),yJ(this,"_i",0),Oi(this,"_prng",GTe(r,t)),Oi(this,"PRNG",this._prng.PRNG),this}xTe(ge,bJ);yf(ge.prototype,"seed",kTe);yf(ge.prototype,"seedLength",zTe);ATe(ge.prototype,"state",CTe,BTe);yf(ge.prototype,"stateLength",JTe);yf(ge.prototype,"byteLength",UTe);Oi(ge.prototype,"_read",DTe);Oi(ge.prototype,"destroy",XTe);wJ.exports=ge});var OJ=s(function(jer,SJ){"use strict";var YTe=require("@stdlib/assert/is-plain-object"),HTe=require("@stdlib/object/assign"),ZTe=require("@stdlib/string/format"),QTe=qf();function $Te(r,e){var t;if(arguments.length>1){if(t=e,!YTe(t))throw new TypeError(ZTe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=HTe({},t)}else t={};return t.objectMode=!0,new QTe(r,t)}SJ.exports=$Te});var PJ=s(function(Mer,RJ){"use strict";var KTe=require("@stdlib/assert/is-positive-number").isPrimitive,EJ=require("@stdlib/assert/is-plain-object"),_J=require("@stdlib/object/assign"),NJ=require("@stdlib/string/format"),LJ=qf();function eje(r,e){var t,i,n;if(t=arguments.length,t>1){if(!EJ(e))throw new TypeError(NJ("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=_J({},e)}else if(t===1)if(KTe(r))n=u,i={};else{if(!EJ(r))throw new TypeError(NJ("invalid argument. Options argument must be an object. Value: `%s`.",r));i=_J({},r),n=a}else i={},n=a;return n;function a(o){return new LJ(o,i)}function u(){return new LJ(r,i)}}RJ.exports=eje});var MJ=s(function(xer,jJ){"use strict";var TJ=require("@stdlib/utils/define-nonenumerable-read-only-property"),Tm=qf(),rje=OJ(),tje=PJ();TJ(Tm,"objectMode",rje);TJ(Tm,"factory",tje);jJ.exports=Tm});var xJ=s(function(Aer,ije){ije.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var VJ=s(function(Ger,GJ){"use strict";var nje=require("@stdlib/assert/is-plain-object"),ir=require("@stdlib/assert/has-own-property"),aje=require("@stdlib/assert/is-boolean").isPrimitive,sje=require("@stdlib/assert/is-nonnegative-number").isPrimitive,AJ=require("@stdlib/assert/is-string").isPrimitive,uje=require("@stdlib/assert/is-positive-integer").isPrimitive,oje=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Pn=require("@stdlib/string/format");function vje(r,e){return nje(e)?ir(e,"sep")&&(r.sep=e.sep,!AJ(r.sep))?new TypeError(Pn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):ir(e,"objectMode")&&(r.objectMode=e.objectMode,!aje(r.objectMode))?new TypeError(Pn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):ir(e,"encoding")&&(r.encoding=e.encoding,!AJ(r.encoding)&&r.encoding!==null)?new TypeError(Pn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):ir(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!sje(r.highWaterMark))?new TypeError(Pn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):ir(e,"iter")&&(r.iter=e.iter,!oje(r.iter))?new TypeError(Pn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):ir(e,"siter")&&(r.siter=e.siter,!uje(r.siter))?new TypeError(Pn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(ir(e,"prng")&&(r.prng=e.prng),ir(e,"seed")&&(r.seed=e.seed),ir(e,"state")&&(r.state=e.state),ir(e,"copy")&&(r.copy=e.copy),null):new TypeError(Pn("invalid argument. Options argument must be an object. Value: `%s`.",e))}GJ.exports=vje});var WJ=s(function(Ver,FJ){"use strict";var gje=require("debug"),fje=gje("random:streams:cosine");FJ.exports=fje});var wf=s(function(Fer,UJ){"use strict";var JJ=require("readable-stream").Readable,dje=require("@stdlib/assert/is-positive-number").isPrimitive,lje=require("@stdlib/assert/is-number").isPrimitive,cje=require("@stdlib/math/base/assert/is-nan"),mje=require("@stdlib/assert/is-error"),hje=require("@stdlib/object/assign"),pje=require("@stdlib/utils/inherit"),IJ=require("@stdlib/utils/define-nonenumerable-property"),Ei=require("@stdlib/utils/define-nonenumerable-read-only-property"),bf=require("@stdlib/utils/define-read-only-accessor"),yje=require("@stdlib/utils/define-read-write-accessor"),qje=gn().factory,kJ=require("@stdlib/buffer/from-string"),bje=require("@stdlib/utils/next-tick"),zJ=require("@stdlib/string/format"),wje=xJ(),Sje=VJ(),as=WJ();function Oje(){return this._prng.seed}function Eje(){return this._prng.seedLength}function _je(){return this._prng.stateLength}function Nje(){return this._prng.byteLength}function Lje(){return this._prng.state}function Rje(r){this._prng.state=r}function Pje(){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=kJ(e):e=kJ(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Tje(r){var e;if(this._destroyed)return as("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,bje(t),this;function t(){r&&(as("Stream was destroyed due to an error. Error: %s.",mje(r)?r.message:JSON.stringify(r)),e.emit("error",r)),as("Closing the stream..."),e.emit("close")}}function fe(r,e,t){var i,n;if(!(this instanceof fe))return arguments.length>2?new fe(r,e,t):new fe(r,e);if(!lje(r)||cje(r))throw new TypeError(zJ("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!dje(e))throw new TypeError(zJ("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=hje({},wje),arguments.length>2&&(n=Sje(i,t),n))throw n;return as("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),JJ.call(this,i),IJ(this,"_destroyed",!1),Ei(this,"_objectMode",i.objectMode),Ei(this,"_sep",i.sep),Ei(this,"_iter",i.iter),Ei(this,"_siter",i.siter),IJ(this,"_i",0),Ei(this,"_prng",qje(r,e,i)),Ei(this,"PRNG",this._prng.PRNG),this}pje(fe,JJ);bf(fe.prototype,"seed",Oje);bf(fe.prototype,"seedLength",Eje);yje(fe.prototype,"state",Lje,Rje);bf(fe.prototype,"stateLength",_je);bf(fe.prototype,"byteLength",Nje);Ei(fe.prototype,"_read",Pje);Ei(fe.prototype,"destroy",Tje);UJ.exports=fe});var BJ=s(function(Wer,CJ){"use strict";var jje=require("@stdlib/assert/is-plain-object"),Mje=require("@stdlib/object/assign"),xje=require("@stdlib/string/format"),Aje=wf();function Gje(r,e,t){var i;if(arguments.length>2){if(i=t,!jje(i))throw new TypeError(xje("invalid argument. Options argument must be an object. Value: `%s`.",i));i=Mje({},t)}else i={};return i.objectMode=!0,new Aje(r,e,i)}CJ.exports=Gje});var QJ=s(function(Ier,ZJ){"use strict";var DJ=require("@stdlib/assert/is-plain-object"),XJ=require("@stdlib/object/assign"),YJ=require("@stdlib/string/format"),HJ=wf();function Vje(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!DJ(r))throw new TypeError(YJ("invalid argument. Options argument must be an object. Value: `%s`.",r));n=XJ({},r)}else if(i>2){if(!DJ(t))throw new TypeError(YJ("invalid argument. Options argument must be an object. Value: `%s`.",t));n=XJ({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new HJ(v,g,n)}function o(){return new HJ(r,e,n)}}ZJ.exports=Vje});var eU=s(function(ker,KJ){"use strict";var $J=require("@stdlib/utils/define-nonenumerable-read-only-property"),jm=wf(),Fje=BJ(),Wje=QJ();$J(jm,"objectMode",Fje);$J(jm,"factory",Wje);KJ.exports=jm});var rU=s(function(zer,Ije){Ije.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var nU=s(function(Jer,iU){"use strict";var kje=require("@stdlib/assert/is-plain-object"),nr=require("@stdlib/assert/has-own-property"),zje=require("@stdlib/assert/is-boolean").isPrimitive,Jje=require("@stdlib/assert/is-nonnegative-number").isPrimitive,tU=require("@stdlib/assert/is-string").isPrimitive,Uje=require("@stdlib/assert/is-positive-integer").isPrimitive,Cje=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Tn=require("@stdlib/string/format");function Bje(r,e){return kje(e)?nr(e,"sep")&&(r.sep=e.sep,!tU(r.sep))?new TypeError(Tn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):nr(e,"objectMode")&&(r.objectMode=e.objectMode,!zje(r.objectMode))?new TypeError(Tn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):nr(e,"encoding")&&(r.encoding=e.encoding,!tU(r.encoding)&&r.encoding!==null)?new TypeError(Tn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):nr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!Jje(r.highWaterMark))?new TypeError(Tn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):nr(e,"iter")&&(r.iter=e.iter,!Cje(r.iter))?new TypeError(Tn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):nr(e,"siter")&&(r.siter=e.siter,!Uje(r.siter))?new TypeError(Tn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(nr(e,"prng")&&(r.prng=e.prng),nr(e,"seed")&&(r.seed=e.seed),nr(e,"state")&&(r.state=e.state),nr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Tn("invalid argument. Options argument must be an object. Value: `%s`.",e))}iU.exports=Bje});var sU=s(function(Uer,aU){"use strict";var Dje=require("debug"),Xje=Dje("random:streams:discrete-uniform");aU.exports=Xje});var Of=s(function(Cer,fU){"use strict";var gU=require("readable-stream").Readable,uU=require("@stdlib/assert/is-integer").isPrimitive,Yje=require("@stdlib/assert/is-error"),Hje=require("@stdlib/object/assign"),Zje=require("@stdlib/utils/inherit"),oU=require("@stdlib/utils/define-nonenumerable-property"),_i=require("@stdlib/utils/define-nonenumerable-read-only-property"),Sf=require("@stdlib/utils/define-read-only-accessor"),Qje=require("@stdlib/utils/define-read-write-accessor"),$je=fn().factory,vU=require("@stdlib/buffer/from-string"),Kje=require("@stdlib/utils/next-tick"),Mm=require("@stdlib/string/format"),e0e=rU(),r0e=nU(),ss=sU();function t0e(){return this._prng.seed}function i0e(){return this._prng.seedLength}function n0e(){return this._prng.stateLength}function a0e(){return this._prng.byteLength}function s0e(){return this._prng.state}function u0e(r){this._prng.state=r}function o0e(){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=vU(e):e=vU(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function v0e(r){var e;if(this._destroyed)return ss("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,Kje(t),this;function t(){r&&(ss("Stream was destroyed due to an error. Error: %s.",Yje(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(!uU(r))throw new TypeError(Mm("invalid argument. First argument must be an integer. Value: `%s`.",r));if(!uU(e))throw new TypeError(Mm("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(r>e)throw new RangeError(Mm("invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d, %d]`.",r,e));if(i=Hje({},e0e),arguments.length>2&&(n=r0e(i,t),n))throw n;return ss("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),gU.call(this,i),oU(this,"_destroyed",!1),_i(this,"_objectMode",i.objectMode),_i(this,"_sep",i.sep),_i(this,"_iter",i.iter),_i(this,"_siter",i.siter),oU(this,"_i",0),_i(this,"_prng",$je(r,e,i)),_i(this,"PRNG",this._prng.PRNG),this}Zje(de,gU);Sf(de.prototype,"seed",t0e);Sf(de.prototype,"seedLength",i0e);Qje(de.prototype,"state",s0e,u0e);Sf(de.prototype,"stateLength",n0e);Sf(de.prototype,"byteLength",a0e);_i(de.prototype,"_read",o0e);_i(de.prototype,"destroy",v0e);fU.exports=de});var lU=s(function(Ber,dU){"use strict";var g0e=require("@stdlib/assert/is-plain-object"),f0e=require("@stdlib/object/assign"),d0e=require("@stdlib/string/format"),l0e=Of();function c0e(r,e,t){var i;if(arguments.length>2){if(i=t,!g0e(i))throw new TypeError(d0e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=f0e({},t)}else i={};return i.objectMode=!0,new l0e(r,e,i)}dU.exports=c0e});var qU=s(function(Der,yU){"use strict";var cU=require("@stdlib/assert/is-plain-object"),mU=require("@stdlib/object/assign"),hU=require("@stdlib/string/format"),pU=Of();function m0e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!cU(r))throw new TypeError(hU("invalid argument. Options argument must be an object. Value: `%s`.",r));n=mU({},r)}else if(i>2){if(!cU(t))throw new TypeError(hU("invalid argument. Options argument must be an object. Value: `%s`.",t));n=mU({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new pU(v,g,n)}function o(){return new pU(r,e,n)}}yU.exports=m0e});var SU=s(function(Xer,wU){"use strict";var bU=require("@stdlib/utils/define-nonenumerable-read-only-property"),xm=Of(),h0e=lU(),p0e=qU();bU(xm,"objectMode",h0e);bU(xm,"factory",p0e);wU.exports=xm});var OU=s(function(Yer,y0e){y0e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var NU=s(function(Her,_U){"use strict";var q0e=require("@stdlib/assert/is-plain-object"),ar=require("@stdlib/assert/has-own-property"),b0e=require("@stdlib/assert/is-boolean").isPrimitive,w0e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,EU=require("@stdlib/assert/is-string").isPrimitive,S0e=require("@stdlib/assert/is-positive-integer").isPrimitive,O0e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,jn=require("@stdlib/string/format");function E0e(r,e){return q0e(e)?ar(e,"sep")&&(r.sep=e.sep,!EU(r.sep))?new TypeError(jn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):ar(e,"objectMode")&&(r.objectMode=e.objectMode,!b0e(r.objectMode))?new TypeError(jn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):ar(e,"encoding")&&(r.encoding=e.encoding,!EU(r.encoding)&&r.encoding!==null)?new TypeError(jn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):ar(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!w0e(r.highWaterMark))?new TypeError(jn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):ar(e,"iter")&&(r.iter=e.iter,!O0e(r.iter))?new TypeError(jn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):ar(e,"siter")&&(r.siter=e.siter,!S0e(r.siter))?new TypeError(jn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(ar(e,"prng")&&(r.prng=e.prng),ar(e,"seed")&&(r.seed=e.seed),ar(e,"state")&&(r.state=e.state),ar(e,"copy")&&(r.copy=e.copy),null):new TypeError(jn("invalid argument. Options argument must be an object. Value: `%s`.",e))}_U.exports=E0e});var RU=s(function(Zer,LU){"use strict";var _0e=require("debug"),N0e=_0e("random:streams:erlang");LU.exports=N0e});var _f=s(function(Qer,xU){"use strict";var MU=require("readable-stream").Readable,L0e=require("@stdlib/assert/is-positive-integer").isPrimitive,R0e=require("@stdlib/assert/is-positive-number").isPrimitive,P0e=require("@stdlib/assert/is-error"),T0e=require("@stdlib/object/assign"),j0e=require("@stdlib/utils/inherit"),PU=require("@stdlib/utils/define-nonenumerable-property"),Ni=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ef=require("@stdlib/utils/define-read-only-accessor"),M0e=require("@stdlib/utils/define-read-write-accessor"),x0e=ba().factory,TU=require("@stdlib/buffer/from-string"),A0e=require("@stdlib/utils/next-tick"),jU=require("@stdlib/string/format"),G0e=OU(),V0e=NU(),us=RU();function F0e(){return this._prng.seed}function W0e(){return this._prng.seedLength}function I0e(){return this._prng.stateLength}function k0e(){return this._prng.byteLength}function z0e(){return this._prng.state}function J0e(r){this._prng.state=r}function U0e(){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=TU(e):e=TU(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function C0e(r){var e;if(this._destroyed)return us("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,A0e(t),this;function t(){r&&(us("Stream was destroyed due to an error. Error: %s.",P0e(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(jU("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!R0e(e))throw new TypeError(jU("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=T0e({},G0e),arguments.length>2&&(n=V0e(i,t),n))throw n;return us("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),MU.call(this,i),PU(this,"_destroyed",!1),Ni(this,"_objectMode",i.objectMode),Ni(this,"_sep",i.sep),Ni(this,"_iter",i.iter),Ni(this,"_siter",i.siter),PU(this,"_i",0),Ni(this,"_prng",x0e(r,e,i)),Ni(this,"PRNG",this._prng.PRNG),this}j0e(le,MU);Ef(le.prototype,"seed",F0e);Ef(le.prototype,"seedLength",W0e);M0e(le.prototype,"state",z0e,J0e);Ef(le.prototype,"stateLength",I0e);Ef(le.prototype,"byteLength",k0e);Ni(le.prototype,"_read",U0e);Ni(le.prototype,"destroy",C0e);xU.exports=le});var GU=s(function($er,AU){"use strict";var B0e=require("@stdlib/assert/is-plain-object"),D0e=require("@stdlib/object/assign"),X0e=require("@stdlib/string/format"),Y0e=_f();function H0e(r,e,t){var i;if(arguments.length>2){if(i=t,!B0e(i))throw new TypeError(X0e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=D0e({},t)}else i={};return i.objectMode=!0,new Y0e(r,e,i)}AU.exports=H0e});var zU=s(function(Ker,kU){"use strict";var VU=require("@stdlib/assert/is-plain-object"),FU=require("@stdlib/object/assign"),WU=require("@stdlib/string/format"),IU=_f();function Z0e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!VU(r))throw new TypeError(WU("invalid argument. Options argument must be an object. Value: `%s`.",r));n=FU({},r)}else if(i>2){if(!VU(t))throw new TypeError(WU("invalid argument. Options argument must be an object. Value: `%s`.",t));n=FU({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new IU(v,g,n)}function o(){return new IU(r,e,n)}}kU.exports=Z0e});var CU=s(function(err,UU){"use strict";var JU=require("@stdlib/utils/define-nonenumerable-read-only-property"),Am=_f(),Q0e=GU(),$0e=zU();JU(Am,"objectMode",Q0e);JU(Am,"factory",$0e);UU.exports=Am});var BU=s(function(rrr,K0e){K0e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var YU=s(function(trr,XU){"use strict";var eMe=require("@stdlib/assert/is-plain-object"),sr=require("@stdlib/assert/has-own-property"),rMe=require("@stdlib/assert/is-boolean").isPrimitive,tMe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,DU=require("@stdlib/assert/is-string").isPrimitive,iMe=require("@stdlib/assert/is-positive-integer").isPrimitive,nMe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Mn=require("@stdlib/string/format");function aMe(r,e){return eMe(e)?sr(e,"sep")&&(r.sep=e.sep,!DU(r.sep))?new TypeError(Mn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):sr(e,"objectMode")&&(r.objectMode=e.objectMode,!rMe(r.objectMode))?new TypeError(Mn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):sr(e,"encoding")&&(r.encoding=e.encoding,!DU(r.encoding)&&r.encoding!==null)?new TypeError(Mn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):sr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!tMe(r.highWaterMark))?new TypeError(Mn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):sr(e,"iter")&&(r.iter=e.iter,!nMe(r.iter))?new TypeError(Mn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):sr(e,"siter")&&(r.siter=e.siter,!iMe(r.siter))?new TypeError(Mn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(sr(e,"prng")&&(r.prng=e.prng),sr(e,"seed")&&(r.seed=e.seed),sr(e,"state")&&(r.state=e.state),sr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Mn("invalid argument. Options argument must be an object. Value: `%s`.",e))}XU.exports=aMe});var ZU=s(function(irr,HU){"use strict";var sMe=require("debug"),uMe=sMe("random:streams:exponential");HU.exports=uMe});var Lf=s(function(nrr,eC){"use strict";var KU=require("readable-stream").Readable,oMe=require("@stdlib/assert/is-positive-number").isPrimitive,vMe=require("@stdlib/assert/is-error"),gMe=require("@stdlib/object/assign"),fMe=require("@stdlib/utils/inherit"),QU=require("@stdlib/utils/define-nonenumerable-property"),Li=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nf=require("@stdlib/utils/define-read-only-accessor"),dMe=require("@stdlib/utils/define-read-write-accessor"),lMe=dn().factory,$U=require("@stdlib/buffer/from-string"),cMe=require("@stdlib/utils/next-tick"),mMe=require("@stdlib/string/format"),hMe=BU(),pMe=YU(),os=ZU();function yMe(){return this._prng.seed}function qMe(){return this._prng.seedLength}function bMe(){return this._prng.stateLength}function wMe(){return this._prng.byteLength}function SMe(){return this._prng.state}function OMe(r){this._prng.state=r}function EMe(){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=$U(e):e=$U(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 os("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,cMe(t),this;function t(){r&&(os("Stream was destroyed due to an error. Error: %s.",vMe(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(!oMe(r))throw new TypeError(mMe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=gMe({},hMe),arguments.length>1&&(i=pMe(t,e),i))throw i;return os("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),KU.call(this,t),QU(this,"_destroyed",!1),Li(this,"_objectMode",t.objectMode),Li(this,"_sep",t.sep),Li(this,"_iter",t.iter),Li(this,"_siter",t.siter),QU(this,"_i",0),Li(this,"_prng",lMe(r,t)),Li(this,"PRNG",this._prng.PRNG),this}fMe(ce,KU);Nf(ce.prototype,"seed",yMe);Nf(ce.prototype,"seedLength",qMe);dMe(ce.prototype,"state",SMe,OMe);Nf(ce.prototype,"stateLength",bMe);Nf(ce.prototype,"byteLength",wMe);Li(ce.prototype,"_read",EMe);Li(ce.prototype,"destroy",_Me);eC.exports=ce});var tC=s(function(arr,rC){"use strict";var NMe=require("@stdlib/assert/is-plain-object"),LMe=require("@stdlib/object/assign"),RMe=require("@stdlib/string/format"),PMe=Lf();function TMe(r,e){var t;if(arguments.length>1){if(t=e,!NMe(t))throw new TypeError(RMe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=LMe({},e)}else t={};return t.objectMode=!0,new PMe(r,t)}rC.exports=TMe});var oC=s(function(srr,uC){"use strict";var jMe=require("@stdlib/assert/is-positive-number").isPrimitive,iC=require("@stdlib/assert/is-plain-object"),nC=require("@stdlib/object/assign"),aC=require("@stdlib/string/format"),sC=Lf();function MMe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!iC(e))throw new TypeError(aC("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=nC({},e)}else if(t===1)if(jMe(r))n=u,i={};else{if(!iC(r))throw new TypeError(aC("invalid argument. Options argument must be an object. Value: `%s`.",r));i=nC({},r),n=a}else i={},n=a;return n;function a(o){return new sC(o,i)}function u(){return new sC(r,i)}}uC.exports=MMe});var fC=s(function(urr,gC){"use strict";var vC=require("@stdlib/utils/define-nonenumerable-read-only-property"),Gm=Lf(),xMe=tC(),AMe=oC();vC(Gm,"objectMode",xMe);vC(Gm,"factory",AMe);gC.exports=Gm});var dC=s(function(orr,GMe){GMe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var mC=s(function(vrr,cC){"use strict";var VMe=require("@stdlib/assert/is-plain-object"),ur=require("@stdlib/assert/has-own-property"),FMe=require("@stdlib/assert/is-boolean").isPrimitive,WMe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,lC=require("@stdlib/assert/is-string").isPrimitive,IMe=require("@stdlib/assert/is-positive-integer").isPrimitive,kMe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,xn=require("@stdlib/string/format");function zMe(r,e){return VMe(e)?ur(e,"sep")&&(r.sep=e.sep,!lC(r.sep))?new TypeError(xn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):ur(e,"objectMode")&&(r.objectMode=e.objectMode,!FMe(r.objectMode))?new TypeError(xn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):ur(e,"encoding")&&(r.encoding=e.encoding,!lC(r.encoding)&&r.encoding!==null)?new TypeError(xn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):ur(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!WMe(r.highWaterMark))?new TypeError(xn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):ur(e,"iter")&&(r.iter=e.iter,!kMe(r.iter))?new TypeError(xn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):ur(e,"siter")&&(r.siter=e.siter,!IMe(r.siter))?new TypeError(xn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(ur(e,"prng")&&(r.prng=e.prng),ur(e,"seed")&&(r.seed=e.seed),ur(e,"state")&&(r.state=e.state),ur(e,"copy")&&(r.copy=e.copy),null):new TypeError(xn("invalid argument. Options argument must be an object. Value: `%s`.",e))}cC.exports=zMe});var pC=s(function(grr,hC){"use strict";var JMe=require("debug"),UMe=JMe("random:streams:f");hC.exports=UMe});var Pf=s(function(frr,OC){"use strict";var SC=require("readable-stream").Readable,yC=require("@stdlib/assert/is-positive-number").isPrimitive,CMe=require("@stdlib/assert/is-error"),BMe=require("@stdlib/object/assign"),DMe=require("@stdlib/utils/inherit"),qC=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"),YMe=Sa().factory,bC=require("@stdlib/buffer/from-string"),HMe=require("@stdlib/utils/next-tick"),wC=require("@stdlib/string/format"),ZMe=dC(),QMe=mC(),vs=pC();function $Me(){return this._prng.seed}function KMe(){return this._prng.seedLength}function exe(){return this._prng.stateLength}function rxe(){return this._prng.byteLength}function txe(){return this._prng.state}function ixe(r){this._prng.state=r}function nxe(){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=bC(e):e=bC(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function axe(r){var e;if(this._destroyed)return vs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,HMe(t),this;function t(){r&&(vs("Stream was destroyed due to an error. Error: %s.",CMe(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(!yC(r))throw new TypeError(wC("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!yC(e))throw new TypeError(wC("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=BMe({},ZMe),arguments.length>2&&(n=QMe(i,t),n))throw n;return vs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),SC.call(this,i),qC(this,"_destroyed",!1),Ri(this,"_objectMode",i.objectMode),Ri(this,"_sep",i.sep),Ri(this,"_iter",i.iter),Ri(this,"_siter",i.siter),qC(this,"_i",0),Ri(this,"_prng",YMe(r,e,i)),Ri(this,"PRNG",this._prng.PRNG),this}DMe(me,SC);Rf(me.prototype,"seed",$Me);Rf(me.prototype,"seedLength",KMe);XMe(me.prototype,"state",txe,ixe);Rf(me.prototype,"stateLength",exe);Rf(me.prototype,"byteLength",rxe);Ri(me.prototype,"_read",nxe);Ri(me.prototype,"destroy",axe);OC.exports=me});var _C=s(function(drr,EC){"use strict";var sxe=require("@stdlib/assert/is-plain-object"),uxe=require("@stdlib/object/assign"),oxe=require("@stdlib/string/format"),vxe=Pf();function gxe(r,e,t){var i;if(arguments.length>2){if(i=t,!sxe(i))throw new TypeError(oxe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=uxe({},t)}else i={};return i.objectMode=!0,new vxe(r,e,i)}EC.exports=gxe});var jC=s(function(lrr,TC){"use strict";var NC=require("@stdlib/assert/is-plain-object"),LC=require("@stdlib/object/assign"),RC=require("@stdlib/string/format"),PC=Pf();function fxe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!NC(r))throw new TypeError(RC("invalid argument. Options argument must be an object. Value: `%s`.",r));n=LC({},r)}else if(i>2){if(!NC(t))throw new TypeError(RC("invalid argument. Options argument must be an object. Value: `%s`.",t));n=LC({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new PC(v,g,n)}function o(){return new PC(r,e,n)}}TC.exports=fxe});var AC=s(function(crr,xC){"use strict";var MC=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vm=Pf(),dxe=_C(),lxe=jC();MC(Vm,"objectMode",dxe);MC(Vm,"factory",lxe);xC.exports=Vm});var GC=s(function(mrr,cxe){cxe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var WC=s(function(hrr,FC){"use strict";var mxe=require("@stdlib/assert/is-plain-object"),or=require("@stdlib/assert/has-own-property"),hxe=require("@stdlib/assert/is-boolean").isPrimitive,pxe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,VC=require("@stdlib/assert/is-string").isPrimitive,yxe=require("@stdlib/assert/is-positive-integer").isPrimitive,qxe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,An=require("@stdlib/string/format");function bxe(r,e){return mxe(e)?or(e,"sep")&&(r.sep=e.sep,!VC(r.sep))?new TypeError(An("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):or(e,"objectMode")&&(r.objectMode=e.objectMode,!hxe(r.objectMode))?new TypeError(An("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):or(e,"encoding")&&(r.encoding=e.encoding,!VC(r.encoding)&&r.encoding!==null)?new TypeError(An("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):or(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!pxe(r.highWaterMark))?new TypeError(An("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):or(e,"iter")&&(r.iter=e.iter,!qxe(r.iter))?new TypeError(An("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):or(e,"siter")&&(r.siter=e.siter,!yxe(r.siter))?new TypeError(An("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(or(e,"prng")&&(r.prng=e.prng),or(e,"seed")&&(r.seed=e.seed),or(e,"state")&&(r.state=e.state),or(e,"copy")&&(r.copy=e.copy),null):new TypeError(An("invalid argument. Options argument must be an object. Value: `%s`.",e))}FC.exports=bxe});var kC=s(function(prr,IC){"use strict";var wxe=require("debug"),Sxe=wxe("random:streams:frechet");IC.exports=Sxe});var jf=s(function(yrr,BC){"use strict";var CC=require("readable-stream").Readable,zC=require("@stdlib/assert/is-positive-number"),Oxe=require("@stdlib/assert/is-number").isPrimitive,Exe=require("@stdlib/math/base/assert/is-nan"),_xe=require("@stdlib/assert/is-error"),Nxe=require("@stdlib/object/assign"),Lxe=require("@stdlib/utils/inherit"),JC=require("@stdlib/utils/define-nonenumerable-property"),Pi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Tf=require("@stdlib/utils/define-read-only-accessor"),Rxe=require("@stdlib/utils/define-read-write-accessor"),Pxe=Ea().factory,UC=require("@stdlib/buffer/from-string"),Txe=require("@stdlib/utils/next-tick"),Fm=require("@stdlib/string/format"),jxe=GC(),Mxe=WC(),gs=kC();function xxe(){return this._prng.seed}function Axe(){return this._prng.seedLength}function Gxe(){return this._prng.stateLength}function Vxe(){return this._prng.byteLength}function Fxe(){return this._prng.state}function Wxe(r){this._prng.state=r}function Ixe(){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=UC(e):e=UC(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function kxe(r){var e;if(this._destroyed)return gs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,Txe(t),this;function t(){r&&(gs("Stream was destroyed due to an error. Error: %s.",_xe(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(!zC(r))throw new TypeError(Fm("invalid argument. First argument must be a positive number and not NaN. Value: `%s`.",r));if(!zC(e))throw new TypeError(Fm("invalid argument. Second argument must be a positive number and not NaN. Value: `%s`.",e));if(!Oxe(t)||Exe(t))throw new TypeError(Fm("invalid argument. Third argument must be a number. Value: `%s`.",t));if(n=Nxe({},jxe),arguments.length>3&&(a=Mxe(n,i),a))throw a;return gs("Creating a readable stream configured with the following options: %s.",JSON.stringify(n)),CC.call(this,n),JC(this,"_destroyed",!1),Pi(this,"_objectMode",n.objectMode),Pi(this,"_sep",n.sep),Pi(this,"_iter",n.iter),Pi(this,"_siter",n.siter),JC(this,"_i",0),Pi(this,"_prng",Pxe(r,e,t,n)),Pi(this,"PRNG",this._prng.PRNG),this}Lxe(he,CC);Tf(he.prototype,"seed",xxe);Tf(he.prototype,"seedLength",Axe);Rxe(he.prototype,"state",Fxe,Wxe);Tf(he.prototype,"stateLength",Gxe);Tf(he.prototype,"byteLength",Vxe);Pi(he.prototype,"_read",Ixe);Pi(he.prototype,"destroy",kxe);BC.exports=he});var XC=s(function(qrr,DC){"use strict";var zxe=require("@stdlib/assert/is-plain-object"),Jxe=require("@stdlib/object/assign"),Uxe=require("@stdlib/string/format"),Cxe=jf();function Bxe(r,e,t,i){var n;if(arguments.length>3){if(n=i,!zxe(n))throw new TypeError(Uxe("invalid argument. Options argument must be an object. Value: `%s`.",n));n=Jxe({},i)}else n={};return n.objectMode=!0,new Cxe(r,e,t,n)}DC.exports=Bxe});var KC=s(function(brr,$C){"use strict";var YC=require("@stdlib/assert/is-plain-object"),HC=require("@stdlib/object/assign"),ZC=require("@stdlib/string/format"),QC=jf();function Dxe(r,e,t,i){var n,a,u;if(n=arguments.length,n===1){if(!YC(r))throw new TypeError(ZC("invalid argument. Options argument must be an object. Value: `%s`.",r));a=HC({},r)}else if(n>3){if(!YC(i))throw new TypeError(ZC("invalid argument. Options argument must be an object. Value: `%s`.",i));a=HC({},i)}else a={};return n<3?u=o:u=v,u;function o(g,c,l){return new QC(g,c,l,a)}function v(){return new QC(r,e,t,a)}}$C.exports=Dxe});var tB=s(function(wrr,rB){"use strict";var eB=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wm=jf(),Xxe=XC(),Yxe=KC();eB(Wm,"objectMode",Xxe);eB(Wm,"factory",Yxe);rB.exports=Wm});var iB=s(function(Srr,Hxe){Hxe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var sB=s(function(Orr,aB){"use strict";var Zxe=require("@stdlib/assert/is-plain-object"),vr=require("@stdlib/assert/has-own-property"),Qxe=require("@stdlib/assert/is-boolean").isPrimitive,$xe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,nB=require("@stdlib/assert/is-string").isPrimitive,Kxe=require("@stdlib/assert/is-positive-integer").isPrimitive,e1e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Gn=require("@stdlib/string/format");function r1e(r,e){return Zxe(e)?vr(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)):vr(e,"objectMode")&&(r.objectMode=e.objectMode,!Qxe(r.objectMode))?new TypeError(Gn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):vr(e,"encoding")&&(r.encoding=e.encoding,!nB(r.encoding)&&r.encoding!==null)?new TypeError(Gn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):vr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!$xe(r.highWaterMark))?new TypeError(Gn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):vr(e,"iter")&&(r.iter=e.iter,!e1e(r.iter))?new TypeError(Gn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):vr(e,"siter")&&(r.siter=e.siter,!Kxe(r.siter))?new TypeError(Gn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(vr(e,"prng")&&(r.prng=e.prng),vr(e,"seed")&&(r.seed=e.seed),vr(e,"state")&&(r.state=e.state),vr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Gn("invalid argument. Options argument must be an object. Value: `%s`.",e))}aB.exports=r1e});var oB=s(function(Err,uB){"use strict";var t1e=require("debug"),i1e=t1e("random:streams:gamma");uB.exports=i1e});var xf=s(function(_rr,cB){"use strict";var lB=require("readable-stream").Readable,vB=require("@stdlib/assert/is-positive-number").isPrimitive,n1e=require("@stdlib/assert/is-error"),a1e=require("@stdlib/object/assign"),s1e=require("@stdlib/utils/inherit"),gB=require("@stdlib/utils/define-nonenumerable-property"),Ti=require("@stdlib/utils/define-nonenumerable-read-only-property"),Mf=require("@stdlib/utils/define-read-only-accessor"),u1e=require("@stdlib/utils/define-read-write-accessor"),o1e=Ce().factory,fB=require("@stdlib/buffer/from-string"),v1e=require("@stdlib/utils/next-tick"),dB=require("@stdlib/string/format"),g1e=iB(),f1e=sB(),fs=oB();function d1e(){return this._prng.seed}function l1e(){return this._prng.seedLength}function c1e(){return this._prng.stateLength}function m1e(){return this._prng.byteLength}function h1e(){return this._prng.state}function p1e(r){this._prng.state=r}function y1e(){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=fB(e):e=fB(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function q1e(r){var e;if(this._destroyed)return fs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,v1e(t),this;function t(){r&&(fs("Stream was destroyed due to an error. Error: %s.",n1e(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(!vB(r))throw new TypeError(dB("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!vB(e))throw new TypeError(dB("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=a1e({},g1e),arguments.length>2&&(n=f1e(i,t),n))throw n;return fs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),lB.call(this,i),gB(this,"_destroyed",!1),Ti(this,"_objectMode",i.objectMode),Ti(this,"_sep",i.sep),Ti(this,"_iter",i.iter),Ti(this,"_siter",i.siter),gB(this,"_i",0),Ti(this,"_prng",o1e(r,e,i)),Ti(this,"PRNG",this._prng.PRNG),this}s1e(pe,lB);Mf(pe.prototype,"seed",d1e);Mf(pe.prototype,"seedLength",l1e);u1e(pe.prototype,"state",h1e,p1e);Mf(pe.prototype,"stateLength",c1e);Mf(pe.prototype,"byteLength",m1e);Ti(pe.prototype,"_read",y1e);Ti(pe.prototype,"destroy",q1e);cB.exports=pe});var hB=s(function(Nrr,mB){"use strict";var b1e=require("@stdlib/assert/is-plain-object"),w1e=require("@stdlib/object/assign"),S1e=require("@stdlib/string/format"),O1e=xf();function E1e(r,e,t){var i;if(arguments.length>2){if(i=t,!b1e(i))throw new TypeError(S1e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=w1e({},t)}else i={};return i.objectMode=!0,new O1e(r,e,i)}mB.exports=E1e});var SB=s(function(Lrr,wB){"use strict";var pB=require("@stdlib/assert/is-plain-object"),yB=require("@stdlib/object/assign"),qB=require("@stdlib/string/format"),bB=xf();function _1e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!pB(r))throw new TypeError(qB("invalid argument. Options argument must be an object. Value: `%s`.",r));n=yB({},r)}else if(i>2){if(!pB(t))throw new TypeError(qB("invalid argument. Options argument must be an object. Value: `%s`.",t));n=yB({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new bB(v,g,n)}function o(){return new bB(r,e,n)}}wB.exports=_1e});var _B=s(function(Rrr,EB){"use strict";var OB=require("@stdlib/utils/define-nonenumerable-read-only-property"),Im=xf(),N1e=hB(),L1e=SB();OB(Im,"objectMode",N1e);OB(Im,"factory",L1e);EB.exports=Im});var NB=s(function(Prr,R1e){R1e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var PB=s(function(Trr,RB){"use strict";var P1e=require("@stdlib/assert/is-plain-object"),gr=require("@stdlib/assert/has-own-property"),T1e=require("@stdlib/assert/is-boolean").isPrimitive,j1e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,LB=require("@stdlib/assert/is-string").isPrimitive,M1e=require("@stdlib/assert/is-positive-integer").isPrimitive,x1e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Vn=require("@stdlib/string/format");function A1e(r,e){return P1e(e)?gr(e,"sep")&&(r.sep=e.sep,!LB(r.sep))?new TypeError(Vn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):gr(e,"objectMode")&&(r.objectMode=e.objectMode,!T1e(r.objectMode))?new TypeError(Vn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):gr(e,"encoding")&&(r.encoding=e.encoding,!LB(r.encoding)&&r.encoding!==null)?new TypeError(Vn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):gr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!j1e(r.highWaterMark))?new TypeError(Vn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):gr(e,"iter")&&(r.iter=e.iter,!x1e(r.iter))?new TypeError(Vn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):gr(e,"siter")&&(r.siter=e.siter,!M1e(r.siter))?new TypeError(Vn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(gr(e,"prng")&&(r.prng=e.prng),gr(e,"seed")&&(r.seed=e.seed),gr(e,"state")&&(r.state=e.state),gr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Vn("invalid argument. Options argument must be an object. Value: `%s`.",e))}RB.exports=A1e});var jB=s(function(jrr,TB){"use strict";var G1e=require("debug"),V1e=G1e("random:streams:geometric");TB.exports=V1e});var Gf=s(function(Mrr,GB){"use strict";var AB=require("readable-stream").Readable,F1e=require("@stdlib/assert/is-probability").isPrimitive,W1e=require("@stdlib/assert/is-error"),I1e=require("@stdlib/object/assign"),k1e=require("@stdlib/utils/inherit"),MB=require("@stdlib/utils/define-nonenumerable-property"),ji=require("@stdlib/utils/define-nonenumerable-read-only-property"),Af=require("@stdlib/utils/define-read-only-accessor"),z1e=require("@stdlib/utils/define-read-write-accessor"),J1e=_a().factory,xB=require("@stdlib/buffer/from-string"),U1e=require("@stdlib/utils/next-tick"),C1e=require("@stdlib/string/format"),B1e=NB(),D1e=PB(),ds=jB();function X1e(){return this._prng.seed}function Y1e(){return this._prng.seedLength}function H1e(){return this._prng.stateLength}function Z1e(){return this._prng.byteLength}function Q1e(){return this._prng.state}function $1e(r){this._prng.state=r}function K1e(){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=xB(e):e=xB(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function eAe(r){var e;if(this._destroyed)return ds("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,U1e(t),this;function t(){r&&(ds("Stream was destroyed due to an error. Error: %s.",W1e(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(!F1e(r))throw new TypeError(C1e("invalid argument. First argument must be a probability. Value: `%s`.",r));if(t=I1e({},B1e),arguments.length>1&&(i=D1e(t,e),i))throw i;return ds("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),AB.call(this,t),MB(this,"_destroyed",!1),ji(this,"_objectMode",t.objectMode),ji(this,"_sep",t.sep),ji(this,"_iter",t.iter),ji(this,"_siter",t.siter),MB(this,"_i",0),ji(this,"_prng",J1e(r,t)),ji(this,"PRNG",this._prng.PRNG),this}k1e(ye,AB);Af(ye.prototype,"seed",X1e);Af(ye.prototype,"seedLength",Y1e);z1e(ye.prototype,"state",Q1e,$1e);Af(ye.prototype,"stateLength",H1e);Af(ye.prototype,"byteLength",Z1e);ji(ye.prototype,"_read",K1e);ji(ye.prototype,"destroy",eAe);GB.exports=ye});var FB=s(function(xrr,VB){"use strict";var rAe=require("@stdlib/assert/is-plain-object"),tAe=require("@stdlib/object/assign"),iAe=require("@stdlib/string/format"),nAe=Gf();function aAe(r,e){var t;if(arguments.length>1){if(t=e,!rAe(t))throw new TypeError(iAe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=tAe({},e)}else t={};return t.objectMode=!0,new nAe(r,t)}VB.exports=aAe});var UB=s(function(Arr,JB){"use strict";var sAe=require("@stdlib/assert/is-probability").isPrimitive,WB=require("@stdlib/assert/is-plain-object"),IB=require("@stdlib/object/assign"),kB=require("@stdlib/string/format"),zB=Gf();function uAe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!WB(e))throw new TypeError(kB("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=IB({},e)}else if(t===1)if(sAe(r))n=u,i={};else{if(!WB(r))throw new TypeError(kB("invalid argument. Options argument must be an object. Value: `%s`.",r));i=IB({},r),n=a}else i={},n=a;return n;function a(o){return new zB(o,i)}function u(){return new zB(r,i)}}JB.exports=uAe});var DB=s(function(Grr,BB){"use strict";var CB=require("@stdlib/utils/define-nonenumerable-read-only-property"),km=Gf(),oAe=FB(),vAe=UB();CB(km,"objectMode",oAe);CB(km,"factory",vAe);BB.exports=km});var XB=s(function(Vrr,gAe){gAe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var ZB=s(function(Frr,HB){"use strict";var fAe=require("@stdlib/assert/is-plain-object"),fr=require("@stdlib/assert/has-own-property"),dAe=require("@stdlib/assert/is-boolean").isPrimitive,lAe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,YB=require("@stdlib/assert/is-string").isPrimitive,cAe=require("@stdlib/assert/is-positive-integer").isPrimitive,mAe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Fn=require("@stdlib/string/format");function hAe(r,e){return fAe(e)?fr(e,"sep")&&(r.sep=e.sep,!YB(r.sep))?new TypeError(Fn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):fr(e,"objectMode")&&(r.objectMode=e.objectMode,!dAe(r.objectMode))?new TypeError(Fn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):fr(e,"encoding")&&(r.encoding=e.encoding,!YB(r.encoding)&&r.encoding!==null)?new TypeError(Fn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):fr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!lAe(r.highWaterMark))?new TypeError(Fn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):fr(e,"iter")&&(r.iter=e.iter,!mAe(r.iter))?new TypeError(Fn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):fr(e,"siter")&&(r.siter=e.siter,!cAe(r.siter))?new TypeError(Fn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(fr(e,"prng")&&(r.prng=e.prng),fr(e,"seed")&&(r.seed=e.seed),fr(e,"state")&&(r.state=e.state),fr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Fn("invalid argument. Options argument must be an object. Value: `%s`.",e))}HB.exports=hAe});var $B=s(function(Wrr,QB){"use strict";var pAe=require("debug"),yAe=pAe("random:streams:gumbel");QB.exports=yAe});var Ff=s(function(Irr,i9){"use strict";var t9=require("readable-stream").Readable,qAe=require("@stdlib/assert/is-positive-number").isPrimitive,bAe=require("@stdlib/assert/is-number").isPrimitive,wAe=require("@stdlib/math/base/assert/is-nan"),SAe=require("@stdlib/assert/is-error"),OAe=require("@stdlib/object/assign"),EAe=require("@stdlib/utils/inherit"),KB=require("@stdlib/utils/define-nonenumerable-property"),Mi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vf=require("@stdlib/utils/define-read-only-accessor"),_Ae=require("@stdlib/utils/define-read-write-accessor"),NAe=Na().factory,e9=require("@stdlib/buffer/from-string"),LAe=require("@stdlib/utils/next-tick"),r9=require("@stdlib/string/format"),RAe=XB(),PAe=ZB(),ls=$B();function TAe(){return this._prng.seed}function jAe(){return this._prng.seedLength}function MAe(){return this._prng.stateLength}function xAe(){return this._prng.byteLength}function AAe(){return this._prng.state}function GAe(r){this._prng.state=r}function VAe(){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=e9(e):e=e9(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function FAe(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.",SAe(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(!bAe(r)||wAe(r))throw new TypeError(r9("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!qAe(e))throw new TypeError(r9("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=OAe({},RAe),arguments.length>2&&(n=PAe(i,t),n))throw n;return ls("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),t9.call(this,i),KB(this,"_destroyed",!1),Mi(this,"_objectMode",i.objectMode),Mi(this,"_sep",i.sep),Mi(this,"_iter",i.iter),Mi(this,"_siter",i.siter),KB(this,"_i",0),Mi(this,"_prng",NAe(r,e,i)),Mi(this,"PRNG",this._prng.PRNG),this}EAe(qe,t9);Vf(qe.prototype,"seed",TAe);Vf(qe.prototype,"seedLength",jAe);_Ae(qe.prototype,"state",AAe,GAe);Vf(qe.prototype,"stateLength",MAe);Vf(qe.prototype,"byteLength",xAe);Mi(qe.prototype,"_read",VAe);Mi(qe.prototype,"destroy",FAe);i9.exports=qe});var a9=s(function(krr,n9){"use strict";var WAe=require("@stdlib/assert/is-plain-object"),IAe=require("@stdlib/object/assign"),kAe=require("@stdlib/string/format"),zAe=Ff();function JAe(r,e,t){var i;if(arguments.length>2){if(i=t,!WAe(i))throw new TypeError(kAe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=IAe({},t)}else i={};return i.objectMode=!0,new zAe(r,e,i)}n9.exports=JAe});var f9=s(function(zrr,g9){"use strict";var s9=require("@stdlib/assert/is-plain-object"),u9=require("@stdlib/object/assign"),o9=require("@stdlib/string/format"),v9=Ff();function UAe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!s9(r))throw new TypeError(o9("invalid argument. Options argument must be an object. Value: `%s`.",r));n=u9({},r)}else if(i>2){if(!s9(t))throw new TypeError(o9("invalid argument. Options argument must be an object. Value: `%s`.",t));n=u9({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new v9(v,g,n)}function o(){return new v9(r,e,n)}}g9.exports=UAe});var c9=s(function(Jrr,l9){"use strict";var d9=require("@stdlib/utils/define-nonenumerable-read-only-property"),zm=Ff(),CAe=a9(),BAe=f9();d9(zm,"objectMode",CAe);d9(zm,"factory",BAe);l9.exports=zm});var m9=s(function(Urr,DAe){DAe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var y9=s(function(Crr,p9){"use strict";var XAe=require("@stdlib/assert/is-plain-object"),dr=require("@stdlib/assert/has-own-property"),YAe=require("@stdlib/assert/is-boolean").isPrimitive,HAe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,h9=require("@stdlib/assert/is-string").isPrimitive,ZAe=require("@stdlib/assert/is-positive-integer").isPrimitive,QAe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Wn=require("@stdlib/string/format");function $Ae(r,e){return XAe(e)?dr(e,"sep")&&(r.sep=e.sep,!h9(r.sep))?new TypeError(Wn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):dr(e,"objectMode")&&(r.objectMode=e.objectMode,!YAe(r.objectMode))?new TypeError(Wn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):dr(e,"encoding")&&(r.encoding=e.encoding,!h9(r.encoding)&&r.encoding!==null)?new TypeError(Wn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):dr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!HAe(r.highWaterMark))?new TypeError(Wn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):dr(e,"iter")&&(r.iter=e.iter,!QAe(r.iter))?new TypeError(Wn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):dr(e,"siter")&&(r.siter=e.siter,!ZAe(r.siter))?new TypeError(Wn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(dr(e,"prng")&&(r.prng=e.prng),dr(e,"seed")&&(r.seed=e.seed),dr(e,"state")&&(r.state=e.state),dr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Wn("invalid argument. Options argument must be an object. Value: `%s`.",e))}p9.exports=$Ae});var b9=s(function(Brr,q9){"use strict";var KAe=require("debug"),eGe=KAe("random:streams:hypergeometric");q9.exports=eGe});var If=s(function(Drr,E9){"use strict";var O9=require("readable-stream").Readable,Jm=require("@stdlib/assert/is-nonnegative-integer"),rGe=require("@stdlib/assert/is-error"),tGe=require("@stdlib/object/assign"),iGe=require("@stdlib/utils/inherit"),w9=require("@stdlib/utils/define-nonenumerable-property"),xi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wf=require("@stdlib/utils/define-read-only-accessor"),nGe=require("@stdlib/utils/define-read-write-accessor"),aGe=La().factory,S9=require("@stdlib/buffer/from-string"),sGe=require("@stdlib/utils/next-tick"),Um=require("@stdlib/string/format"),uGe=m9(),oGe=y9(),cs=b9();function vGe(){return this._prng.seed}function gGe(){return this._prng.seedLength}function fGe(){return this._prng.stateLength}function dGe(){return this._prng.byteLength}function lGe(){return this._prng.state}function cGe(r){this._prng.state=r}function mGe(){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=S9(e):e=S9(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function hGe(r){var e;if(this._destroyed)return cs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,sGe(t),this;function t(){r&&(cs("Stream was destroyed due to an error. Error: %s.",rGe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),cs("Closing the stream..."),e.emit("close")}}function be(r,e,t,i){var n,a;if(!(this instanceof be))return arguments.length>3?new be(r,e,t,i):new be(r,e,t);if(!Jm(r))throw new TypeError(Um("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r));if(!Jm(e))throw new TypeError(Um("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",e));if(!Jm(t))throw new TypeError(Um("invalid argument. Third argument must be a nonnegative integer. Value: `%s`.",t));if(t>r)throw new RangeError("invalid argument. Third argument must be less than or equal to the first argument.");if(e>r)throw new RangeError("invalid argument. Second argument must be less than or equal to the first argument.");if(n=tGe({},uGe),arguments.length>3&&(a=oGe(n,i),a))throw a;return cs("Creating a readable stream configured with the following options: %s.",JSON.stringify(n)),O9.call(this,n),w9(this,"_destroyed",!1),xi(this,"_objectMode",n.objectMode),xi(this,"_sep",n.sep),xi(this,"_iter",n.iter),xi(this,"_siter",n.siter),w9(this,"_i",0),xi(this,"_prng",aGe(r,e,t,n)),xi(this,"PRNG",this._prng.PRNG),this}iGe(be,O9);Wf(be.prototype,"seed",vGe);Wf(be.prototype,"seedLength",gGe);nGe(be.prototype,"state",lGe,cGe);Wf(be.prototype,"stateLength",fGe);Wf(be.prototype,"byteLength",dGe);xi(be.prototype,"_read",mGe);xi(be.prototype,"destroy",hGe);E9.exports=be});var N9=s(function(Xrr,_9){"use strict";var pGe=require("@stdlib/assert/is-plain-object"),yGe=require("@stdlib/object/assign"),qGe=require("@stdlib/string/format"),bGe=If();function wGe(r,e,t,i){var n;if(arguments.length>3){if(n=i,!pGe(n))throw new TypeError(qGe("invalid argument. Options argument must be an object. Value: `%s`.",n));n=yGe({},i)}else n={};return n.objectMode=!0,new bGe(r,e,t,n)}_9.exports=wGe});var M9=s(function(Yrr,j9){"use strict";var L9=require("@stdlib/assert/is-plain-object"),R9=require("@stdlib/object/assign"),P9=require("@stdlib/string/format"),T9=If();function SGe(r,e,t,i){var n,a,u;if(n=arguments.length,n===1){if(!L9(r))throw new TypeError(P9("invalid argument. Options argument must be an object. Value: `%s`.",r));a=R9({},r)}else if(n>3){if(!L9(i))throw new TypeError(P9("invalid argument. Options argument must be an object. Value: `%s`.",i));a=R9({},i)}else a={};return n<3?u=o:u=v,u;function o(g,c,l){return new T9(g,c,l,a)}function v(){return new T9(r,e,t,a)}}j9.exports=SGe});var G9=s(function(Hrr,A9){"use strict";var x9=require("@stdlib/utils/define-nonenumerable-read-only-property"),Cm=If(),OGe=N9(),EGe=M9();x9(Cm,"objectMode",OGe);x9(Cm,"factory",EGe);A9.exports=Cm});var V9=s(function(Zrr,_Ge){_Ge.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var I9=s(function(Qrr,W9){"use strict";var NGe=require("@stdlib/assert/is-plain-object"),lr=require("@stdlib/assert/has-own-property"),LGe=require("@stdlib/assert/is-boolean").isPrimitive,RGe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,F9=require("@stdlib/assert/is-string").isPrimitive,PGe=require("@stdlib/assert/is-positive-integer").isPrimitive,TGe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,In=require("@stdlib/string/format");function jGe(r,e){return NGe(e)?lr(e,"sep")&&(r.sep=e.sep,!F9(r.sep))?new TypeError(In("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):lr(e,"objectMode")&&(r.objectMode=e.objectMode,!LGe(r.objectMode))?new TypeError(In("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):lr(e,"encoding")&&(r.encoding=e.encoding,!F9(r.encoding)&&r.encoding!==null)?new TypeError(In("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):lr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!RGe(r.highWaterMark))?new TypeError(In("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):lr(e,"iter")&&(r.iter=e.iter,!TGe(r.iter))?new TypeError(In("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):lr(e,"siter")&&(r.siter=e.siter,!PGe(r.siter))?new TypeError(In("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(lr(e,"prng")&&(r.prng=e.prng),lr(e,"seed")&&(r.seed=e.seed),lr(e,"state")&&(r.state=e.state),lr(e,"copy")&&(r.copy=e.copy),null):new TypeError(In("invalid argument. Options argument must be an object. Value: `%s`.",e))}W9.exports=jGe});var z9=s(function($rr,k9){"use strict";var MGe=require("debug"),xGe=MGe("random:streams:improved-ziggurat");k9.exports=xGe});var zf=s(function(Krr,B9){"use strict";var C9=require("readable-stream").Readable,AGe=require("@stdlib/assert/is-error"),GGe=require("@stdlib/object/assign"),VGe=require("@stdlib/utils/inherit"),J9=require("@stdlib/utils/define-nonenumerable-property"),Ai=require("@stdlib/utils/define-nonenumerable-read-only-property"),kf=require("@stdlib/utils/define-read-only-accessor"),FGe=require("@stdlib/utils/define-read-write-accessor"),WGe=Q().factory,U9=require("@stdlib/buffer/from-string"),IGe=require("@stdlib/utils/next-tick"),kGe=V9(),zGe=I9(),ms=z9();function JGe(){return this._prng.seed}function UGe(){return this._prng.seedLength}function CGe(){return this._prng.stateLength}function BGe(){return this._prng.byteLength}function DGe(){return this._prng.state}function XGe(r){this._prng.state=r}function YGe(){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=U9(e):e=U9(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function HGe(r){var e;if(this._destroyed)return ms("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,IGe(t),this;function t(){r&&(ms("Stream was destroyed due to an error. Error: %s.",AGe(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=GGe({},kGe),arguments.length>0&&(t=zGe(e,r),t))throw t;return ms("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),C9.call(this,e),J9(this,"_destroyed",!1),Ai(this,"_objectMode",e.objectMode),Ai(this,"_sep",e.sep),Ai(this,"_iter",e.iter),Ai(this,"_siter",e.siter),J9(this,"_i",0),Ai(this,"_prng",WGe(e)),Ai(this,"PRNG",this._prng.PRNG),this}VGe(we,C9);kf(we.prototype,"seed",JGe);kf(we.prototype,"seedLength",UGe);FGe(we.prototype,"state",DGe,XGe);kf(we.prototype,"stateLength",CGe);kf(we.prototype,"byteLength",BGe);Ai(we.prototype,"_read",YGe);Ai(we.prototype,"destroy",HGe);B9.exports=we});var X9=s(function(etr,D9){"use strict";var ZGe=require("@stdlib/assert/is-plain-object"),QGe=require("@stdlib/object/assign"),$Ge=require("@stdlib/string/format"),KGe=zf();function eVe(r){var e;if(arguments.length>0){if(e=r,!ZGe(e))throw new TypeError($Ge("invalid argument. Options argument must be an object. Value: `%s`.",e));e=QGe({},r)}else e={};return e.objectMode=!0,new KGe(e)}D9.exports=eVe});var H9=s(function(rtr,Y9){"use strict";var rVe=require("@stdlib/assert/is-plain-object"),tVe=require("@stdlib/object/assign"),iVe=require("@stdlib/string/format"),nVe=zf();function aVe(r){var e;if(arguments.length>0){if(!rVe(r))throw new TypeError(iVe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=tVe({},r)}else e={};return t;function t(){return new nVe(e)}}Y9.exports=aVe});var $9=s(function(ttr,Q9){"use strict";var Z9=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bm=zf(),sVe=X9(),uVe=H9();Z9(Bm,"objectMode",sVe);Z9(Bm,"factory",uVe);Q9.exports=Bm});var K9=s(function(itr,oVe){oVe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var tD=s(function(ntr,rD){"use strict";var vVe=require("@stdlib/assert/is-plain-object"),cr=require("@stdlib/assert/has-own-property"),gVe=require("@stdlib/assert/is-boolean").isPrimitive,fVe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,eD=require("@stdlib/assert/is-string").isPrimitive,dVe=require("@stdlib/assert/is-positive-integer").isPrimitive,lVe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,kn=require("@stdlib/string/format");function cVe(r,e){return vVe(e)?cr(e,"sep")&&(r.sep=e.sep,!eD(r.sep))?new TypeError(kn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):cr(e,"objectMode")&&(r.objectMode=e.objectMode,!gVe(r.objectMode))?new TypeError(kn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):cr(e,"encoding")&&(r.encoding=e.encoding,!eD(r.encoding)&&r.encoding!==null)?new TypeError(kn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):cr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!fVe(r.highWaterMark))?new TypeError(kn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):cr(e,"iter")&&(r.iter=e.iter,!lVe(r.iter))?new TypeError(kn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):cr(e,"siter")&&(r.siter=e.siter,!dVe(r.siter))?new TypeError(kn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(cr(e,"prng")&&(r.prng=e.prng),cr(e,"seed")&&(r.seed=e.seed),cr(e,"state")&&(r.state=e.state),cr(e,"copy")&&(r.copy=e.copy),null):new TypeError(kn("invalid argument. Options argument must be an object. Value: `%s`.",e))}rD.exports=cVe});var nD=s(function(atr,iD){"use strict";var mVe=require("debug"),hVe=mVe("random:streams:invgamma");iD.exports=hVe});var Uf=s(function(str,gD){"use strict";var vD=require("readable-stream").Readable,aD=require("@stdlib/assert/is-positive-number").isPrimitive,pVe=require("@stdlib/assert/is-error"),yVe=require("@stdlib/object/assign"),qVe=require("@stdlib/utils/inherit"),sD=require("@stdlib/utils/define-nonenumerable-property"),Gi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Jf=require("@stdlib/utils/define-read-only-accessor"),bVe=require("@stdlib/utils/define-read-write-accessor"),wVe=ln().factory,uD=require("@stdlib/buffer/from-string"),SVe=require("@stdlib/utils/next-tick"),oD=require("@stdlib/string/format"),OVe=K9(),EVe=tD(),hs=nD();function _Ve(){return this._prng.seed}function NVe(){return this._prng.seedLength}function LVe(){return this._prng.stateLength}function RVe(){return this._prng.byteLength}function PVe(){return this._prng.state}function TVe(r){this._prng.state=r}function jVe(){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=uD(e):e=uD(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function MVe(r){var e;if(this._destroyed)return hs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,SVe(t),this;function t(){r&&(hs("Stream was destroyed due to an error. Error: %s.",pVe(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(!aD(r))throw new TypeError(oD("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!aD(e))throw new TypeError(oD("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=yVe({},OVe),arguments.length>2&&(n=EVe(i,t),n))throw n;return hs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),vD.call(this,i),sD(this,"_destroyed",!1),Gi(this,"_objectMode",i.objectMode),Gi(this,"_sep",i.sep),Gi(this,"_iter",i.iter),Gi(this,"_siter",i.siter),sD(this,"_i",0),Gi(this,"_prng",wVe(r,e,i)),Gi(this,"PRNG",this._prng.PRNG),this}qVe(Se,vD);Jf(Se.prototype,"seed",_Ve);Jf(Se.prototype,"seedLength",NVe);bVe(Se.prototype,"state",PVe,TVe);Jf(Se.prototype,"stateLength",LVe);Jf(Se.prototype,"byteLength",RVe);Gi(Se.prototype,"_read",jVe);Gi(Se.prototype,"destroy",MVe);gD.exports=Se});var dD=s(function(utr,fD){"use strict";var xVe=require("@stdlib/assert/is-plain-object"),AVe=require("@stdlib/object/assign"),GVe=require("@stdlib/string/format"),VVe=Uf();function FVe(r,e,t){var i;if(arguments.length>2){if(i=t,!xVe(i))throw new TypeError(GVe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=AVe({},t)}else i={};return i.objectMode=!0,new VVe(r,e,i)}fD.exports=FVe});var yD=s(function(otr,pD){"use strict";var lD=require("@stdlib/assert/is-plain-object"),cD=require("@stdlib/object/assign"),mD=require("@stdlib/string/format"),hD=Uf();function WVe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!lD(r))throw new TypeError(mD("invalid argument. Options argument must be an object. Value: `%s`.",r));n=cD({},r)}else if(i>2){if(!lD(t))throw new TypeError(mD("invalid argument. Options argument must be an object. Value: `%s`.",t));n=cD({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new hD(v,g,n)}function o(){return new hD(r,e,n)}}pD.exports=WVe});var wD=s(function(vtr,bD){"use strict";var qD=require("@stdlib/utils/define-nonenumerable-read-only-property"),Dm=Uf(),IVe=dD(),kVe=yD();qD(Dm,"objectMode",IVe);qD(Dm,"factory",kVe);bD.exports=Dm});var SD=s(function(gtr,zVe){zVe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var _D=s(function(ftr,ED){"use strict";var JVe=require("@stdlib/assert/is-plain-object"),mr=require("@stdlib/assert/has-own-property"),UVe=require("@stdlib/assert/is-boolean").isPrimitive,CVe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,OD=require("@stdlib/assert/is-string").isPrimitive,BVe=require("@stdlib/assert/is-positive-integer").isPrimitive,DVe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,zn=require("@stdlib/string/format");function XVe(r,e){return JVe(e)?mr(e,"sep")&&(r.sep=e.sep,!OD(r.sep))?new TypeError(zn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):mr(e,"objectMode")&&(r.objectMode=e.objectMode,!UVe(r.objectMode))?new TypeError(zn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):mr(e,"encoding")&&(r.encoding=e.encoding,!OD(r.encoding)&&r.encoding!==null)?new TypeError(zn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):mr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!CVe(r.highWaterMark))?new TypeError(zn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):mr(e,"iter")&&(r.iter=e.iter,!DVe(r.iter))?new TypeError(zn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):mr(e,"siter")&&(r.siter=e.siter,!BVe(r.siter))?new TypeError(zn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(mr(e,"prng")&&(r.prng=e.prng),mr(e,"seed")&&(r.seed=e.seed),mr(e,"state")&&(r.state=e.state),mr(e,"copy")&&(r.copy=e.copy),null):new TypeError(zn("invalid argument. Options argument must be an object. Value: `%s`.",e))}ED.exports=XVe});var LD=s(function(dtr,ND){"use strict";var YVe=require("debug"),HVe=YVe("random:streams:kumaraswamy");ND.exports=HVe});var Bf=s(function(ltr,xD){"use strict";var MD=require("readable-stream").Readable,RD=require("@stdlib/assert/is-positive-number").isPrimitive,ZVe=require("@stdlib/assert/is-error"),QVe=require("@stdlib/object/assign"),$Ve=require("@stdlib/utils/inherit"),PD=require("@stdlib/utils/define-nonenumerable-property"),Vi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Cf=require("@stdlib/utils/define-read-only-accessor"),KVe=require("@stdlib/utils/define-read-write-accessor"),e2e=Pa().factory,TD=require("@stdlib/buffer/from-string"),r2e=require("@stdlib/utils/next-tick"),jD=require("@stdlib/string/format"),t2e=SD(),i2e=_D(),ps=LD();function n2e(){return this._prng.seed}function a2e(){return this._prng.seedLength}function s2e(){return this._prng.stateLength}function u2e(){return this._prng.byteLength}function o2e(){return this._prng.state}function v2e(r){this._prng.state=r}function g2e(){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=TD(e):e=TD(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function f2e(r){var e;if(this._destroyed)return ps("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,r2e(t),this;function t(){r&&(ps("Stream was destroyed due to an error. Error: %s.",ZVe(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(!RD(r))throw new TypeError(jD("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!RD(e))throw new TypeError(jD("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=QVe({},t2e),arguments.length>2&&(n=i2e(i,t),n))throw n;return ps("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),MD.call(this,i),PD(this,"_destroyed",!1),Vi(this,"_objectMode",i.objectMode),Vi(this,"_sep",i.sep),Vi(this,"_iter",i.iter),Vi(this,"_siter",i.siter),PD(this,"_i",0),Vi(this,"_prng",e2e(r,e,i)),Vi(this,"PRNG",this._prng.PRNG),this}$Ve(Oe,MD);Cf(Oe.prototype,"seed",n2e);Cf(Oe.prototype,"seedLength",a2e);KVe(Oe.prototype,"state",o2e,v2e);Cf(Oe.prototype,"stateLength",s2e);Cf(Oe.prototype,"byteLength",u2e);Vi(Oe.prototype,"_read",g2e);Vi(Oe.prototype,"destroy",f2e);xD.exports=Oe});var GD=s(function(ctr,AD){"use strict";var d2e=require("@stdlib/assert/is-plain-object"),l2e=require("@stdlib/object/assign"),c2e=require("@stdlib/string/format"),m2e=Bf();function h2e(r,e,t){var i;if(arguments.length>2){if(i=t,!d2e(i))throw new TypeError(c2e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=l2e({},t)}else i={};return i.objectMode=!0,new m2e(r,e,i)}AD.exports=h2e});var zD=s(function(mtr,kD){"use strict";var VD=require("@stdlib/assert/is-plain-object"),FD=require("@stdlib/object/assign"),WD=require("@stdlib/string/format"),ID=Bf();function p2e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!VD(r))throw new TypeError(WD("invalid argument. Options argument must be an object. Value: `%s`.",r));n=FD({},r)}else if(i>2){if(!VD(t))throw new TypeError(WD("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 ID(v,g,n)}function o(){return new ID(r,e,n)}}kD.exports=p2e});var CD=s(function(htr,UD){"use strict";var JD=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xm=Bf(),y2e=GD(),q2e=zD();JD(Xm,"objectMode",y2e);JD(Xm,"factory",q2e);UD.exports=Xm});var BD=s(function(ptr,b2e){b2e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var YD=s(function(ytr,XD){"use strict";var w2e=require("@stdlib/assert/is-plain-object"),hr=require("@stdlib/assert/has-own-property"),S2e=require("@stdlib/assert/is-boolean").isPrimitive,O2e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,DD=require("@stdlib/assert/is-string").isPrimitive,E2e=require("@stdlib/assert/is-positive-integer").isPrimitive,_2e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Jn=require("@stdlib/string/format");function N2e(r,e){return w2e(e)?hr(e,"sep")&&(r.sep=e.sep,!DD(r.sep))?new TypeError(Jn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):hr(e,"objectMode")&&(r.objectMode=e.objectMode,!S2e(r.objectMode))?new TypeError(Jn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):hr(e,"encoding")&&(r.encoding=e.encoding,!DD(r.encoding)&&r.encoding!==null)?new TypeError(Jn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):hr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!O2e(r.highWaterMark))?new TypeError(Jn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):hr(e,"iter")&&(r.iter=e.iter,!_2e(r.iter))?new TypeError(Jn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):hr(e,"siter")&&(r.siter=e.siter,!E2e(r.siter))?new TypeError(Jn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(hr(e,"prng")&&(r.prng=e.prng),hr(e,"seed")&&(r.seed=e.seed),hr(e,"state")&&(r.state=e.state),hr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Jn("invalid argument. Options argument must be an object. Value: `%s`.",e))}XD.exports=N2e});var ZD=s(function(qtr,HD){"use strict";var L2e=require("debug"),R2e=L2e("random:streams:laplace");HD.exports=R2e});var Xf=s(function(btr,r8){"use strict";var e8=require("readable-stream").Readable,P2e=require("@stdlib/assert/is-positive-number").isPrimitive,T2e=require("@stdlib/assert/is-number").isPrimitive,j2e=require("@stdlib/math/base/assert/is-nan"),M2e=require("@stdlib/assert/is-error"),x2e=require("@stdlib/object/assign"),A2e=require("@stdlib/utils/inherit"),QD=require("@stdlib/utils/define-nonenumerable-property"),Fi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Df=require("@stdlib/utils/define-read-only-accessor"),G2e=require("@stdlib/utils/define-read-write-accessor"),V2e=Ta().factory,$D=require("@stdlib/buffer/from-string"),KD=require("@stdlib/string/format"),F2e=require("@stdlib/utils/next-tick"),W2e=BD(),I2e=YD(),ys=ZD();function k2e(){return this._prng.seed}function z2e(){return this._prng.seedLength}function J2e(){return this._prng.stateLength}function U2e(){return this._prng.byteLength}function C2e(){return this._prng.state}function B2e(r){this._prng.state=r}function D2e(){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=$D(e):e=$D(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,F2e(t),this;function t(){r&&(ys("Stream was destroyed due to an error. Error: %s.",M2e(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(!T2e(r)||j2e(r))throw new TypeError(KD("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!P2e(e))throw new TypeError(KD("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=x2e({},W2e),arguments.length>2&&(n=I2e(i,t),n))throw n;return ys("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),e8.call(this,i),QD(this,"_destroyed",!1),Fi(this,"_objectMode",i.objectMode),Fi(this,"_sep",i.sep),Fi(this,"_iter",i.iter),Fi(this,"_siter",i.siter),QD(this,"_i",0),Fi(this,"_prng",V2e(r,e,i)),Fi(this,"PRNG",this._prng.PRNG),this}A2e(Ee,e8);Df(Ee.prototype,"seed",k2e);Df(Ee.prototype,"seedLength",z2e);G2e(Ee.prototype,"state",C2e,B2e);Df(Ee.prototype,"stateLength",J2e);Df(Ee.prototype,"byteLength",U2e);Fi(Ee.prototype,"_read",D2e);Fi(Ee.prototype,"destroy",X2e);r8.exports=Ee});var i8=s(function(wtr,t8){"use strict";var Y2e=require("@stdlib/assert/is-plain-object"),H2e=require("@stdlib/object/assign"),Z2e=require("@stdlib/string/format"),Q2e=Xf();function $2e(r,e,t){var i;if(arguments.length>2){if(i=t,!Y2e(i))throw new TypeError(Z2e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=H2e({},t)}else i={};return i.objectMode=!0,new Q2e(r,e,i)}t8.exports=$2e});var v8=s(function(Str,o8){"use strict";var n8=require("@stdlib/assert/is-plain-object"),a8=require("@stdlib/object/assign"),s8=require("@stdlib/string/format"),u8=Xf();function K2e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!n8(r))throw new TypeError(s8("invalid argument. Options argument must be an object. Value: `%s`.",r));n=a8({},r)}else if(i>2){if(!n8(t))throw new TypeError(s8("invalid argument. Options argument must be an object. Value: `%s`.",t));n=a8({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new u8(v,g,n)}function o(){return new u8(r,e,n)}}o8.exports=K2e});var d8=s(function(Otr,f8){"use strict";var g8=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ym=Xf(),eFe=i8(),rFe=v8();g8(Ym,"objectMode",eFe);g8(Ym,"factory",rFe);f8.exports=Ym});var l8=s(function(Etr,tFe){tFe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var h8=s(function(_tr,m8){"use strict";var iFe=require("@stdlib/assert/is-plain-object"),pr=require("@stdlib/assert/has-own-property"),nFe=require("@stdlib/assert/is-boolean").isPrimitive,aFe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,c8=require("@stdlib/assert/is-string").isPrimitive,sFe=require("@stdlib/assert/is-positive-integer").isPrimitive,uFe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Un=require("@stdlib/string/format");function oFe(r,e){return iFe(e)?pr(e,"sep")&&(r.sep=e.sep,!c8(r.sep))?new TypeError(Un("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):pr(e,"objectMode")&&(r.objectMode=e.objectMode,!nFe(r.objectMode))?new TypeError(Un("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):pr(e,"encoding")&&(r.encoding=e.encoding,!c8(r.encoding)&&r.encoding!==null)?new TypeError(Un("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):pr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!aFe(r.highWaterMark))?new TypeError(Un("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):pr(e,"iter")&&(r.iter=e.iter,!uFe(r.iter))?new TypeError(Un("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):pr(e,"siter")&&(r.siter=e.siter,!sFe(r.siter))?new TypeError(Un("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(pr(e,"prng")&&(r.prng=e.prng),pr(e,"seed")&&(r.seed=e.seed),pr(e,"state")&&(r.state=e.state),pr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Un("invalid argument. Options argument must be an object. Value: `%s`.",e))}m8.exports=oFe});var y8=s(function(Ntr,p8){"use strict";var vFe=require("debug"),gFe=vFe("random:streams:levy");p8.exports=gFe});var Hf=s(function(Ltr,O8){"use strict";var S8=require("readable-stream").Readable,fFe=require("@stdlib/assert/is-positive-number").isPrimitive,dFe=require("@stdlib/assert/is-number").isPrimitive,lFe=require("@stdlib/math/base/assert/is-nan"),cFe=require("@stdlib/assert/is-error"),mFe=require("@stdlib/object/assign"),hFe=require("@stdlib/utils/inherit"),q8=require("@stdlib/utils/define-nonenumerable-property"),Wi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Yf=require("@stdlib/utils/define-read-only-accessor"),pFe=require("@stdlib/utils/define-read-write-accessor"),yFe=ja().factory,b8=require("@stdlib/buffer/from-string"),qFe=require("@stdlib/utils/next-tick"),w8=require("@stdlib/string/format"),bFe=l8(),wFe=h8(),qs=y8();function SFe(){return this._prng.seed}function OFe(){return this._prng.seedLength}function EFe(){return this._prng.stateLength}function _Fe(){return this._prng.byteLength}function NFe(){return this._prng.state}function LFe(r){this._prng.state=r}function RFe(){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=b8(e):e=b8(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function PFe(r){var e;if(this._destroyed)return qs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,qFe(t),this;function t(){r&&(qs("Stream was destroyed due to an error. Error: %s.",cFe(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(!dFe(r)||lFe(r))throw new TypeError(w8("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!fFe(e))throw new TypeError(w8("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=mFe({},bFe),arguments.length>2&&(n=wFe(i,t),n))throw n;return qs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),S8.call(this,i),q8(this,"_destroyed",!1),Wi(this,"_objectMode",i.objectMode),Wi(this,"_sep",i.sep),Wi(this,"_iter",i.iter),Wi(this,"_siter",i.siter),q8(this,"_i",0),Wi(this,"_prng",yFe(r,e,i)),Wi(this,"PRNG",this._prng.PRNG),this}hFe(_e,S8);Yf(_e.prototype,"seed",SFe);Yf(_e.prototype,"seedLength",OFe);pFe(_e.prototype,"state",NFe,LFe);Yf(_e.prototype,"stateLength",EFe);Yf(_e.prototype,"byteLength",_Fe);Wi(_e.prototype,"_read",RFe);Wi(_e.prototype,"destroy",PFe);O8.exports=_e});var _8=s(function(Rtr,E8){"use strict";var TFe=require("@stdlib/assert/is-plain-object"),jFe=require("@stdlib/object/assign"),MFe=require("@stdlib/string/format"),xFe=Hf();function AFe(r,e,t){var i;if(arguments.length>2){if(i=t,!TFe(i))throw new TypeError(MFe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=jFe({},t)}else i={};return i.objectMode=!0,new xFe(r,e,i)}E8.exports=AFe});var j8=s(function(Ptr,T8){"use strict";var N8=require("@stdlib/assert/is-plain-object"),L8=require("@stdlib/object/assign"),R8=require("@stdlib/string/format"),P8=Hf();function GFe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!N8(r))throw new TypeError(R8("invalid argument. Options argument must be an object. Value: `%s`.",r));n=L8({},r)}else if(i>2){if(!N8(t))throw new TypeError(R8("invalid argument. Options argument must be an object. Value: `%s`.",t));n=L8({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new P8(v,g,n)}function o(){return new P8(r,e,n)}}T8.exports=GFe});var A8=s(function(Ttr,x8){"use strict";var M8=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hm=Hf(),VFe=_8(),FFe=j8();M8(Hm,"objectMode",VFe);M8(Hm,"factory",FFe);x8.exports=Hm});var G8=s(function(jtr,WFe){WFe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var W8=s(function(Mtr,F8){"use strict";var IFe=require("@stdlib/assert/is-plain-object"),yr=require("@stdlib/assert/has-own-property"),kFe=require("@stdlib/assert/is-boolean").isPrimitive,zFe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,V8=require("@stdlib/assert/is-string").isPrimitive,JFe=require("@stdlib/assert/is-positive-integer").isPrimitive,UFe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Cn=require("@stdlib/string/format");function CFe(r,e){return IFe(e)?yr(e,"sep")&&(r.sep=e.sep,!V8(r.sep))?new TypeError(Cn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):yr(e,"objectMode")&&(r.objectMode=e.objectMode,!kFe(r.objectMode))?new TypeError(Cn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):yr(e,"encoding")&&(r.encoding=e.encoding,!V8(r.encoding)&&r.encoding!==null)?new TypeError(Cn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):yr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!zFe(r.highWaterMark))?new TypeError(Cn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):yr(e,"iter")&&(r.iter=e.iter,!UFe(r.iter))?new TypeError(Cn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):yr(e,"siter")&&(r.siter=e.siter,!JFe(r.siter))?new TypeError(Cn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(yr(e,"prng")&&(r.prng=e.prng),yr(e,"seed")&&(r.seed=e.seed),yr(e,"state")&&(r.state=e.state),yr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Cn("invalid argument. Options argument must be an object. Value: `%s`.",e))}F8.exports=CFe});var k8=s(function(xtr,I8){"use strict";var BFe=require("debug"),DFe=BFe("random:streams:logistic");I8.exports=DFe});var Qf=s(function(Atr,B8){"use strict";var C8=require("readable-stream").Readable,XFe=require("@stdlib/assert/is-positive-number").isPrimitive,YFe=require("@stdlib/assert/is-number").isPrimitive,HFe=require("@stdlib/math/base/assert/is-nan"),ZFe=require("@stdlib/assert/is-error"),QFe=require("@stdlib/object/assign"),$Fe=require("@stdlib/utils/inherit"),z8=require("@stdlib/utils/define-nonenumerable-property"),Ii=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zf=require("@stdlib/utils/define-read-only-accessor"),KFe=require("@stdlib/utils/define-read-write-accessor"),eWe=Ma().factory,J8=require("@stdlib/buffer/from-string"),rWe=require("@stdlib/utils/next-tick"),U8=require("@stdlib/string/format"),tWe=G8(),iWe=W8(),bs=k8();function nWe(){return this._prng.seed}function aWe(){return this._prng.seedLength}function sWe(){return this._prng.stateLength}function uWe(){return this._prng.byteLength}function oWe(){return this._prng.state}function vWe(r){this._prng.state=r}function gWe(){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=J8(e):e=J8(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function fWe(r){var e;if(this._destroyed)return bs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,rWe(t),this;function t(){r&&(bs("Stream was destroyed due to an error. Error: %s.",ZFe(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(!YFe(r)||HFe(r))throw new TypeError(U8("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!XFe(e))throw new TypeError(U8("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=QFe({},tWe),arguments.length>2&&(n=iWe(i,t),n))throw n;return bs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),C8.call(this,i),z8(this,"_destroyed",!1),Ii(this,"_objectMode",i.objectMode),Ii(this,"_sep",i.sep),Ii(this,"_iter",i.iter),Ii(this,"_siter",i.siter),z8(this,"_i",0),Ii(this,"_prng",eWe(r,e,i)),Ii(this,"PRNG",this._prng.PRNG),this}$Fe(Ne,C8);Zf(Ne.prototype,"seed",nWe);Zf(Ne.prototype,"seedLength",aWe);KFe(Ne.prototype,"state",oWe,vWe);Zf(Ne.prototype,"stateLength",sWe);Zf(Ne.prototype,"byteLength",uWe);Ii(Ne.prototype,"_read",gWe);Ii(Ne.prototype,"destroy",fWe);B8.exports=Ne});var X8=s(function(Gtr,D8){"use strict";var dWe=require("@stdlib/assert/is-plain-object"),lWe=require("@stdlib/object/assign"),cWe=require("@stdlib/string/format"),mWe=Qf();function hWe(r,e,t){var i;if(arguments.length>2){if(i=t,!dWe(i))throw new TypeError(cWe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=lWe({},t)}else i={};return i.objectMode=!0,new mWe(r,e,i)}D8.exports=hWe});var K8=s(function(Vtr,$8){"use strict";var Y8=require("@stdlib/assert/is-plain-object"),H8=require("@stdlib/object/assign"),Z8=require("@stdlib/string/format"),Q8=Qf();function pWe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!Y8(r))throw new TypeError(Z8("invalid argument. Options argument must be an object. Value: `%s`.",r));n=H8({},r)}else if(i>2){if(!Y8(t))throw new TypeError(Z8("invalid argument. Options argument must be an object. Value: `%s`.",t));n=H8({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new Q8(v,g,n)}function o(){return new Q8(r,e,n)}}$8.exports=pWe});var tX=s(function(Ftr,rX){"use strict";var eX=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zm=Qf(),yWe=X8(),qWe=K8();eX(Zm,"objectMode",yWe);eX(Zm,"factory",qWe);rX.exports=Zm});var iX=s(function(Wtr,bWe){bWe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var sX=s(function(Itr,aX){"use strict";var wWe=require("@stdlib/assert/is-plain-object"),qr=require("@stdlib/assert/has-own-property"),SWe=require("@stdlib/assert/is-boolean").isPrimitive,OWe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,nX=require("@stdlib/assert/is-string").isPrimitive,EWe=require("@stdlib/assert/is-positive-integer").isPrimitive,_We=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Bn=require("@stdlib/string/format");function NWe(r,e){return wWe(e)?qr(e,"sep")&&(r.sep=e.sep,!nX(r.sep))?new TypeError(Bn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):qr(e,"objectMode")&&(r.objectMode=e.objectMode,!SWe(r.objectMode))?new TypeError(Bn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):qr(e,"encoding")&&(r.encoding=e.encoding,!nX(r.encoding)&&r.encoding!==null)?new TypeError(Bn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):qr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!OWe(r.highWaterMark))?new TypeError(Bn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):qr(e,"iter")&&(r.iter=e.iter,!_We(r.iter))?new TypeError(Bn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):qr(e,"siter")&&(r.siter=e.siter,!EWe(r.siter))?new TypeError(Bn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(qr(e,"prng")&&(r.prng=e.prng),qr(e,"seed")&&(r.seed=e.seed),qr(e,"state")&&(r.state=e.state),qr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Bn("invalid argument. Options argument must be an object. Value: `%s`.",e))}aX.exports=NWe});var oX=s(function(ktr,uX){"use strict";var LWe=require("debug"),RWe=LWe("random:streams:lognormal");uX.exports=RWe});var Kf=s(function(ztr,lX){"use strict";var dX=require("readable-stream").Readable,PWe=require("@stdlib/assert/is-positive-number").isPrimitive,TWe=require("@stdlib/assert/is-number").isPrimitive,jWe=require("@stdlib/math/base/assert/is-nan"),MWe=require("@stdlib/assert/is-error"),xWe=require("@stdlib/object/assign"),AWe=require("@stdlib/utils/inherit"),vX=require("@stdlib/utils/define-nonenumerable-property"),ki=require("@stdlib/utils/define-nonenumerable-read-only-property"),$f=require("@stdlib/utils/define-read-only-accessor"),GWe=require("@stdlib/utils/define-read-write-accessor"),VWe=cn().factory,gX=require("@stdlib/buffer/from-string"),FWe=require("@stdlib/utils/next-tick"),fX=require("@stdlib/string/format"),WWe=iX(),IWe=sX(),ws=oX();function kWe(){return this._prng.seed}function zWe(){return this._prng.seedLength}function JWe(){return this._prng.stateLength}function UWe(){return this._prng.byteLength}function CWe(){return this._prng.state}function BWe(r){this._prng.state=r}function DWe(){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=gX(e):e=gX(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,FWe(t),this;function t(){r&&(ws("Stream was destroyed due to an error. Error: %s.",MWe(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(!TWe(r)||jWe(r))throw new TypeError(fX("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!PWe(e))throw new TypeError(fX("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=xWe({},WWe),arguments.length>2&&(n=IWe(i,t),n))throw n;return ws("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),dX.call(this,i),vX(this,"_destroyed",!1),ki(this,"_objectMode",i.objectMode),ki(this,"_sep",i.sep),ki(this,"_iter",i.iter),ki(this,"_siter",i.siter),vX(this,"_i",0),ki(this,"_prng",VWe(r,e,i)),ki(this,"PRNG",this._prng.PRNG),this}AWe(Le,dX);$f(Le.prototype,"seed",kWe);$f(Le.prototype,"seedLength",zWe);GWe(Le.prototype,"state",CWe,BWe);$f(Le.prototype,"stateLength",JWe);$f(Le.prototype,"byteLength",UWe);ki(Le.prototype,"_read",DWe);ki(Le.prototype,"destroy",XWe);lX.exports=Le});var mX=s(function(Jtr,cX){"use strict";var YWe=require("@stdlib/assert/is-plain-object"),HWe=require("@stdlib/object/assign"),ZWe=require("@stdlib/string/format"),QWe=Kf();function $We(r,e,t){var i;if(arguments.length>2){if(i=t,!YWe(i))throw new TypeError(ZWe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=HWe({},t)}else i={};return i.objectMode=!0,new QWe(r,e,i)}cX.exports=$We});var wX=s(function(Utr,bX){"use strict";var hX=require("@stdlib/assert/is-plain-object"),pX=require("@stdlib/object/assign"),yX=require("@stdlib/string/format"),qX=Kf();function KWe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!hX(r))throw new TypeError(yX("invalid argument. Options argument must be an object. Value: `%s`.",r));n=pX({},r)}else if(i>2){if(!hX(t))throw new TypeError(yX("invalid argument. Options argument must be an object. Value: `%s`.",t));n=pX({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new qX(v,g,n)}function o(){return new qX(r,e,n)}}bX.exports=KWe});var EX=s(function(Ctr,OX){"use strict";var SX=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qm=Kf(),eIe=mX(),rIe=wX();SX(Qm,"objectMode",eIe);SX(Qm,"factory",rIe);OX.exports=Qm});var _X=s(function(Btr,tIe){tIe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,normalized:!1}});var PX=s(function(Dtr,RX){"use strict";var iIe=require("@stdlib/assert/is-plain-object"),br=require("@stdlib/assert/has-own-property"),NX=require("@stdlib/assert/is-boolean").isPrimitive,nIe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,LX=require("@stdlib/assert/is-string").isPrimitive,aIe=require("@stdlib/assert/is-positive-integer").isPrimitive,sIe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,zi=require("@stdlib/string/format");function uIe(r,e){return iIe(e)?br(e,"sep")&&(r.sep=e.sep,!LX(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,!NX(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,!LX(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,!nIe(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,!sIe(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,!aIe(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,!NX(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))}RX.exports=uIe});var jX=s(function(Xtr,TX){"use strict";var oIe=require("debug"),vIe=oIe("random:streams:minstd");TX.exports=vIe});var rd=s(function(Ytr,GX){"use strict";var AX=require("readable-stream").Readable,gIe=require("@stdlib/assert/is-error"),fIe=require("@stdlib/object/assign"),dIe=require("@stdlib/utils/inherit"),MX=require("@stdlib/utils/define-nonenumerable-property"),Dn=require("@stdlib/utils/define-nonenumerable-read-only-property"),ed=require("@stdlib/utils/define-read-only-accessor"),lIe=require("@stdlib/utils/define-read-write-accessor"),cIe=$().factory,xX=require("@stdlib/buffer/from-string"),mIe=require("@stdlib/utils/next-tick"),hIe=_X(),pIe=PX(),Ss=jX();function yIe(){return this._prng.seed}function qIe(){return this._prng.seedLength}function bIe(){return this._prng.stateLength}function wIe(){return this._prng.byteLength}function SIe(){return this._prng.state}function OIe(r){this._prng.state=r}function EIe(){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=xX(e):e=xX(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function _Ie(r){var e;if(this._destroyed)return Ss("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,mIe(t),this;function t(){r&&(Ss("Stream was destroyed due to an error. Error: %s.",gIe(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=fIe({},hIe),arguments.length>0&&(i=pIe(t,r),i))throw i;return Ss("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),AX.call(this,t),MX(this,"_destroyed",!1),Dn(this,"_objectMode",t.objectMode),Dn(this,"_sep",t.sep),Dn(this,"_iter",t.iter),Dn(this,"_siter",t.siter),MX(this,"_i",0),e=cIe(t),t.normalized&&(e=e.normalized),Dn(this,"_prng",e),this}dIe(Re,AX);ed(Re.prototype,"seed",yIe);ed(Re.prototype,"seedLength",qIe);lIe(Re.prototype,"state",SIe,OIe);ed(Re.prototype,"stateLength",bIe);ed(Re.prototype,"byteLength",wIe);Dn(Re.prototype,"_read",EIe);Dn(Re.prototype,"destroy",_Ie);GX.exports=Re});var FX=s(function(Htr,VX){"use strict";var NIe=require("@stdlib/assert/is-plain-object"),LIe=require("@stdlib/object/assign"),RIe=require("@stdlib/string/format"),PIe=rd();function TIe(r){var e;if(arguments.length>0){if(e=r,!NIe(e))throw new TypeError(RIe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=LIe({},r)}else e={};return e.objectMode=!0,new PIe(e)}VX.exports=TIe});var IX=s(function(Ztr,WX){"use strict";var jIe=require("@stdlib/assert/is-plain-object"),MIe=require("@stdlib/object/assign"),xIe=require("@stdlib/string/format"),AIe=rd();function GIe(r){var e;if(arguments.length>0){if(!jIe(r))throw new TypeError(xIe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=MIe({},r)}else e={};return t;function t(){return new AIe(e)}}WX.exports=GIe});var JX=s(function(Qtr,zX){"use strict";var kX=require("@stdlib/utils/define-nonenumerable-read-only-property"),$m=rd(),VIe=FX(),FIe=IX();kX($m,"objectMode",VIe);kX($m,"factory",FIe);zX.exports=$m});var UX=s(function($tr,WIe){WIe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,normalized:!1}});var XX=s(function(Ktr,DX){"use strict";var IIe=require("@stdlib/assert/is-plain-object"),wr=require("@stdlib/assert/has-own-property"),CX=require("@stdlib/assert/is-boolean").isPrimitive,kIe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,BX=require("@stdlib/assert/is-string").isPrimitive,zIe=require("@stdlib/assert/is-positive-integer").isPrimitive,JIe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ji=require("@stdlib/string/format");function UIe(r,e){return IIe(e)?wr(e,"sep")&&(r.sep=e.sep,!BX(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,!CX(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,!BX(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,!kIe(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,!JIe(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,!zIe(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,!CX(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))}DX.exports=UIe});var HX=s(function(eir,YX){"use strict";var CIe=require("debug"),BIe=CIe("random:streams:minstd-shuffle");YX.exports=BIe});var id=s(function(rir,KX){"use strict";var $X=require("readable-stream").Readable,DIe=require("@stdlib/assert/is-error"),XIe=require("@stdlib/object/assign"),YIe=require("@stdlib/utils/inherit"),ZX=require("@stdlib/utils/define-nonenumerable-property"),Xn=require("@stdlib/utils/define-nonenumerable-read-only-property"),td=require("@stdlib/utils/define-read-only-accessor"),HIe=require("@stdlib/utils/define-read-write-accessor"),ZIe=ee().factory,QX=require("@stdlib/buffer/from-string"),QIe=require("@stdlib/utils/next-tick"),$Ie=UX(),KIe=XX(),Os=HX();function eke(){return this._prng.seed}function rke(){return this._prng.seedLength}function tke(){return this._prng.stateLength}function ike(){return this._prng.byteLength}function nke(){return this._prng.state}function ake(r){this._prng.state=r}function ske(){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=QX(e):e=QX(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function uke(r){var e;if(this._destroyed)return Os("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,QIe(t),this;function t(){r&&(Os("Stream was destroyed due to an error. Error: %s.",DIe(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({},$Ie),arguments.length>0&&(i=KIe(t,r),i))throw i;return Os("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),$X.call(this,t),ZX(this,"_destroyed",!1),Xn(this,"_objectMode",t.objectMode),Xn(this,"_sep",t.sep),Xn(this,"_iter",t.iter),Xn(this,"_siter",t.siter),ZX(this,"_i",0),e=ZIe(t),t.normalized&&(e=e.normalized),Xn(this,"_prng",e),this}YIe(Pe,$X);td(Pe.prototype,"seed",eke);td(Pe.prototype,"seedLength",rke);HIe(Pe.prototype,"state",nke,ake);td(Pe.prototype,"stateLength",tke);td(Pe.prototype,"byteLength",ike);Xn(Pe.prototype,"_read",ske);Xn(Pe.prototype,"destroy",uke);KX.exports=Pe});var r7=s(function(tir,e7){"use strict";var oke=require("@stdlib/assert/is-plain-object"),vke=require("@stdlib/object/assign"),gke=require("@stdlib/string/format"),fke=id();function dke(r){var e;if(arguments.length>0){if(e=r,!oke(e))throw new TypeError(gke("invalid argument. Options argument must be an object. Value: `%s`.",e));e=vke({},r)}else e={};return e.objectMode=!0,new fke(e)}e7.exports=dke});var i7=s(function(iir,t7){"use strict";var lke=require("@stdlib/assert/is-plain-object"),cke=require("@stdlib/object/assign"),mke=require("@stdlib/string/format"),hke=id();function pke(r){var e;if(arguments.length>0){if(!lke(r))throw new TypeError(mke("invalid argument. Options argument must be an object. Value: `%s`.",r));e=cke({},r)}else e={};return t;function t(){return new hke(e)}}t7.exports=pke});var s7=s(function(nir,a7){"use strict";var n7=require("@stdlib/utils/define-nonenumerable-read-only-property"),Km=id(),yke=r7(),qke=i7();n7(Km,"objectMode",yke);n7(Km,"factory",qke);a7.exports=Km});var u7=s(function(air,bke){bke.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,normalized:!1}});var f7=s(function(sir,g7){"use strict";var wke=require("@stdlib/assert/is-plain-object"),Sr=require("@stdlib/assert/has-own-property"),o7=require("@stdlib/assert/is-boolean").isPrimitive,Ske=require("@stdlib/assert/is-nonnegative-number").isPrimitive,v7=require("@stdlib/assert/is-string").isPrimitive,Oke=require("@stdlib/assert/is-positive-integer").isPrimitive,Eke=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ui=require("@stdlib/string/format");function _ke(r,e){return wke(e)?Sr(e,"sep")&&(r.sep=e.sep,!v7(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,!o7(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,!v7(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,!Ske(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,!Eke(r.iter))?new TypeError(Ui("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Sr(e,"siter")&&(r.siter=e.siter,!Oke(r.siter))?new TypeError(Ui("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):Sr(e,"normalized")&&(r.normalized=e.normalized,!o7(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))}g7.exports=_ke});var l7=s(function(uir,d7){"use strict";var Nke=require("debug"),Lke=Nke("random:streams:mt19937");d7.exports=Lke});var ad=s(function(oir,p7){"use strict";var h7=require("readable-stream").Readable,Rke=require("@stdlib/assert/is-error"),Pke=require("@stdlib/object/assign"),Tke=require("@stdlib/utils/inherit"),c7=require("@stdlib/utils/define-nonenumerable-property"),Yn=require("@stdlib/utils/define-nonenumerable-read-only-property"),nd=require("@stdlib/utils/define-read-only-accessor"),jke=require("@stdlib/utils/define-read-write-accessor"),Mke=T().factory,m7=require("@stdlib/buffer/from-string"),xke=require("@stdlib/utils/next-tick"),Ake=u7(),Gke=f7(),Es=l7();function Vke(){return this._prng.seed}function Fke(){return this._prng.seedLength}function Wke(){return this._prng.stateLength}function Ike(){return this._prng.byteLength}function kke(){return this._prng.state}function zke(r){this._prng.state=r}function Jke(){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=m7(e):e=m7(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Uke(r){var e;if(this._destroyed)return Es("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,xke(t),this;function t(){r&&(Es("Stream was destroyed due to an error. Error: %s.",Rke(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=Pke({},Ake),arguments.length>0&&(i=Gke(t,r),i))throw i;return Es("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),h7.call(this,t),c7(this,"_destroyed",!1),Yn(this,"_objectMode",t.objectMode),Yn(this,"_sep",t.sep),Yn(this,"_iter",t.iter),Yn(this,"_siter",t.siter),c7(this,"_i",0),e=Mke(t),t.normalized&&(e=e.normalized),Yn(this,"_prng",e),this}Tke(Te,h7);nd(Te.prototype,"seed",Vke);nd(Te.prototype,"seedLength",Fke);jke(Te.prototype,"state",kke,zke);nd(Te.prototype,"stateLength",Wke);nd(Te.prototype,"byteLength",Ike);Yn(Te.prototype,"_read",Jke);Yn(Te.prototype,"destroy",Uke);p7.exports=Te});var q7=s(function(vir,y7){"use strict";var Cke=require("@stdlib/assert/is-plain-object"),Bke=require("@stdlib/object/assign"),Dke=require("@stdlib/string/format"),Xke=ad();function Yke(r){var e;if(arguments.length>0){if(e=r,!Cke(e))throw new TypeError(Dke("invalid argument. Options argument must be an object. Value: `%s`.",e));e=Bke({},r)}else e={};return e.objectMode=!0,new Xke(e)}y7.exports=Yke});var w7=s(function(gir,b7){"use strict";var Hke=require("@stdlib/assert/is-plain-object"),Zke=require("@stdlib/object/assign"),Qke=require("@stdlib/string/format"),$ke=ad();function Kke(r){var e;if(arguments.length>0){if(!Hke(r))throw new TypeError(Qke("invalid argument. Options argument must be an object. Value: `%s`.",r));e=Zke({},r)}else e={};return t;function t(){return new $ke(e)}}b7.exports=Kke});var E7=s(function(fir,O7){"use strict";var S7=require("@stdlib/utils/define-nonenumerable-read-only-property"),eh=ad(),eze=q7(),rze=w7();S7(eh,"objectMode",eze);S7(eh,"factory",rze);O7.exports=eh});var _7=s(function(dir,tze){tze.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var R7=s(function(lir,L7){"use strict";var ize=require("@stdlib/assert/is-plain-object"),Or=require("@stdlib/assert/has-own-property"),nze=require("@stdlib/assert/is-boolean").isPrimitive,aze=require("@stdlib/assert/is-nonnegative-number").isPrimitive,N7=require("@stdlib/assert/is-string").isPrimitive,sze=require("@stdlib/assert/is-positive-integer").isPrimitive,uze=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Hn=require("@stdlib/string/format");function oze(r,e){return ize(e)?Or(e,"sep")&&(r.sep=e.sep,!N7(r.sep))?new TypeError(Hn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Or(e,"objectMode")&&(r.objectMode=e.objectMode,!nze(r.objectMode))?new TypeError(Hn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Or(e,"encoding")&&(r.encoding=e.encoding,!N7(r.encoding)&&r.encoding!==null)?new TypeError(Hn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Or(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!aze(r.highWaterMark))?new TypeError(Hn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Or(e,"iter")&&(r.iter=e.iter,!uze(r.iter))?new TypeError(Hn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Or(e,"siter")&&(r.siter=e.siter,!sze(r.siter))?new TypeError(Hn("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(Hn("invalid argument. Options argument must be an object. Value: `%s`.",e))}L7.exports=oze});var T7=s(function(cir,P7){"use strict";var vze=require("debug"),gze=vze("random:streams:negative-binomial");P7.exports=gze});var ud=s(function(mir,G7){"use strict";var A7=require("readable-stream").Readable,fze=require("@stdlib/assert/is-positive-number").isPrimitive,dze=require("@stdlib/assert/is-probability").isPrimitive,lze=require("@stdlib/assert/is-error"),cze=require("@stdlib/object/assign"),mze=require("@stdlib/utils/inherit"),j7=require("@stdlib/utils/define-nonenumerable-property"),Ci=require("@stdlib/utils/define-nonenumerable-read-only-property"),sd=require("@stdlib/utils/define-read-only-accessor"),hze=require("@stdlib/utils/define-read-write-accessor"),pze=Ia().factory,M7=require("@stdlib/buffer/from-string"),yze=require("@stdlib/utils/next-tick"),x7=require("@stdlib/string/format"),qze=_7(),bze=R7(),_s=T7();function wze(){return this._prng.seed}function Sze(){return this._prng.seedLength}function Oze(){return this._prng.stateLength}function Eze(){return this._prng.byteLength}function _ze(){return this._prng.state}function Nze(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=M7(e):e=M7(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Rze(r){var e;if(this._destroyed)return _s("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,yze(t),this;function t(){r&&(_s("Stream was destroyed due to an error. Error: %s.",lze(r)?r.message:JSON.stringify(r)),e.emit("error",r)),_s("Closing the stream..."),e.emit("close")}}function je(r,e,t){var i,n;if(!(this instanceof je))return arguments.length>2?new je(r,e,t):new je(r,e);if(!fze(r))throw new TypeError(x7("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!dze(e))throw new TypeError(x7("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(i=cze({},qze),arguments.length>2&&(n=bze(i,t),n))throw n;return _s("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),A7.call(this,i),j7(this,"_destroyed",!1),Ci(this,"_objectMode",i.objectMode),Ci(this,"_sep",i.sep),Ci(this,"_iter",i.iter),Ci(this,"_siter",i.siter),j7(this,"_i",0),Ci(this,"_prng",pze(r,e,i)),Ci(this,"PRNG",this._prng.PRNG),this}mze(je,A7);sd(je.prototype,"seed",wze);sd(je.prototype,"seedLength",Sze);hze(je.prototype,"state",_ze,Nze);sd(je.prototype,"stateLength",Oze);sd(je.prototype,"byteLength",Eze);Ci(je.prototype,"_read",Lze);Ci(je.prototype,"destroy",Rze);G7.exports=je});var F7=s(function(hir,V7){"use strict";var Pze=require("@stdlib/assert/is-plain-object"),Tze=require("@stdlib/object/assign"),jze=require("@stdlib/string/format"),Mze=ud();function xze(r,e,t){var i;if(arguments.length>2){if(i=t,!Pze(i))throw new TypeError(jze("invalid argument. Options argument must be an object. Value: `%s`.",i));i=Tze({},t)}else i={};return i.objectMode=!0,new Mze(r,e,i)}V7.exports=xze});var U7=s(function(pir,J7){"use strict";var W7=require("@stdlib/assert/is-plain-object"),I7=require("@stdlib/object/assign"),k7=require("@stdlib/string/format"),z7=ud();function Aze(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!W7(r))throw new TypeError(k7("invalid argument. Options argument must be an object. Value: `%s`.",r));n=I7({},r)}else if(i>2){if(!W7(t))throw new TypeError(k7("invalid argument. Options argument must be an object. Value: `%s`.",t));n=I7({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new z7(v,g,n)}function o(){return new z7(r,e,n)}}J7.exports=Aze});var D7=s(function(yir,B7){"use strict";var C7=require("@stdlib/utils/define-nonenumerable-read-only-property"),rh=ud(),Gze=F7(),Vze=U7();C7(rh,"objectMode",Gze);C7(rh,"factory",Vze);B7.exports=rh});var X7=s(function(qir,Fze){Fze.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var Z7=s(function(bir,H7){"use strict";var Wze=require("@stdlib/assert/is-plain-object"),Er=require("@stdlib/assert/has-own-property"),Ize=require("@stdlib/assert/is-boolean").isPrimitive,kze=require("@stdlib/assert/is-nonnegative-number").isPrimitive,Y7=require("@stdlib/assert/is-string").isPrimitive,zze=require("@stdlib/assert/is-positive-integer").isPrimitive,Jze=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Zn=require("@stdlib/string/format");function Uze(r,e){return Wze(e)?Er(e,"sep")&&(r.sep=e.sep,!Y7(r.sep))?new TypeError(Zn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Er(e,"objectMode")&&(r.objectMode=e.objectMode,!Ize(r.objectMode))?new TypeError(Zn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Er(e,"encoding")&&(r.encoding=e.encoding,!Y7(r.encoding)&&r.encoding!==null)?new TypeError(Zn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Er(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!kze(r.highWaterMark))?new TypeError(Zn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Er(e,"iter")&&(r.iter=e.iter,!Jze(r.iter))?new TypeError(Zn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Er(e,"siter")&&(r.siter=e.siter,!zze(r.siter))?new TypeError(Zn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Er(e,"prng")&&(r.prng=e.prng),Er(e,"seed")&&(r.seed=e.seed),Er(e,"state")&&(r.state=e.state),Er(e,"copy")&&(r.copy=e.copy),null):new TypeError(Zn("invalid argument. Options argument must be an object. Value: `%s`.",e))}H7.exports=Uze});var $7=s(function(wir,Q7){"use strict";var Cze=require("debug"),Bze=Cze("random:streams:normal");Q7.exports=Bze});var vd=s(function(Sir,i5){"use strict";var t5=require("readable-stream").Readable,Dze=require("@stdlib/assert/is-positive-number").isPrimitive,Xze=require("@stdlib/assert/is-number").isPrimitive,Yze=require("@stdlib/math/base/assert/is-nan"),Hze=require("@stdlib/assert/is-error"),Zze=require("@stdlib/object/assign"),Qze=require("@stdlib/utils/inherit"),K7=require("@stdlib/utils/define-nonenumerable-property"),Bi=require("@stdlib/utils/define-nonenumerable-read-only-property"),od=require("@stdlib/utils/define-read-only-accessor"),$ze=require("@stdlib/utils/define-read-write-accessor"),Kze=hn().factory,e5=require("@stdlib/buffer/from-string"),e3e=require("@stdlib/utils/next-tick"),r5=require("@stdlib/string/format"),r3e=X7(),t3e=Z7(),Ns=$7();function i3e(){return this._prng.seed}function n3e(){return this._prng.seedLength}function a3e(){return this._prng.stateLength}function s3e(){return this._prng.byteLength}function u3e(){return this._prng.state}function o3e(r){this._prng.state=r}function v3e(){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=e5(e):e=e5(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function g3e(r){var e;if(this._destroyed)return Ns("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,e3e(t),this;function t(){r&&(Ns("Stream was destroyed due to an error. Error: %s.",Hze(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)||Yze(r))throw new TypeError(r5("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Dze(e))throw new TypeError(r5("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=Zze({},r3e),arguments.length>2&&(n=t3e(i,t),n))throw n;return Ns("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),t5.call(this,i),K7(this,"_destroyed",!1),Bi(this,"_objectMode",i.objectMode),Bi(this,"_sep",i.sep),Bi(this,"_iter",i.iter),Bi(this,"_siter",i.siter),K7(this,"_i",0),Bi(this,"_prng",Kze(r,e,i)),Bi(this,"PRNG",this._prng.PRNG),this}Qze(Me,t5);od(Me.prototype,"seed",i3e);od(Me.prototype,"seedLength",n3e);$ze(Me.prototype,"state",u3e,o3e);od(Me.prototype,"stateLength",a3e);od(Me.prototype,"byteLength",s3e);Bi(Me.prototype,"_read",v3e);Bi(Me.prototype,"destroy",g3e);i5.exports=Me});var a5=s(function(Oir,n5){"use strict";var f3e=require("@stdlib/assert/is-plain-object"),d3e=require("@stdlib/object/assign"),l3e=require("@stdlib/string/format"),c3e=vd();function m3e(r,e,t){var i;if(arguments.length>2){if(i=t,!f3e(i))throw new TypeError(l3e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=d3e({},t)}else i={};return i.objectMode=!0,new c3e(r,e,i)}n5.exports=m3e});var f5=s(function(Eir,g5){"use strict";var s5=require("@stdlib/assert/is-plain-object"),u5=require("@stdlib/object/assign"),o5=require("@stdlib/string/format"),v5=vd();function h3e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!s5(r))throw new TypeError(o5("invalid argument. Options argument must be an object. Value: `%s`.",r));n=u5({},r)}else if(i>2){if(!s5(t))throw new TypeError(o5("invalid argument. Options argument must be an object. Value: `%s`.",t));n=u5({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new v5(v,g,n)}function o(){return new v5(r,e,n)}}g5.exports=h3e});var c5=s(function(_ir,l5){"use strict";var d5=require("@stdlib/utils/define-nonenumerable-read-only-property"),th=vd(),p3e=a5(),y3e=f5();d5(th,"objectMode",p3e);d5(th,"factory",y3e);l5.exports=th});var m5=s(function(Nir,q3e){q3e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var y5=s(function(Lir,p5){"use strict";var b3e=require("@stdlib/assert/is-plain-object"),_r=require("@stdlib/assert/has-own-property"),w3e=require("@stdlib/assert/is-boolean").isPrimitive,S3e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,h5=require("@stdlib/assert/is-string").isPrimitive,O3e=require("@stdlib/assert/is-positive-integer").isPrimitive,E3e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Qn=require("@stdlib/string/format");function _3e(r,e){return b3e(e)?_r(e,"sep")&&(r.sep=e.sep,!h5(r.sep))?new TypeError(Qn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):_r(e,"objectMode")&&(r.objectMode=e.objectMode,!w3e(r.objectMode))?new TypeError(Qn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):_r(e,"encoding")&&(r.encoding=e.encoding,!h5(r.encoding)&&r.encoding!==null)?new TypeError(Qn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):_r(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!S3e(r.highWaterMark))?new TypeError(Qn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):_r(e,"iter")&&(r.iter=e.iter,!E3e(r.iter))?new TypeError(Qn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):_r(e,"siter")&&(r.siter=e.siter,!O3e(r.siter))?new TypeError(Qn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(_r(e,"prng")&&(r.prng=e.prng),_r(e,"seed")&&(r.seed=e.seed),_r(e,"state")&&(r.state=e.state),_r(e,"copy")&&(r.copy=e.copy),null):new TypeError(Qn("invalid argument. Options argument must be an object. Value: `%s`.",e))}p5.exports=_3e});var b5=s(function(Rir,q5){"use strict";var N3e=require("debug"),L3e=N3e("random:streams:pareto1");q5.exports=L3e});var fd=s(function(Pir,N5){"use strict";var _5=require("readable-stream").Readable,w5=require("@stdlib/assert/is-positive-number").isPrimitive,R3e=require("@stdlib/assert/is-error"),P3e=require("@stdlib/object/assign"),T3e=require("@stdlib/utils/inherit"),S5=require("@stdlib/utils/define-nonenumerable-property"),Di=require("@stdlib/utils/define-nonenumerable-read-only-property"),gd=require("@stdlib/utils/define-read-only-accessor"),j3e=require("@stdlib/utils/define-read-write-accessor"),M3e=za().factory,O5=require("@stdlib/buffer/from-string"),x3e=require("@stdlib/utils/next-tick"),E5=require("@stdlib/string/format"),A3e=m5(),G3e=y5(),Ls=b5();function V3e(){return this._prng.seed}function F3e(){return this._prng.seedLength}function W3e(){return this._prng.stateLength}function I3e(){return this._prng.byteLength}function k3e(){return this._prng.state}function z3e(r){this._prng.state=r}function J3e(){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=O5(e):e=O5(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function U3e(r){var e;if(this._destroyed)return Ls("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,x3e(t),this;function t(){r&&(Ls("Stream was destroyed due to an error. Error: %s.",R3e(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(!w5(r))throw new TypeError(E5("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!w5(e))throw new TypeError(E5("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=P3e({},A3e),arguments.length>2&&(n=G3e(i,t),n))throw n;return Ls("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),_5.call(this,i),S5(this,"_destroyed",!1),Di(this,"_objectMode",i.objectMode),Di(this,"_sep",i.sep),Di(this,"_iter",i.iter),Di(this,"_siter",i.siter),S5(this,"_i",0),Di(this,"_prng",M3e(r,e,i)),Di(this,"PRNG",this._prng.PRNG),this}T3e(xe,_5);gd(xe.prototype,"seed",V3e);gd(xe.prototype,"seedLength",F3e);j3e(xe.prototype,"state",k3e,z3e);gd(xe.prototype,"stateLength",W3e);gd(xe.prototype,"byteLength",I3e);Di(xe.prototype,"_read",J3e);Di(xe.prototype,"destroy",U3e);N5.exports=xe});var R5=s(function(Tir,L5){"use strict";var C3e=require("@stdlib/assert/is-plain-object"),B3e=require("@stdlib/object/assign"),D3e=require("@stdlib/string/format"),X3e=fd();function Y3e(r,e,t){var i;if(arguments.length>2){if(i=t,!C3e(i))throw new TypeError(D3e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=B3e({},t)}else i={};return i.objectMode=!0,new X3e(r,e,i)}L5.exports=Y3e});var A5=s(function(jir,x5){"use strict";var P5=require("@stdlib/assert/is-plain-object"),T5=require("@stdlib/object/assign"),j5=require("@stdlib/string/format"),M5=fd();function H3e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!P5(r))throw new TypeError(j5("invalid argument. Options argument must be an object. Value: `%s`.",r));n=T5({},r)}else if(i>2){if(!P5(t))throw new TypeError(j5("invalid argument. Options argument must be an object. Value: `%s`.",t));n=T5({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new M5(v,g,n)}function o(){return new M5(r,e,n)}}x5.exports=H3e});var F5=s(function(Mir,V5){"use strict";var G5=require("@stdlib/utils/define-nonenumerable-read-only-property"),ih=fd(),Z3e=R5(),Q3e=A5();G5(ih,"objectMode",Z3e);G5(ih,"factory",Q3e);V5.exports=ih});var W5=s(function(xir,$3e){$3e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var z5=s(function(Air,k5){"use strict";var K3e=require("@stdlib/assert/is-plain-object"),Nr=require("@stdlib/assert/has-own-property"),eJe=require("@stdlib/assert/is-boolean").isPrimitive,rJe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,I5=require("@stdlib/assert/is-string").isPrimitive,tJe=require("@stdlib/assert/is-positive-integer").isPrimitive,iJe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,$n=require("@stdlib/string/format");function nJe(r,e){return K3e(e)?Nr(e,"sep")&&(r.sep=e.sep,!I5(r.sep))?new TypeError($n("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Nr(e,"objectMode")&&(r.objectMode=e.objectMode,!eJe(r.objectMode))?new TypeError($n("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Nr(e,"encoding")&&(r.encoding=e.encoding,!I5(r.encoding)&&r.encoding!==null)?new TypeError($n("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Nr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!rJe(r.highWaterMark))?new TypeError($n("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Nr(e,"iter")&&(r.iter=e.iter,!iJe(r.iter))?new TypeError($n("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Nr(e,"siter")&&(r.siter=e.siter,!tJe(r.siter))?new TypeError($n("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Nr(e,"prng")&&(r.prng=e.prng),Nr(e,"seed")&&(r.seed=e.seed),Nr(e,"state")&&(r.state=e.state),Nr(e,"copy")&&(r.copy=e.copy),null):new TypeError($n("invalid argument. Options argument must be an object. Value: `%s`.",e))}k5.exports=nJe});var U5=s(function(Gir,J5){"use strict";var aJe=require("debug"),sJe=aJe("random:streams:poisson");J5.exports=sJe});var ld=s(function(Vir,X5){"use strict";var D5=require("readable-stream").Readable,uJe=require("@stdlib/assert/is-positive-number").isPrimitive,oJe=require("@stdlib/assert/is-error"),vJe=require("@stdlib/object/assign"),gJe=require("@stdlib/utils/inherit"),C5=require("@stdlib/utils/define-nonenumerable-property"),Xi=require("@stdlib/utils/define-nonenumerable-read-only-property"),dd=require("@stdlib/utils/define-read-only-accessor"),fJe=require("@stdlib/utils/define-read-write-accessor"),dJe=mn().factory,B5=require("@stdlib/buffer/from-string"),lJe=require("@stdlib/string/format"),cJe=require("@stdlib/utils/next-tick"),mJe=W5(),hJe=z5(),Rs=U5();function pJe(){return this._prng.seed}function yJe(){return this._prng.seedLength}function qJe(){return this._prng.stateLength}function bJe(){return this._prng.byteLength}function wJe(){return this._prng.state}function SJe(r){this._prng.state=r}function OJe(){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=B5(e):e=B5(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function EJe(r){var e;if(this._destroyed)return Rs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,cJe(t),this;function t(){r&&(Rs("Stream was destroyed due to an error. Error: %s.",oJe(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(!uJe(r))throw new TypeError(lJe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=vJe({},mJe),arguments.length>1&&(i=hJe(t,e),i))throw i;return Rs("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),D5.call(this,t),C5(this,"_destroyed",!1),Xi(this,"_objectMode",t.objectMode),Xi(this,"_sep",t.sep),Xi(this,"_iter",t.iter),Xi(this,"_siter",t.siter),C5(this,"_i",0),Xi(this,"_prng",dJe(r,t)),Xi(this,"PRNG",this._prng.PRNG),this}gJe(Ae,D5);dd(Ae.prototype,"seed",pJe);dd(Ae.prototype,"seedLength",yJe);fJe(Ae.prototype,"state",wJe,SJe);dd(Ae.prototype,"stateLength",qJe);dd(Ae.prototype,"byteLength",bJe);Xi(Ae.prototype,"_read",OJe);Xi(Ae.prototype,"destroy",EJe);X5.exports=Ae});var H5=s(function(Fir,Y5){"use strict";var _Je=require("@stdlib/assert/is-plain-object"),NJe=require("@stdlib/object/assign"),LJe=require("@stdlib/string/format"),RJe=ld();function PJe(r,e){var t;if(arguments.length>1){if(t=e,!_Je(t))throw new TypeError(LJe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=NJe({},e)}else t={};return t.objectMode=!0,new RJe(r,t)}Y5.exports=PJe});var rY=s(function(Wir,eY){"use strict";var TJe=require("@stdlib/assert/is-positive-number").isPrimitive,Z5=require("@stdlib/assert/is-plain-object"),Q5=require("@stdlib/object/assign"),$5=require("@stdlib/string/format"),K5=ld();function jJe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!Z5(e))throw new TypeError($5("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=Q5({},e)}else if(t===1)if(TJe(r))n=u,i={};else{if(!Z5(r))throw new TypeError($5("invalid argument. Options argument must be an object. Value: `%s`.",r));i=Q5({},r),n=a}else i={},n=a;return n;function a(o){return new K5(o,i)}function u(){return new K5(r,i)}}eY.exports=jJe});var nY=s(function(Iir,iY){"use strict";var tY=require("@stdlib/utils/define-nonenumerable-read-only-property"),nh=ld(),MJe=H5(),xJe=rY();tY(nh,"objectMode",MJe);tY(nh,"factory",xJe);iY.exports=nh});var aY=s(function(kir,AJe){AJe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,name:"mt19937"}});var oY=s(function(zir,uY){"use strict";var GJe=require("@stdlib/assert/is-plain-object"),Lr=require("@stdlib/assert/has-own-property"),VJe=require("@stdlib/assert/is-boolean").isPrimitive,FJe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,sY=require("@stdlib/assert/is-string").isPrimitive,WJe=require("@stdlib/assert/is-positive-integer").isPrimitive,IJe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Kn=require("@stdlib/string/format");function kJe(r,e){return GJe(e)?Lr(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)):Lr(e,"objectMode")&&(r.objectMode=e.objectMode,!VJe(r.objectMode))?new TypeError(Kn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Lr(e,"encoding")&&(r.encoding=e.encoding,!sY(r.encoding)&&r.encoding!==null)?new TypeError(Kn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Lr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!FJe(r.highWaterMark))?new TypeError(Kn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Lr(e,"iter")&&(r.iter=e.iter,!IJe(r.iter))?new TypeError(Kn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Lr(e,"siter")&&(r.siter=e.siter,!WJe(r.siter))?new TypeError(Kn("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(Kn("invalid argument. Options argument must be an object. Value: `%s`.",e))}uY.exports=kJe});var gY=s(function(Jir,vY){"use strict";var zJe=require("debug"),JJe=zJe("random:streams:randi");vY.exports=JJe});var md=s(function(Uir,cY){"use strict";var lY=require("readable-stream").Readable,UJe=require("@stdlib/assert/is-error"),CJe=require("@stdlib/object/assign"),BJe=require("@stdlib/utils/inherit"),fY=require("@stdlib/utils/define-nonenumerable-property"),Yi=require("@stdlib/utils/define-nonenumerable-read-only-property"),cd=require("@stdlib/utils/define-read-only-accessor"),DJe=require("@stdlib/utils/define-read-write-accessor"),XJe=hu().factory,dY=require("@stdlib/buffer/from-string"),YJe=require("@stdlib/utils/next-tick"),HJe=aY(),ZJe=oY(),Ps=gY();function QJe(){return this._prng.seed}function $Je(){return this._prng.seedLength}function KJe(){return this._prng.stateLength}function eUe(){return this._prng.byteLength}function rUe(){return this._prng.state}function tUe(r){this._prng.state=r}function iUe(){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=dY(e):e=dY(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function nUe(r){var e;if(this._destroyed)return Ps("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,YJe(t),this;function t(){r&&(Ps("Stream was destroyed due to an error. Error: %s.",UJe(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=CJe({},HJe),arguments.length>0&&(t=ZJe(e,r),t))throw t;return Ps("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),lY.call(this,e),fY(this,"_destroyed",!1),Yi(this,"_objectMode",e.objectMode),Yi(this,"_sep",e.sep),Yi(this,"_iter",e.iter),Yi(this,"_siter",e.siter),fY(this,"_i",0),Yi(this,"_prng",XJe(e)),Yi(this,"PRNG",this._prng.PRNG),this}BJe(Ge,lY);cd(Ge.prototype,"seed",QJe);cd(Ge.prototype,"seedLength",$Je);DJe(Ge.prototype,"state",rUe,tUe);cd(Ge.prototype,"stateLength",KJe);cd(Ge.prototype,"byteLength",eUe);Yi(Ge.prototype,"_read",iUe);Yi(Ge.prototype,"destroy",nUe);cY.exports=Ge});var hY=s(function(Cir,mY){"use strict";var aUe=require("@stdlib/assert/is-plain-object"),sUe=require("@stdlib/object/assign"),uUe=require("@stdlib/string/format"),oUe=md();function vUe(r){var e;if(arguments.length>0){if(e=r,!aUe(e))throw new TypeError(uUe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=sUe({},r)}else e={};return e.objectMode=!0,new oUe(e)}mY.exports=vUe});var yY=s(function(Bir,pY){"use strict";var gUe=require("@stdlib/assert/is-plain-object"),fUe=require("@stdlib/object/assign"),dUe=require("@stdlib/string/format"),lUe=md();function cUe(r){var e;if(arguments.length>0){if(!gUe(r))throw new TypeError(dUe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=fUe({},r)}else e={};return t;function t(){return new lUe(e)}}pY.exports=cUe});var wY=s(function(Dir,bY){"use strict";var qY=require("@stdlib/utils/define-nonenumerable-read-only-property"),ah=md(),mUe=hY(),hUe=yY();qY(ah,"objectMode",mUe);qY(ah,"factory",hUe);bY.exports=ah});var SY=s(function(Xir,pUe){pUe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,name:"improved-ziggurat"}});var _Y=s(function(Yir,EY){"use strict";var yUe=require("@stdlib/assert/is-plain-object"),De=require("@stdlib/assert/has-own-property"),qUe=require("@stdlib/assert/is-boolean").isPrimitive,bUe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,OY=require("@stdlib/assert/is-string").isPrimitive,wUe=require("@stdlib/assert/is-positive-integer").isPrimitive,SUe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ea=require("@stdlib/string/format");function OUe(r,e){return yUe(e)?De(e,"sep")&&(r.sep=e.sep,!OY(r.sep))?new TypeError(ea("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):De(e,"objectMode")&&(r.objectMode=e.objectMode,!qUe(r.objectMode))?new TypeError(ea("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):De(e,"encoding")&&(r.encoding=e.encoding,!OY(r.encoding)&&r.encoding!==null)?new TypeError(ea("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):De(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!bUe(r.highWaterMark))?new TypeError(ea("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):De(e,"iter")&&(r.iter=e.iter,!SUe(r.iter))?new TypeError(ea("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):De(e,"siter")&&(r.siter=e.siter,!wUe(r.siter))?new TypeError(ea("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(ea("invalid argument. Options argument must be an object. Value: `%s`.",e))}EY.exports=OUe});var LY=s(function(Hir,NY){"use strict";var EUe=require("debug"),_Ue=EUe("random:streams:randn");NY.exports=_Ue});var pd=s(function(Zir,jY){"use strict";var TY=require("readable-stream").Readable,NUe=require("@stdlib/assert/is-error"),LUe=require("@stdlib/object/assign"),RUe=require("@stdlib/utils/inherit"),RY=require("@stdlib/utils/define-nonenumerable-property"),Hi=require("@stdlib/utils/define-nonenumerable-read-only-property"),hd=require("@stdlib/utils/define-read-only-accessor"),PUe=require("@stdlib/utils/define-read-write-accessor"),TUe=yu().factory,PY=require("@stdlib/buffer/from-string"),jUe=require("@stdlib/utils/next-tick"),MUe=SY(),xUe=_Y(),Ts=LY();function AUe(){return this._prng.seed}function GUe(){return this._prng.seedLength}function VUe(){return this._prng.stateLength}function FUe(){return this._prng.byteLength}function WUe(){return this._prng.state}function IUe(r){this._prng.state=r}function kUe(){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=PY(e):e=PY(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function zUe(r){var e;if(this._destroyed)return Ts("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,jUe(t),this;function t(){r&&(Ts("Stream was destroyed due to an error. Error: %s.",NUe(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({},MUe),arguments.length>0&&(t=xUe(e,r),t))throw t;return Ts("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),TY.call(this,e),RY(this,"_destroyed",!1),Hi(this,"_objectMode",e.objectMode),Hi(this,"_sep",e.sep),Hi(this,"_iter",e.iter),Hi(this,"_siter",e.siter),RY(this,"_i",0),Hi(this,"_prng",TUe(e)),Hi(this,"PRNG",this._prng.PRNG),this}RUe(Ve,TY);hd(Ve.prototype,"seed",AUe);hd(Ve.prototype,"seedLength",GUe);PUe(Ve.prototype,"state",WUe,IUe);hd(Ve.prototype,"stateLength",VUe);hd(Ve.prototype,"byteLength",FUe);Hi(Ve.prototype,"_read",kUe);Hi(Ve.prototype,"destroy",zUe);jY.exports=Ve});var xY=s(function(Qir,MY){"use strict";var JUe=require("@stdlib/assert/is-plain-object"),UUe=require("@stdlib/object/assign"),CUe=require("@stdlib/string/format"),BUe=pd();function DUe(r){var e;if(arguments.length>0){if(e=r,!JUe(e))throw new TypeError(CUe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=UUe({},r)}else e={};return e.objectMode=!0,new BUe(e)}MY.exports=DUe});var GY=s(function($ir,AY){"use strict";var XUe=require("@stdlib/assert/is-plain-object"),YUe=require("@stdlib/object/assign"),HUe=require("@stdlib/string/format"),ZUe=pd();function QUe(r){var e;if(arguments.length>0){if(!XUe(r))throw new TypeError(HUe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=YUe({},r)}else e={};return t;function t(){return new ZUe(e)}}AY.exports=QUe});var WY=s(function(Kir,FY){"use strict";var VY=require("@stdlib/utils/define-nonenumerable-read-only-property"),sh=pd(),$Ue=xY(),KUe=GY();VY(sh,"objectMode",$Ue);VY(sh,"factory",KUe);FY.exports=sh});var IY=s(function(enr,eCe){eCe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,name:"mt19937"}});var JY=s(function(rnr,zY){"use strict";var rCe=require("@stdlib/assert/is-plain-object"),Rr=require("@stdlib/assert/has-own-property"),tCe=require("@stdlib/assert/is-boolean").isPrimitive,iCe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,kY=require("@stdlib/assert/is-string").isPrimitive,nCe=require("@stdlib/assert/is-positive-integer").isPrimitive,aCe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ra=require("@stdlib/string/format");function sCe(r,e){return rCe(e)?Rr(e,"sep")&&(r.sep=e.sep,!kY(r.sep))?new TypeError(ra("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Rr(e,"objectMode")&&(r.objectMode=e.objectMode,!tCe(r.objectMode))?new TypeError(ra("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Rr(e,"encoding")&&(r.encoding=e.encoding,!kY(r.encoding)&&r.encoding!==null)?new TypeError(ra("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Rr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!iCe(r.highWaterMark))?new TypeError(ra("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Rr(e,"iter")&&(r.iter=e.iter,!aCe(r.iter))?new TypeError(ra("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Rr(e,"siter")&&(r.siter=e.siter,!nCe(r.siter))?new TypeError(ra("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(ra("invalid argument. Options argument must be an object. Value: `%s`.",e))}zY.exports=sCe});var CY=s(function(tnr,UY){"use strict";var uCe=require("debug"),oCe=uCe("random:streams:randu");UY.exports=oCe});var qd=s(function(inr,YY){"use strict";var XY=require("readable-stream").Readable,vCe=require("@stdlib/assert/is-error"),gCe=require("@stdlib/object/assign"),fCe=require("@stdlib/utils/inherit"),BY=require("@stdlib/utils/define-nonenumerable-property"),Zi=require("@stdlib/utils/define-nonenumerable-read-only-property"),yd=require("@stdlib/utils/define-read-only-accessor"),dCe=require("@stdlib/utils/define-read-write-accessor"),lCe=Tt().factory,DY=require("@stdlib/buffer/from-string"),cCe=require("@stdlib/utils/next-tick"),mCe=IY(),hCe=JY(),js=CY();function pCe(){return this._prng.seed}function yCe(){return this._prng.seedLength}function qCe(){return this._prng.stateLength}function bCe(){return this._prng.byteLength}function wCe(){return this._prng.state}function SCe(r){this._prng.state=r}function OCe(){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=DY(e):e=DY(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function ECe(r){var e;if(this._destroyed)return js("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,cCe(t),this;function t(){r&&(js("Stream was destroyed due to an error. Error: %s.",vCe(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=gCe({},mCe),arguments.length>0&&(t=hCe(e,r),t))throw t;return js("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),XY.call(this,e),BY(this,"_destroyed",!1),Zi(this,"_objectMode",e.objectMode),Zi(this,"_sep",e.sep),Zi(this,"_iter",e.iter),Zi(this,"_siter",e.siter),BY(this,"_i",0),Zi(this,"_prng",lCe(e)),Zi(this,"PRNG",this._prng.PRNG),this}fCe(Fe,XY);yd(Fe.prototype,"seed",pCe);yd(Fe.prototype,"seedLength",yCe);dCe(Fe.prototype,"state",wCe,SCe);yd(Fe.prototype,"stateLength",qCe);yd(Fe.prototype,"byteLength",bCe);Zi(Fe.prototype,"_read",OCe);Zi(Fe.prototype,"destroy",ECe);YY.exports=Fe});var ZY=s(function(nnr,HY){"use strict";var _Ce=require("@stdlib/assert/is-plain-object"),NCe=require("@stdlib/object/assign"),LCe=require("@stdlib/string/format"),RCe=qd();function PCe(r){var e;if(arguments.length>0){if(e=r,!_Ce(e))throw new TypeError(LCe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=NCe({},r)}else e={};return e.objectMode=!0,new RCe(e)}HY.exports=PCe});var $Y=s(function(anr,QY){"use strict";var TCe=require("@stdlib/assert/is-plain-object"),jCe=require("@stdlib/object/assign"),MCe=require("@stdlib/string/format"),xCe=qd();function ACe(r){var e;if(arguments.length>0){if(!TCe(r))throw new TypeError(MCe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=jCe({},r)}else e={};return t;function t(){return new xCe(e)}}QY.exports=ACe});var r6=s(function(snr,e6){"use strict";var KY=require("@stdlib/utils/define-nonenumerable-read-only-property"),uh=qd(),GCe=ZY(),VCe=$Y();KY(uh,"objectMode",GCe);KY(uh,"factory",VCe);e6.exports=uh});var t6=s(function(unr,FCe){FCe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var a6=s(function(onr,n6){"use strict";var WCe=require("@stdlib/assert/is-plain-object"),Pr=require("@stdlib/assert/has-own-property"),ICe=require("@stdlib/assert/is-boolean").isPrimitive,kCe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,i6=require("@stdlib/assert/is-string").isPrimitive,zCe=require("@stdlib/assert/is-positive-integer").isPrimitive,JCe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ta=require("@stdlib/string/format");function UCe(r,e){return WCe(e)?Pr(e,"sep")&&(r.sep=e.sep,!i6(r.sep))?new TypeError(ta("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Pr(e,"objectMode")&&(r.objectMode=e.objectMode,!ICe(r.objectMode))?new TypeError(ta("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Pr(e,"encoding")&&(r.encoding=e.encoding,!i6(r.encoding)&&r.encoding!==null)?new TypeError(ta("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Pr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!kCe(r.highWaterMark))?new TypeError(ta("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Pr(e,"iter")&&(r.iter=e.iter,!JCe(r.iter))?new TypeError(ta("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Pr(e,"siter")&&(r.siter=e.siter,!zCe(r.siter))?new TypeError(ta("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(ta("invalid argument. Options argument must be an object. Value: `%s`.",e))}n6.exports=UCe});var u6=s(function(vnr,s6){"use strict";var CCe=require("debug"),BCe=CCe("random:streams:rayleigh");s6.exports=BCe});var wd=s(function(gnr,f6){"use strict";var g6=require("readable-stream").Readable,DCe=require("@stdlib/assert/is-positive-number").isPrimitive,XCe=require("@stdlib/assert/is-error"),YCe=require("@stdlib/object/assign"),HCe=require("@stdlib/utils/inherit"),o6=require("@stdlib/utils/define-nonenumerable-property"),Qi=require("@stdlib/utils/define-nonenumerable-read-only-property"),bd=require("@stdlib/utils/define-read-only-accessor"),ZCe=require("@stdlib/utils/define-read-write-accessor"),QCe=Ja().factory,v6=require("@stdlib/buffer/from-string"),$Ce=require("@stdlib/utils/next-tick"),KCe=require("@stdlib/string/format"),eBe=t6(),rBe=a6(),Ms=u6();function tBe(){return this._prng.seed}function iBe(){return this._prng.seedLength}function nBe(){return this._prng.stateLength}function aBe(){return this._prng.byteLength}function sBe(){return this._prng.state}function uBe(r){this._prng.state=r}function oBe(){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=v6(e):e=v6(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function vBe(r){var e;if(this._destroyed)return Ms("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,$Ce(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(!DCe(r))throw new TypeError(KCe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=YCe({},eBe),arguments.length>1&&(i=rBe(t,e),i))throw i;return Ms("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),g6.call(this,t),o6(this,"_destroyed",!1),Qi(this,"_objectMode",t.objectMode),Qi(this,"_sep",t.sep),Qi(this,"_iter",t.iter),Qi(this,"_siter",t.siter),o6(this,"_i",0),Qi(this,"_prng",QCe(r,t)),Qi(this,"PRNG",this._prng.PRNG),this}HCe(We,g6);bd(We.prototype,"seed",tBe);bd(We.prototype,"seedLength",iBe);ZCe(We.prototype,"state",sBe,uBe);bd(We.prototype,"stateLength",nBe);bd(We.prototype,"byteLength",aBe);Qi(We.prototype,"_read",oBe);Qi(We.prototype,"destroy",vBe);f6.exports=We});var l6=s(function(fnr,d6){"use strict";var gBe=require("@stdlib/assert/is-plain-object"),fBe=require("@stdlib/object/assign"),dBe=require("@stdlib/string/format"),lBe=wd();function cBe(r,e){var t;if(arguments.length>1){if(t=e,!gBe(t))throw new TypeError(dBe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=fBe({},e)}else t={};return t.objectMode=!0,new lBe(r,t)}d6.exports=cBe});var q6=s(function(dnr,y6){"use strict";var mBe=require("@stdlib/assert/is-positive-number").isPrimitive,c6=require("@stdlib/assert/is-plain-object"),m6=require("@stdlib/object/assign"),h6=require("@stdlib/string/format"),p6=wd();function hBe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!c6(e))throw new TypeError(h6("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=m6({},e)}else if(t===1)if(mBe(r))n=u,i={};else{if(!c6(r))throw new TypeError(h6("invalid argument. Options argument must be an object. Value: `%s`.",r));i=m6({},r),n=a}else i={},n=a;return n;function a(o){return new p6(o,i)}function u(){return new p6(r,i)}}y6.exports=hBe});var S6=s(function(lnr,w6){"use strict";var b6=require("@stdlib/utils/define-nonenumerable-read-only-property"),oh=wd(),pBe=l6(),yBe=q6();b6(oh,"objectMode",pBe);b6(oh,"factory",yBe);w6.exports=oh});var O6=s(function(cnr,qBe){qBe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var N6=s(function(mnr,_6){"use strict";var bBe=require("@stdlib/assert/is-plain-object"),Tr=require("@stdlib/assert/has-own-property"),wBe=require("@stdlib/assert/is-boolean").isPrimitive,SBe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,E6=require("@stdlib/assert/is-string").isPrimitive,OBe=require("@stdlib/assert/is-positive-integer").isPrimitive,EBe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ia=require("@stdlib/string/format");function _Be(r,e){return bBe(e)?Tr(e,"sep")&&(r.sep=e.sep,!E6(r.sep))?new TypeError(ia("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Tr(e,"objectMode")&&(r.objectMode=e.objectMode,!wBe(r.objectMode))?new TypeError(ia("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Tr(e,"encoding")&&(r.encoding=e.encoding,!E6(r.encoding)&&r.encoding!==null)?new TypeError(ia("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Tr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!SBe(r.highWaterMark))?new TypeError(ia("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Tr(e,"iter")&&(r.iter=e.iter,!EBe(r.iter))?new TypeError(ia("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Tr(e,"siter")&&(r.siter=e.siter,!OBe(r.siter))?new TypeError(ia("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Tr(e,"prng")&&(r.prng=e.prng),Tr(e,"seed")&&(r.seed=e.seed),Tr(e,"state")&&(r.state=e.state),Tr(e,"copy")&&(r.copy=e.copy),null):new TypeError(ia("invalid argument. Options argument must be an object. Value: `%s`.",e))}_6.exports=_Be});var R6=s(function(hnr,L6){"use strict";var NBe=require("debug"),LBe=NBe("random:streams:t");L6.exports=LBe});var Od=s(function(pnr,M6){"use strict";var j6=require("readable-stream").Readable,RBe=require("@stdlib/assert/is-positive-number").isPrimitive,PBe=require("@stdlib/assert/is-error"),TBe=require("@stdlib/object/assign"),jBe=require("@stdlib/utils/inherit"),P6=require("@stdlib/utils/define-nonenumerable-property"),$i=require("@stdlib/utils/define-nonenumerable-read-only-property"),Sd=require("@stdlib/utils/define-read-only-accessor"),MBe=require("@stdlib/utils/define-read-write-accessor"),xBe=Ba().factory,T6=require("@stdlib/buffer/from-string"),ABe=require("@stdlib/utils/next-tick"),GBe=require("@stdlib/string/format"),VBe=O6(),FBe=N6(),xs=R6();function WBe(){return this._prng.seed}function IBe(){return this._prng.seedLength}function kBe(){return this._prng.stateLength}function zBe(){return this._prng.byteLength}function JBe(){return this._prng.state}function UBe(r){this._prng.state=r}function CBe(){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=T6(e):e=T6(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function BBe(r){var e;if(this._destroyed)return xs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,ABe(t),this;function t(){r&&(xs("Stream was destroyed due to an error. Error: %s.",PBe(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(!RBe(r))throw new TypeError(GBe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=TBe({},VBe),arguments.length>1&&(i=FBe(t,e),i))throw i;return xs("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),j6.call(this,t),P6(this,"_destroyed",!1),$i(this,"_objectMode",t.objectMode),$i(this,"_sep",t.sep),$i(this,"_iter",t.iter),$i(this,"_siter",t.siter),P6(this,"_i",0),$i(this,"_prng",xBe(r,t)),$i(this,"PRNG",this._prng.PRNG),this}jBe(Ie,j6);Sd(Ie.prototype,"seed",WBe);Sd(Ie.prototype,"seedLength",IBe);MBe(Ie.prototype,"state",JBe,UBe);Sd(Ie.prototype,"stateLength",kBe);Sd(Ie.prototype,"byteLength",zBe);$i(Ie.prototype,"_read",CBe);$i(Ie.prototype,"destroy",BBe);M6.exports=Ie});var A6=s(function(ynr,x6){"use strict";var DBe=require("@stdlib/assert/is-plain-object"),XBe=require("@stdlib/object/assign"),YBe=require("@stdlib/string/format"),HBe=Od();function ZBe(r,e){var t;if(arguments.length>1){if(t=e,!DBe(t))throw new TypeError(YBe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=XBe({},e)}else t={};return t.objectMode=!0,new HBe(r,t)}x6.exports=ZBe});var k6=s(function(qnr,I6){"use strict";var QBe=require("@stdlib/assert/is-positive-number").isPrimitive,G6=require("@stdlib/assert/is-plain-object"),V6=require("@stdlib/object/assign"),F6=require("@stdlib/string/format"),W6=Od();function $Be(r,e){var t,i,n;if(t=arguments.length,t>1){if(!G6(e))throw new TypeError(F6("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=V6({},e)}else if(t===1)if(QBe(r))n=u,i={};else{if(!G6(r))throw new TypeError(F6("invalid argument. Options argument must be an object. Value: `%s`.",r));i=V6({},r),n=a}else i={},n=a;return n;function a(o){return new W6(o,i)}function u(){return new W6(r,i)}}I6.exports=$Be});var U6=s(function(bnr,J6){"use strict";var z6=require("@stdlib/utils/define-nonenumerable-read-only-property"),vh=Od(),KBe=A6(),e9e=k6();z6(vh,"objectMode",KBe);z6(vh,"factory",e9e);J6.exports=vh});var C6=s(function(wnr,r9e){r9e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var X6=s(function(Snr,D6){"use strict";var t9e=require("@stdlib/assert/is-plain-object"),jr=require("@stdlib/assert/has-own-property"),i9e=require("@stdlib/assert/is-boolean").isPrimitive,n9e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,B6=require("@stdlib/assert/is-string").isPrimitive,a9e=require("@stdlib/assert/is-positive-integer").isPrimitive,s9e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,na=require("@stdlib/string/format");function u9e(r,e){return t9e(e)?jr(e,"sep")&&(r.sep=e.sep,!B6(r.sep))?new TypeError(na("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):jr(e,"objectMode")&&(r.objectMode=e.objectMode,!i9e(r.objectMode))?new TypeError(na("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):jr(e,"encoding")&&(r.encoding=e.encoding,!B6(r.encoding)&&r.encoding!==null)?new TypeError(na("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):jr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!n9e(r.highWaterMark))?new TypeError(na("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):jr(e,"iter")&&(r.iter=e.iter,!s9e(r.iter))?new TypeError(na("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):jr(e,"siter")&&(r.siter=e.siter,!a9e(r.siter))?new TypeError(na("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(jr(e,"prng")&&(r.prng=e.prng),jr(e,"seed")&&(r.seed=e.seed),jr(e,"state")&&(r.state=e.state),jr(e,"copy")&&(r.copy=e.copy),null):new TypeError(na("invalid argument. Options argument must be an object. Value: `%s`.",e))}D6.exports=u9e});var H6=s(function(Onr,Y6){"use strict";var o9e=require("debug"),v9e=o9e("random:streams:triangular");Y6.exports=v9e});var Nd=s(function(Enr,K6){"use strict";var $6=require("readable-stream").Readable,gh=require("@stdlib/assert/is-number").isPrimitive,fh=require("@stdlib/math/base/assert/is-nan"),g9e=require("@stdlib/assert/is-error"),f9e=require("@stdlib/object/assign"),d9e=require("@stdlib/utils/inherit"),Z6=require("@stdlib/utils/define-nonenumerable-property"),Ki=require("@stdlib/utils/define-nonenumerable-read-only-property"),_d=require("@stdlib/utils/define-read-only-accessor"),l9e=require("@stdlib/utils/define-read-write-accessor"),c9e=Da().factory,Q6=require("@stdlib/buffer/from-string"),m9e=require("@stdlib/utils/next-tick"),Ed=require("@stdlib/string/format"),h9e=C6(),p9e=X6(),As=H6();function y9e(){return this._prng.seed}function q9e(){return this._prng.seedLength}function b9e(){return this._prng.stateLength}function w9e(){return this._prng.byteLength}function S9e(){return this._prng.state}function O9e(r){this._prng.state=r}function E9e(){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=Q6(e):e=Q6(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function _9e(r){var e;if(this._destroyed)return As("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,m9e(t),this;function t(){r&&(As("Stream was destroyed due to an error. Error: %s.",g9e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),As("Closing the stream..."),e.emit("close")}}function ke(r,e,t,i){var n,a;if(!(this instanceof ke))return arguments.length>3?new ke(r,e,t,i):new ke(r,e,t);if(!gh(r)||fh(r))throw new TypeError(Ed("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!gh(e)||fh(e))throw new TypeError(Ed("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(!gh(t)||fh(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=f9e({},h9e),arguments.length>3&&(a=p9e(n,i),a))throw a;return As("Creating a readable stream configured with the following options: %s.",JSON.stringify(n)),$6.call(this,n),Z6(this,"_destroyed",!1),Ki(this,"_objectMode",n.objectMode),Ki(this,"_sep",n.sep),Ki(this,"_iter",n.iter),Ki(this,"_siter",n.siter),Z6(this,"_i",0),Ki(this,"_prng",c9e(r,e,t,n)),Ki(this,"PRNG",this._prng.PRNG),this}d9e(ke,$6);_d(ke.prototype,"seed",y9e);_d(ke.prototype,"seedLength",q9e);l9e(ke.prototype,"state",S9e,O9e);_d(ke.prototype,"stateLength",b9e);_d(ke.prototype,"byteLength",w9e);Ki(ke.prototype,"_read",E9e);Ki(ke.prototype,"destroy",_9e);K6.exports=ke});var r4=s(function(_nr,e4){"use strict";var N9e=require("@stdlib/assert/is-plain-object"),L9e=require("@stdlib/object/assign"),R9e=require("@stdlib/string/format"),P9e=Nd();function T9e(r,e,t,i){var n;if(arguments.length>3){if(n=i,!N9e(n))throw new TypeError(R9e("invalid argument. Options argument must be an object. Value: `%s`.",n));n=L9e({},i)}else n={};return n.objectMode=!0,new P9e(r,e,t,n)}e4.exports=T9e});var u4=s(function(Nnr,s4){"use strict";var t4=require("@stdlib/assert/is-plain-object"),i4=require("@stdlib/object/assign"),n4=require("@stdlib/string/format"),a4=Nd();function j9e(r,e,t,i){var n,a,u;if(n=arguments.length,n===1){if(!t4(r))throw new TypeError(n4("invalid argument. Options argument must be an object. Value: `%s`.",r));a=i4({},r)}else if(n>3){if(!t4(i))throw new TypeError(n4("invalid argument. Options argument must be an object. Value: `%s`.",i));a=i4({},i)}else a={};return n<3?u=o:u=v,u;function o(g,c,l){return new a4(g,c,l,a)}function v(){return new a4(r,e,t,a)}}s4.exports=j9e});var g4=s(function(Lnr,v4){"use strict";var o4=require("@stdlib/utils/define-nonenumerable-read-only-property"),dh=Nd(),M9e=r4(),x9e=u4();o4(dh,"objectMode",M9e);o4(dh,"factory",x9e);v4.exports=dh});var f4=s(function(Rnr,A9e){A9e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var c4=s(function(Pnr,l4){"use strict";var G9e=require("@stdlib/assert/is-plain-object"),Mr=require("@stdlib/assert/has-own-property"),V9e=require("@stdlib/assert/is-boolean").isPrimitive,F9e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,d4=require("@stdlib/assert/is-string").isPrimitive,W9e=require("@stdlib/assert/is-positive-integer").isPrimitive,I9e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,aa=require("@stdlib/string/format");function k9e(r,e){return G9e(e)?Mr(e,"sep")&&(r.sep=e.sep,!d4(r.sep))?new TypeError(aa("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Mr(e,"objectMode")&&(r.objectMode=e.objectMode,!V9e(r.objectMode))?new TypeError(aa("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Mr(e,"encoding")&&(r.encoding=e.encoding,!d4(r.encoding)&&r.encoding!==null)?new TypeError(aa("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Mr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!F9e(r.highWaterMark))?new TypeError(aa("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Mr(e,"iter")&&(r.iter=e.iter,!I9e(r.iter))?new TypeError(aa("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Mr(e,"siter")&&(r.siter=e.siter,!W9e(r.siter))?new TypeError(aa("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Mr(e,"prng")&&(r.prng=e.prng),Mr(e,"seed")&&(r.seed=e.seed),Mr(e,"state")&&(r.state=e.state),Mr(e,"copy")&&(r.copy=e.copy),null):new TypeError(aa("invalid argument. Options argument must be an object. Value: `%s`.",e))}l4.exports=k9e});var h4=s(function(Tnr,m4){"use strict";var z9e=require("debug"),J9e=z9e("random:streams:uniform");m4.exports=J9e});var Rd=s(function(jnr,S4){"use strict";var w4=require("readable-stream").Readable,p4=require("@stdlib/assert/is-number").isPrimitive,y4=require("@stdlib/math/base/assert/is-nan"),U9e=require("@stdlib/assert/is-error"),C9e=require("@stdlib/object/assign"),B9e=require("@stdlib/utils/inherit"),q4=require("@stdlib/utils/define-nonenumerable-property"),en=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ld=require("@stdlib/utils/define-read-only-accessor"),D9e=require("@stdlib/utils/define-read-write-accessor"),X9e=pn().factory,b4=require("@stdlib/buffer/from-string"),Y9e=require("@stdlib/utils/next-tick"),lh=require("@stdlib/string/format"),H9e=f4(),Z9e=c4(),Gs=h4();function Q9e(){return this._prng.seed}function $9e(){return this._prng.seedLength}function K9e(){return this._prng.stateLength}function eDe(){return this._prng.byteLength}function rDe(){return this._prng.state}function tDe(r){this._prng.state=r}function iDe(){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=b4(e):e=b4(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function nDe(r){var e;if(this._destroyed)return Gs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,Y9e(t),this;function t(){r&&(Gs("Stream was destroyed due to an error. Error: %s.",U9e(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(!p4(r)||y4(r))throw new TypeError(lh("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!p4(e)||y4(e))throw new TypeError(lh("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(r>=e)throw new RangeError(lh("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e));if(i=C9e({},H9e),arguments.length>2&&(n=Z9e(i,t),n))throw n;return Gs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),w4.call(this,i),q4(this,"_destroyed",!1),en(this,"_objectMode",i.objectMode),en(this,"_sep",i.sep),en(this,"_iter",i.iter),en(this,"_siter",i.siter),q4(this,"_i",0),en(this,"_prng",X9e(r,e,i)),en(this,"PRNG",this._prng.PRNG),this}B9e(ze,w4);Ld(ze.prototype,"seed",Q9e);Ld(ze.prototype,"seedLength",$9e);D9e(ze.prototype,"state",rDe,tDe);Ld(ze.prototype,"stateLength",K9e);Ld(ze.prototype,"byteLength",eDe);en(ze.prototype,"_read",iDe);en(ze.prototype,"destroy",nDe);S4.exports=ze});var E4=s(function(Mnr,O4){"use strict";var aDe=require("@stdlib/assert/is-plain-object"),sDe=require("@stdlib/object/assign"),uDe=require("@stdlib/string/format"),oDe=Rd();function vDe(r,e,t){var i;if(arguments.length>2){if(i=t,!aDe(i))throw new TypeError(uDe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=sDe({},t)}else i={};return i.objectMode=!0,new oDe(r,e,i)}O4.exports=vDe});var T4=s(function(xnr,P4){"use strict";var _4=require("@stdlib/assert/is-plain-object"),N4=require("@stdlib/object/assign"),L4=require("@stdlib/string/format"),R4=Rd();function gDe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!_4(r))throw new TypeError(L4("invalid argument. Options argument must be an object. Value: `%s`.",r));n=N4({},r)}else if(i>2){if(!_4(t))throw new TypeError(L4("invalid argument. Options argument must be an object. Value: `%s`.",t));n=N4({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new R4(v,g,n)}function o(){return new R4(r,e,n)}}P4.exports=gDe});var x4=s(function(Anr,M4){"use strict";var j4=require("@stdlib/utils/define-nonenumerable-read-only-property"),ch=Rd(),fDe=E4(),dDe=T4();j4(ch,"objectMode",fDe);j4(ch,"factory",dDe);M4.exports=ch});var A4=s(function(Gnr,lDe){lDe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var F4=s(function(Vnr,V4){"use strict";var cDe=require("@stdlib/assert/is-plain-object"),xr=require("@stdlib/assert/has-own-property"),mDe=require("@stdlib/assert/is-boolean").isPrimitive,hDe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,G4=require("@stdlib/assert/is-string").isPrimitive,pDe=require("@stdlib/assert/is-positive-integer").isPrimitive,yDe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,sa=require("@stdlib/string/format");function qDe(r,e){return cDe(e)?xr(e,"sep")&&(r.sep=e.sep,!G4(r.sep))?new TypeError(sa("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):xr(e,"objectMode")&&(r.objectMode=e.objectMode,!mDe(r.objectMode))?new TypeError(sa("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):xr(e,"encoding")&&(r.encoding=e.encoding,!G4(r.encoding)&&r.encoding!==null)?new TypeError(sa("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):xr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!hDe(r.highWaterMark))?new TypeError(sa("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):xr(e,"iter")&&(r.iter=e.iter,!yDe(r.iter))?new TypeError(sa("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):xr(e,"siter")&&(r.siter=e.siter,!pDe(r.siter))?new TypeError(sa("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(xr(e,"prng")&&(r.prng=e.prng),xr(e,"seed")&&(r.seed=e.seed),xr(e,"state")&&(r.state=e.state),xr(e,"copy")&&(r.copy=e.copy),null):new TypeError(sa("invalid argument. Options argument must be an object. Value: `%s`.",e))}V4.exports=qDe});var I4=s(function(Fnr,W4){"use strict";var bDe=require("debug"),wDe=bDe("random:streams:weibull");W4.exports=wDe});var Td=s(function(Wnr,B4){"use strict";var C4=require("readable-stream").Readable,k4=require("@stdlib/assert/is-positive-number").isPrimitive,SDe=require("@stdlib/assert/is-error"),ODe=require("@stdlib/object/assign"),EDe=require("@stdlib/utils/inherit"),z4=require("@stdlib/utils/define-nonenumerable-property"),rn=require("@stdlib/utils/define-nonenumerable-read-only-property"),Pd=require("@stdlib/utils/define-read-only-accessor"),_De=require("@stdlib/utils/define-read-write-accessor"),NDe=yn().factory,J4=require("@stdlib/buffer/from-string"),U4=require("@stdlib/string/format"),LDe=require("@stdlib/utils/next-tick"),RDe=A4(),PDe=F4(),Vs=I4();function TDe(){return this._prng.seed}function jDe(){return this._prng.seedLength}function MDe(){return this._prng.stateLength}function xDe(){return this._prng.byteLength}function ADe(){return this._prng.state}function GDe(r){this._prng.state=r}function VDe(){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=J4(e):e=J4(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function FDe(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.",SDe(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(!k4(r))throw new TypeError(U4("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!k4(e))throw new TypeError(U4("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=ODe({},RDe),arguments.length>2&&(n=PDe(i,t),n))throw n;return Vs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),C4.call(this,i),z4(this,"_destroyed",!1),rn(this,"_objectMode",i.objectMode),rn(this,"_sep",i.sep),rn(this,"_iter",i.iter),rn(this,"_siter",i.siter),z4(this,"_i",0),rn(this,"_prng",NDe(r,e,i)),rn(this,"PRNG",this._prng.PRNG),this}EDe(Je,C4);Pd(Je.prototype,"seed",TDe);Pd(Je.prototype,"seedLength",jDe);_De(Je.prototype,"state",ADe,GDe);Pd(Je.prototype,"stateLength",MDe);Pd(Je.prototype,"byteLength",xDe);rn(Je.prototype,"_read",VDe);rn(Je.prototype,"destroy",FDe);B4.exports=Je});var X4=s(function(Inr,D4){"use strict";var WDe=require("@stdlib/assert/is-plain-object"),IDe=require("@stdlib/object/assign"),kDe=require("@stdlib/string/format"),zDe=Td();function JDe(r,e,t){var i;if(arguments.length>2){if(i=t,!WDe(i))throw new TypeError(kDe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=IDe({},t)}else i={};return i.objectMode=!0,new zDe(r,e,i)}D4.exports=JDe});var K4=s(function(knr,$4){"use strict";var Y4=require("@stdlib/assert/is-plain-object"),H4=require("@stdlib/object/assign"),Z4=require("@stdlib/string/format"),Q4=Td();function UDe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!Y4(r))throw new TypeError(Z4("invalid argument. Options argument must be an object. Value: `%s`.",r));n=H4({},r)}else if(i>2){if(!Y4(t))throw new TypeError(Z4("invalid argument. Options argument must be an object. Value: `%s`.",t));n=H4({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new Q4(v,g,n)}function o(){return new Q4(r,e,n)}}$4.exports=UDe});var tH=s(function(znr,rH){"use strict";var eH=require("@stdlib/utils/define-nonenumerable-read-only-property"),mh=Td(),CDe=X4(),BDe=K4();eH(mh,"objectMode",CDe);eH(mh,"factory",BDe);rH.exports=mh});var nH=s(function(Jnr,iH){"use strict";var P=require("@stdlib/utils/define-read-only-property"),L={};P(L,"arcsine",Ek());P(L,"bernoulli",Bk());P(L,"beta",cz());P(L,"betaprime",Fz());P(L,"binomial",a3());P(L,"boxMuller",S3());P(L,"cauchy",C3());P(L,"chi",fJ());P(L,"chisquare",MJ());P(L,"cosine",eU());P(L,"discreteUniform",SU());P(L,"erlang",CU());P(L,"exponential",fC());P(L,"f",AC());P(L,"frechet",tB());P(L,"gamma",_B());P(L,"geometric",DB());P(L,"gumbel",c9());P(L,"hypergeometric",G9());P(L,"improvedZiggurat",$9());P(L,"invgamma",wD());P(L,"kumaraswamy",CD());P(L,"laplace",d8());P(L,"levy",A8());P(L,"logistic",tX());P(L,"lognormal",EX());P(L,"minstd",JX());P(L,"minstdShuffle",s7());P(L,"mt19937",E7());P(L,"negativeBinomial",D7());P(L,"normal",c5());P(L,"pareto1",F5());P(L,"poisson",nY());P(L,"randi",wY());P(L,"randn",WY());P(L,"randu",r6());P(L,"rayleigh",S6());P(L,"t",U6());P(L,"triangular",g4());P(L,"uniform",x4());P(L,"weibull",tH());iH.exports=L});var ph=s(function(Unr,sH){"use strict";var aH=require("@stdlib/array/base/assert/is-accessor-array"),hh=nn();function DDe(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 aH(r)?g=r.get(t):g=r[t],aH(i)?c=i.get(a):c=i[a],v.fcn=hh.factory(g,c,o),v;v.fcn=hh.factory(o)}else v.fcn=hh;return v.arity+=2,v}sH.exports=DDe});var oH=s(function(Cnr,uH){"use strict";var XDe=require("@stdlib/strided/base/nullary"),YDe=require("@stdlib/strided/base/binary"),HDe=ph();function ZDe(r,e,t,i,n,a,u,o){var v=HDe(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(XDe([a],[r],[u],v.fcn),a):(YDe([e,i,a],[r],[t,n,u],v.fcn),a)}uH.exports=ZDe});var gH=s(function(Bnr,vH){"use strict";var QDe=require("@stdlib/strided/base/nullary").ndarray,$De=require("@stdlib/strided/base/binary").ndarray,KDe=ph();function e8e(r,e,t,i,n,a,u,o,v,g,c){var l=KDe(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(QDe([o],[r],[v],[g],l.fcn),o):($De([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}vH.exports=e8e});var lH=s(function(Dnr,dH){"use strict";var r8e=require("@stdlib/utils/define-nonenumerable-read-only-property"),fH=oH(),t8e=gH();r8e(fH,"ndarray",t8e);dH.exports=fH});var pH=s(function(Xnr,hH){"use strict";var cH=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"),i8e=require("@stdlib/assert/is-function"),n8e=require("@stdlib/assert/is-method-in"),a8e=require("@stdlib/assert/is-plain-object"),s8e=require("@stdlib/utils/constant-function"),u8e=require("@stdlib/utils/noop"),mH=require("@stdlib/strided/base/unary"),yh=require("@stdlib/string/format");function o8e(r){if(!i8e(r))throw new TypeError(yh("invalid argument. First argument must be a function. Value: `%s`.",r));if(!n8e(r,"factory"))throw new TypeError(yh("invalid argument. First argument must have a `%s` method.","factory"));return e;function e(){var t,i;if(arguments.length>0){if(i=arguments[0],!a8e(i))throw new TypeError(yh("invalid argument. Options argument must be an object. Value: `%s`.",i));t=r.factory(i)}else i={},t=r;return i&&i.prng?(Fs(n,"seed",null),Fs(n,"seedLength",null),cH(n,"state",s8e(null),u8e),Fs(n,"stateLength",null),Fs(n,"byteLength",null)):(jd(n,"seed",u),jd(n,"seedLength",o),cH(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 mH([h,d],[m],[p,f],t),d}function a(m,h,p,d,f,y,q){return mH.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=o8e});var Md=s(function(Ynr,yH){"use strict";var v8e=pH();yH.exports=v8e});var qh=s(function(Hnr,qH){"use strict";var g8e=Md(),f8e=an(),d8e=g8e(f8e);qH.exports=d8e});var wH=s(function(Znr,bH){"use strict";var l8e=qh(),c8e=l8e();bH.exports=c8e});var EH=s(function(Qnr,OH){"use strict";var m8e=require("@stdlib/utils/define-nonenumerable-read-only-property"),SH=wH(),h8e=qh();m8e(SH,"factory",h8e);OH.exports=SH});var wh=s(function($nr,NH){"use strict";var _H=require("@stdlib/array/base/assert/is-accessor-array"),bh=un();function p8e(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 _H(r)?g=r.get(t):g=r[t],_H(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}NH.exports=p8e});var RH=s(function(Knr,LH){"use strict";var y8e=require("@stdlib/strided/base/nullary"),q8e=require("@stdlib/strided/base/binary"),b8e=wh();function w8e(r,e,t,i,n,a,u,o){var v=b8e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(y8e([a],[r],[u],v.fcn),a):(q8e([e,i,a],[r],[t,n,u],v.fcn),a)}LH.exports=w8e});var TH=s(function(ear,PH){"use strict";var S8e=require("@stdlib/strided/base/nullary").ndarray,O8e=require("@stdlib/strided/base/binary").ndarray,E8e=wh();function _8e(r,e,t,i,n,a,u,o,v,g,c){var l=E8e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(S8e([o],[r],[v],[g],l.fcn),o):(O8e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}PH.exports=_8e});var xH=s(function(rar,MH){"use strict";var N8e=require("@stdlib/utils/define-nonenumerable-read-only-property"),jH=RH(),L8e=TH();N8e(jH,"ndarray",L8e);MH.exports=jH});var Oh=s(function(tar,GH){"use strict";var AH=require("@stdlib/array/base/assert/is-accessor-array"),Sh=on();function R8e(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 AH(r)?g=r.get(t):g=r[t],AH(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}GH.exports=R8e});var FH=s(function(iar,VH){"use strict";var P8e=require("@stdlib/strided/base/nullary"),T8e=require("@stdlib/strided/base/binary"),j8e=Oh();function M8e(r,e,t,i,n,a,u,o){var v=j8e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(P8e([a],[r],[u],v.fcn),a):(T8e([e,i,a],[r],[t,n,u],v.fcn),a)}VH.exports=M8e});var IH=s(function(nar,WH){"use strict";var x8e=require("@stdlib/strided/base/nullary").ndarray,A8e=require("@stdlib/strided/base/binary").ndarray,G8e=Oh();function V8e(r,e,t,i,n,a,u,o,v,g,c){var l=G8e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(x8e([o],[r],[v],[g],l.fcn),o):(A8e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}WH.exports=V8e});var JH=s(function(aar,zH){"use strict";var F8e=require("@stdlib/utils/define-nonenumerable-read-only-property"),kH=FH(),W8e=IH();F8e(kH,"ndarray",W8e);zH.exports=kH});var Eh=s(function(sar,UH){"use strict";var I8e=Md(),k8e=vn(),z8e=I8e(k8e);UH.exports=z8e});var BH=s(function(uar,CH){"use strict";var J8e=Eh(),U8e=J8e();CH.exports=U8e});var YH=s(function(oar,XH){"use strict";var C8e=require("@stdlib/utils/define-nonenumerable-read-only-property"),DH=BH(),B8e=Eh();C8e(DH,"factory",B8e);XH.exports=DH});var Nh=s(function(gar,ZH){"use strict";var HH=require("@stdlib/array/base/assert/is-accessor-array"),_h=gn();function D8e(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 HH(r)?g=r.get(t):g=r[t],HH(i)?c=i.get(a):c=i[a],v.fcn=_h.factory(g,c,o),v;v.fcn=_h.factory(o)}else v.fcn=_h;return v.arity+=2,v}ZH.exports=D8e});var $H=s(function(far,QH){"use strict";var X8e=require("@stdlib/strided/base/nullary"),Y8e=require("@stdlib/strided/base/binary"),H8e=Nh();function Z8e(r,e,t,i,n,a,u,o){var v=H8e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(X8e([a],[r],[u],v.fcn),a):(Y8e([e,i,a],[r],[t,n,u],v.fcn),a)}QH.exports=Z8e});var eZ=s(function(dar,KH){"use strict";var Q8e=require("@stdlib/strided/base/nullary").ndarray,$8e=require("@stdlib/strided/base/binary").ndarray,K8e=Nh();function eXe(r,e,t,i,n,a,u,o,v,g,c){var l=K8e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(Q8e([o],[r],[v],[g],l.fcn),o):($8e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}KH.exports=eXe});var iZ=s(function(lar,tZ){"use strict";var rXe=require("@stdlib/utils/define-nonenumerable-read-only-property"),rZ=$H(),tXe=eZ();rXe(rZ,"ndarray",tXe);tZ.exports=rZ});var Rh=s(function(car,aZ){"use strict";var nZ=require("@stdlib/array/base/assert/is-accessor-array"),Lh=fn();function iXe(r,e,t,i,n,a,u,o){var v,g,c;if(v={arity:0,fcn:null},u){if(e===0&&n===0)return nZ(r)?g=r.get(t):g=r[t],nZ(i)?c=i.get(a):c=i[a],v.fcn=Lh.factory(g,c,o),v;v.fcn=Lh.factory(o)}else v.fcn=Lh;return v.arity+=2,v}aZ.exports=iXe});var uZ=s(function(mar,sZ){"use strict";var nXe=require("@stdlib/strided/base/nullary"),aXe=require("@stdlib/strided/base/binary"),sXe=Rh();function uXe(r,e,t,i,n,a,u,o){var v=sXe(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(nXe([a],[r],[u],v.fcn),a):(aXe([e,i,a],[r],[t,n,u],v.fcn),a)}sZ.exports=uXe});var vZ=s(function(har,oZ){"use strict";var oXe=require("@stdlib/strided/base/nullary").ndarray,vXe=require("@stdlib/strided/base/binary").ndarray,gXe=Rh();function fXe(r,e,t,i,n,a,u,o,v,g,c){var l=gXe(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(oXe([o],[r],[v],[g],l.fcn),o):(vXe([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}oZ.exports=fXe});var dZ=s(function(par,fZ){"use strict";var dXe=require("@stdlib/utils/define-nonenumerable-read-only-property"),gZ=uZ(),lXe=vZ();dXe(gZ,"ndarray",lXe);fZ.exports=gZ});var Ph=s(function(yar,lZ){"use strict";var cXe=Md(),mXe=dn(),hXe=cXe(mXe);lZ.exports=hXe});var mZ=s(function(qar,cZ){"use strict";var pXe=Ph(),yXe=pXe();cZ.exports=yXe});var yZ=s(function(bar,pZ){"use strict";var qXe=require("@stdlib/utils/define-nonenumerable-read-only-property"),hZ=mZ(),bXe=Ph();qXe(hZ,"factory",bXe);pZ.exports=hZ});var jh=s(function(war,bZ){"use strict";var qZ=require("@stdlib/array/base/assert/is-accessor-array"),Th=Ce();function wXe(r,e,t,i,n,a,u,o){var v,g,c;if(v={arity:0,fcn:null},u){if(e===0&&n===0)return qZ(r)?g=r.get(t):g=r[t],qZ(i)?c=i.get(a):c=i[a],v.fcn=Th.factory(g,c,o),v;v.fcn=Th.factory(o)}else v.fcn=Th;return v.arity+=2,v}bZ.exports=wXe});var SZ=s(function(Sar,wZ){"use strict";var SXe=require("@stdlib/strided/base/nullary"),OXe=require("@stdlib/strided/base/binary"),EXe=jh();function _Xe(r,e,t,i,n,a,u,o){var v=EXe(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(SXe([a],[r],[u],v.fcn),a):(OXe([e,i,a],[r],[t,n,u],v.fcn),a)}wZ.exports=_Xe});var EZ=s(function(Oar,OZ){"use strict";var NXe=require("@stdlib/strided/base/nullary").ndarray,LXe=require("@stdlib/strided/base/binary").ndarray,RXe=jh();function PXe(r,e,t,i,n,a,u,o,v,g,c){var l=RXe(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(NXe([o],[r],[v],[g],l.fcn),o):(LXe([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}OZ.exports=PXe});var LZ=s(function(Ear,NZ){"use strict";var TXe=require("@stdlib/utils/define-nonenumerable-read-only-property"),_Z=SZ(),jXe=EZ();TXe(_Z,"ndarray",jXe);NZ.exports=_Z});var xh=s(function(_ar,PZ){"use strict";var RZ=require("@stdlib/array/base/assert/is-accessor-array"),Mh=ln();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 RZ(r)?g=r.get(t):g=r[t],RZ(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}PZ.exports=MXe});var jZ=s(function(Nar,TZ){"use strict";var xXe=require("@stdlib/strided/base/nullary"),AXe=require("@stdlib/strided/base/binary"),GXe=xh();function VXe(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?(xXe([a],[r],[u],v.fcn),a):(AXe([e,i,a],[r],[t,n,u],v.fcn),a)}TZ.exports=VXe});var xZ=s(function(Lar,MZ){"use strict";var FXe=require("@stdlib/strided/base/nullary").ndarray,WXe=require("@stdlib/strided/base/binary").ndarray,IXe=xh();function kXe(r,e,t,i,n,a,u,o,v,g,c){var l=IXe(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(FXe([o],[r],[v],[g],l.fcn),o):(WXe([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}MZ.exports=kXe});var VZ=s(function(Rar,GZ){"use strict";var zXe=require("@stdlib/utils/define-nonenumerable-read-only-property"),AZ=jZ(),JXe=xZ();zXe(AZ,"ndarray",JXe);GZ.exports=AZ});var Gh=s(function(Par,WZ){"use strict";var FZ=require("@stdlib/array/base/assert/is-accessor-array"),Ah=cn();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 FZ(r)?g=r.get(t):g=r[t],FZ(i)?c=i.get(a):c=i[a],v.fcn=Ah.factory(g,c,o),v;v.fcn=Ah.factory(o)}else v.fcn=Ah;return v.arity+=2,v}WZ.exports=UXe});var kZ=s(function(Tar,IZ){"use strict";var CXe=require("@stdlib/strided/base/nullary"),BXe=require("@stdlib/strided/base/binary"),DXe=Gh();function XXe(r,e,t,i,n,a,u,o){var v=DXe(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(CXe([a],[r],[u],v.fcn),a):(BXe([e,i,a],[r],[t,n,u],v.fcn),a)}IZ.exports=XXe});var JZ=s(function(jar,zZ){"use strict";var YXe=require("@stdlib/strided/base/nullary").ndarray,HXe=require("@stdlib/strided/base/binary").ndarray,ZXe=Gh();function QXe(r,e,t,i,n,a,u,o,v,g,c){var l=ZXe(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(YXe([o],[r],[v],[g],l.fcn),o):(HXe([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}zZ.exports=QXe});var BZ=s(function(Mar,CZ){"use strict";var $Xe=require("@stdlib/utils/define-nonenumerable-read-only-property"),UZ=kZ(),KXe=JZ();$Xe(UZ,"ndarray",KXe);CZ.exports=UZ});var YZ=s(function(xar,XZ){"use strict";var e7e=require("@stdlib/strided/base/nullary"),DZ=$();function r7e(r,e,t,i){var n;return arguments.length>3?n=DZ.factory(i):n=DZ,e7e([e],[r],[t],n),e}XZ.exports=r7e});var QZ=s(function(Aar,ZZ){"use strict";var t7e=require("@stdlib/strided/base/nullary").ndarray,HZ=$();function i7e(r,e,t,i,n){var a;return arguments.length>4?a=HZ.factory(n):a=HZ,t7e([e],[r],[t],[i],a),e}ZZ.exports=i7e});var eQ=s(function(Gar,KZ){"use strict";var n7e=require("@stdlib/strided/base/nullary"),$Z=$();function a7e(r,e,t,i){var n;return arguments.length>3?n=$Z.factory(i):n=$Z,n7e([e],[r],[t],n.normalized),e}KZ.exports=a7e});var iQ=s(function(Var,tQ){"use strict";var s7e=require("@stdlib/strided/base/nullary").ndarray,rQ=$();function u7e(r,e,t,i,n){var a;return arguments.length>4?a=rQ.factory(n):a=rQ,s7e([e],[r],[t],[i],a.normalized),e}tQ.exports=u7e});var sQ=s(function(Far,aQ){"use strict";var Vh=require("@stdlib/utils/define-nonenumerable-read-only-property"),Fh=YZ(),o7e=QZ(),nQ=eQ(),v7e=iQ();Vh(Fh,"ndarray",o7e);Vh(Fh,"normalized",nQ);Vh(nQ,"ndarray",v7e);aQ.exports=Fh});var vQ=s(function(War,oQ){"use strict";var g7e=require("@stdlib/strided/base/nullary"),uQ=ee();function f7e(r,e,t,i){var n;return arguments.length>3?n=uQ.factory(i):n=uQ,g7e([e],[r],[t],n),e}oQ.exports=f7e});var dQ=s(function(Iar,fQ){"use strict";var d7e=require("@stdlib/strided/base/nullary").ndarray,gQ=ee();function l7e(r,e,t,i,n){var a;return arguments.length>4?a=gQ.factory(n):a=gQ,d7e([e],[r],[t],[i],a),e}fQ.exports=l7e});var mQ=s(function(kar,cQ){"use strict";var c7e=require("@stdlib/strided/base/nullary"),lQ=ee();function m7e(r,e,t,i){var n;return arguments.length>3?n=lQ.factory(i):n=lQ,c7e([e],[r],[t],n.normalized),e}cQ.exports=m7e});var yQ=s(function(zar,pQ){"use strict";var h7e=require("@stdlib/strided/base/nullary").ndarray,hQ=ee();function p7e(r,e,t,i,n){var a;return arguments.length>4?a=hQ.factory(n):a=hQ,h7e([e],[r],[t],[i],a.normalized),e}pQ.exports=p7e});var wQ=s(function(Jar,bQ){"use strict";var Wh=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ih=vQ(),y7e=dQ(),qQ=mQ(),q7e=yQ();Wh(Ih,"ndarray",y7e);Wh(Ih,"normalized",qQ);Wh(qQ,"ndarray",q7e);bQ.exports=Ih});var EQ=s(function(Uar,OQ){"use strict";var b7e=require("@stdlib/strided/base/nullary"),SQ=T();function w7e(r,e,t,i){var n;return arguments.length>3?n=SQ.factory(i):n=SQ,b7e([e],[r],[t],n),e}OQ.exports=w7e});var LQ=s(function(Car,NQ){"use strict";var S7e=require("@stdlib/strided/base/nullary").ndarray,_Q=T();function O7e(r,e,t,i,n){var a;return arguments.length>4?a=_Q.factory(n):a=_Q,S7e([e],[r],[t],[i],a),e}NQ.exports=O7e});var TQ=s(function(Bar,PQ){"use strict";var E7e=require("@stdlib/strided/base/nullary"),RQ=T();function _7e(r,e,t,i){var n;return arguments.length>3?n=RQ.factory(i):n=RQ,E7e([e],[r],[t],n.normalized),e}PQ.exports=_7e});var xQ=s(function(Dar,MQ){"use strict";var N7e=require("@stdlib/strided/base/nullary").ndarray,jQ=T();function L7e(r,e,t,i,n){var a;return arguments.length>4?a=jQ.factory(n):a=jQ,N7e([e],[r],[t],[i],a.normalized),e}MQ.exports=L7e});var VQ=s(function(Xar,GQ){"use strict";var kh=require("@stdlib/utils/define-nonenumerable-read-only-property"),zh=EQ(),R7e=LQ(),AQ=TQ(),P7e=xQ();kh(zh,"ndarray",R7e);kh(zh,"normalized",AQ);kh(AQ,"ndarray",P7e);GQ.exports=zh});var Uh=s(function(Yar,WQ){"use strict";var FQ=require("@stdlib/array/base/assert/is-accessor-array"),Jh=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 FQ(r)?g=r.get(t):g=r[t],FQ(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}WQ.exports=T7e});var kQ=s(function(Har,IQ){"use strict";var j7e=require("@stdlib/strided/base/nullary"),M7e=require("@stdlib/strided/base/binary"),x7e=Uh();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)}IQ.exports=A7e});var JQ=s(function(Zar,zQ){"use strict";var G7e=require("@stdlib/strided/base/nullary").ndarray,V7e=require("@stdlib/strided/base/binary").ndarray,F7e=Uh();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)}zQ.exports=W7e});var BQ=s(function(Qar,CQ){"use strict";var I7e=require("@stdlib/utils/define-nonenumerable-read-only-property"),UQ=kQ(),k7e=JQ();I7e(UQ,"ndarray",k7e);CQ.exports=UQ});var YQ=s(function($ar,XQ){"use strict";var z7e=require("@stdlib/strided/base/nullary"),DQ=Tt();function J7e(r,e,t,i){var n;return arguments.length>3?n=DQ.factory(i):n=DQ,z7e([e],[r],[t],n),e}XQ.exports=J7e});var QQ=s(function(Kar,ZQ){"use strict";var U7e=require("@stdlib/strided/base/nullary").ndarray,HQ=Tt();function C7e(r,e,t,i,n){var a;return arguments.length>4?a=HQ.factory(n):a=HQ,U7e([e],[r],[t],[i],a),e}ZQ.exports=C7e});var e$=s(function(esr,KQ){"use strict";var B7e=require("@stdlib/utils/define-nonenumerable-read-only-property"),$Q=YQ(),D7e=QQ();B7e($Q,"ndarray",D7e);KQ.exports=$Q});var Bh=s(function(rsr,t$){"use strict";var r$=require("@stdlib/array/base/assert/is-accessor-array"),Ch=pn();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 r$(r)?g=r.get(t):g=r[t],r$(i)?c=i.get(a):c=i[a],v.fcn=Ch.factory(g,c,o),v;v.fcn=Ch.factory(o)}else v.fcn=Ch;return v.arity+=2,v}t$.exports=X7e});var n$=s(function(tsr,i$){"use strict";var Y7e=require("@stdlib/strided/base/nullary"),H7e=require("@stdlib/strided/base/binary"),Z7e=Bh();function Q7e(r,e,t,i,n,a,u,o){var v=Z7e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(Y7e([a],[r],[u],v.fcn),a):(H7e([e,i,a],[r],[t,n,u],v.fcn),a)}i$.exports=Q7e});var s$=s(function(isr,a$){"use strict";var $7e=require("@stdlib/strided/base/nullary").ndarray,K7e=require("@stdlib/strided/base/binary").ndarray,e5e=Bh();function r5e(r,e,t,i,n,a,u,o,v,g,c){var l=e5e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?($7e([o],[r],[v],[g],l.fcn),o):(K7e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}a$.exports=r5e});var v$=s(function(nsr,o$){"use strict";var t5e=require("@stdlib/utils/define-nonenumerable-read-only-property"),u$=n$(),i5e=s$();t5e(u$,"ndarray",i5e);o$.exports=u$});var Xh=s(function(asr,f$){"use strict";var g$=require("@stdlib/array/base/assert/is-accessor-array"),Dh=yn();function n5e(r,e,t,i,n,a,u,o){var v,g,c;if(v={arity:0,fcn:null},u){if(e===0&&n===0)return g$(r)?g=r.get(t):g=r[t],g$(i)?c=i.get(a):c=i[a],v.fcn=Dh.factory(g,c,o),v;v.fcn=Dh.factory(o)}else v.fcn=Dh;return v.arity+=2,v}f$.exports=n5e});var l$=s(function(ssr,d$){"use strict";var a5e=require("@stdlib/strided/base/nullary"),s5e=require("@stdlib/strided/base/binary"),u5e=Xh();function o5e(r,e,t,i,n,a,u,o){var v=u5e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(a5e([a],[r],[u],v.fcn),a):(s5e([e,i,a],[r],[t,n,u],v.fcn),a)}d$.exports=o5e});var m$=s(function(usr,c$){"use strict";var v5e=require("@stdlib/strided/base/nullary").ndarray,g5e=require("@stdlib/strided/base/binary").ndarray,f5e=Xh();function d5e(r,e,t,i,n,a,u,o,v,g,c){var l=f5e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(v5e([o],[r],[v],[g],l.fcn),o):(g5e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}c$.exports=d5e});var y$=s(function(osr,p$){"use strict";var l5e=require("@stdlib/utils/define-nonenumerable-read-only-property"),h$=l$(),c5e=m$();l5e(h$,"ndarray",c5e);p$.exports=h$});var b$=s(function(vsr,q$){"use strict";var z=require("@stdlib/utils/define-read-only-property"),k={};z(k,"arcsine",lH());z(k,"bernoulli",EH());z(k,"beta",xH());z(k,"betaprime",JH());z(k,"chi",YH());z(k,"cosine",iZ());z(k,"discreteUniform",dZ());z(k,"exponential",yZ());z(k,"gamma",LZ());z(k,"invgamma",VZ());z(k,"lognormal",BZ());z(k,"minstd",sQ());z(k,"minstdShuffle",wQ());z(k,"mt19937",VQ());z(k,"normal",BQ());z(k,"randu",e$());z(k,"uniform",v$());z(k,"weibull",y$());q$.exports=k});var ua=require("@stdlib/utils/define-read-only-property"),tn={};ua(tn,"array",hx());ua(tn,"base",u1());ua(tn,"iterators",pI());ua(tn,"sample",zI());ua(tn,"shuffle",rk());ua(tn,"streams",nH());ua(tn,"strided",b$());module.exports=tn; +"use strict";var s=function(r,e){return function(){return e||r((e={exports:{}}).exports,e),e.exports}};var Qh=s(function(T5e,Zh){"use strict";var P$=require("@stdlib/assert/is-plain-object"),T$=require("@stdlib/assert/has-own-property"),j$=require("@stdlib/array/base/assert/contains"),Hh=require("@stdlib/string/format");function M$(r,e,t){return P$(t)?T$(t,"dtype")&&(r.dtype=t.dtype,!j$(e,r.dtype))?new TypeError(Hh('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),r.dtype)):null:new TypeError(Hh("invalid argument. Options argument must be an object. Value: `%s`.",t))}Zh.exports=M$});var rp=s(function(j5e,ep){"use strict";var $h=require("@stdlib/utils/define-nonenumerable-read-only-property"),x$=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,A$=require("@stdlib/assert/is-function"),G$=require("@stdlib/assert/is-string-array").primitives,V$=require("@stdlib/assert/is-collection"),F$=require("@stdlib/array/base/assert/contains"),W$=require("@stdlib/array/base/filled-by"),Kh=require("@stdlib/strided/base/binary"),I$=require("@stdlib/array/ctors"),Ws=require("@stdlib/string/format"),k$=Qh();function Is(r,e,t){if(!(this instanceof Is))return new Is(r,e,t);if(!A$(r))throw new TypeError(Ws("invalid argument. First argument must be a function. Value: `%s`.",r));if(!G$(e))throw new TypeError(Ws("invalid argument. Second argument must be an array of strings. Value: `%s`.",e));if(!F$(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}$h(Is.prototype,"generate",function(e,t,i,n){var a,u,o,v,g,c;if(!x$(e))throw new TypeError(Ws("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if(u={},arguments.length>3&&(g=k$(u,this._dtypes,n),g))throw g;if(o=this._prng,c=u.dtype||this._dtype,c==="generic")return W$(e,l);return a=I$(c),v=new a(e),Kh([[t],[i],v],[e],[0,0,1],o),v;function l(){return o(t,i)}});$h(Is.prototype,"assign",function(e,t,i){if(!V$(i))throw new TypeError(Ws("invalid argument. Third argument must be an array-like object. Value: `%s`.",i));return Kh([[e],[t],i],[i.length],[0,0,1],this._prng),i});ep.exports=Is});var ip=s(function(M5e,tp){"use strict";var z$=rp();tp.exports=z$});var sp=s(function(x5e,ap){"use strict";var J$=require("@stdlib/assert/is-plain-object"),U$=require("@stdlib/assert/has-own-property"),C$=require("@stdlib/array/base/assert/contains"),np=require("@stdlib/string/format");function B$(r,e,t){return J$(t)?U$(t,"dtype")&&(r.dtype=t.dtype,!C$(e,r.dtype))?new TypeError(np('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),r.dtype)):null:new TypeError(np("invalid argument. Options argument must be an object. Value: `%s`.",t))}ap.exports=B$});var gp=s(function(A5e,vp){"use strict";var up=require("@stdlib/utils/define-nonenumerable-read-only-property"),D$=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,X$=require("@stdlib/assert/is-function"),Y$=require("@stdlib/assert/is-string-array").primitives,H$=require("@stdlib/assert/is-collection"),Z$=require("@stdlib/array/base/assert/contains"),Q$=require("@stdlib/array/base/filled-by"),op=require("@stdlib/strided/base/nullary"),$$=require("@stdlib/array/ctors"),ks=require("@stdlib/string/format"),K$=sp();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(!Y$(e))throw new TypeError(ks("invalid argument. Second argument must be an array of strings. Value: `%s`.",e));if(!Z$(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}up(zs.prototype,"generate",function(e,t){var i,n,a,u,o;if(!D$(e))throw new TypeError(ks("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if(n={},arguments.length>1&&(u=K$(n,this._dtypes,t),u))throw u;return o=n.dtype||this._dtype,o==="generic"?Q$(e,this._prng):(i=$$(o),a=new i(e),op([a],[e],[1],this._prng),a)});up(zs.prototype,"assign",function(e){if(!H$(e))throw new TypeError(ks("invalid argument. First argument must be an array-like object. Value: `%s`.",e));return op([e],[e.length],[1],this._prng),e});vp.exports=zs});var Nu=s(function(G5e,fp){"use strict";var eK=gp();fp.exports=eK});var mp=s(function(V5e,cp){"use strict";var dp=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Lu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),oa=require("@stdlib/utils/define-nonenumerable-read-only-property"),rK=require("@stdlib/assert/is-string-array").primitives,tK=require("@stdlib/assert/is-function"),iK=require("@stdlib/assert/is-method-in"),nK=require("@stdlib/assert/has-own-property"),lp=require("@stdlib/array/base/assert/contains").factory,aK=require("@stdlib/utils/constant-function"),sK=require("@stdlib/utils/noop"),uK=ip(),oK=Nu(),Js=require("@stdlib/string/format");function vK(r,e,t){var i;if(!tK(r))throw new TypeError(Js("invalid argument. First argument must be a function. Value: `%s`.",r));if(!iK(r,"factory"))throw new TypeError(Js("invalid argument. First argument must have a `%s` method.","factory"));if(!rK(e))throw new TypeError(Js("invalid argument. Second argument must an array of strings. Value: `%s`.",e));if(!lp(e,t))throw new TypeError(Js("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return i=lp(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),nK(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=uK):(g=q,a=oK),u=new a(l,e,p),m&&m.prng?(oa(h,"seed",null),oa(h,"seedLength",null),dp(h,"state",aK(null),sK),oa(h,"stateLength",null),oa(h,"byteLength",null)):(Lu(h,"seed",b),Lu(h,"seedLength",w),dp(h,"state",J,x),Lu(h,"stateLength",S),Lu(h,"byteLength",W)),oa(h,"PRNG",l.PRNG),oa(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}}}cp.exports=vK});var F=s(function(F5e,hp){"use strict";var gK=mp();hp.exports=gK});var xd=s(function(W5e,pp){"use strict";var fK=require("@stdlib/constants/uint32/max"),dK=require("@stdlib/math/base/special/floor"),lK=fK-1;function cK(){var r=dK(1+lK*Math.random());return r>>>0}pp.exports=cK});var zd=s(function(I5e,Rp){"use strict";var Gr=require("@stdlib/utils/define-nonenumerable-read-only-property"),ft=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),yp=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ad=require("@stdlib/assert/has-own-property"),mK=require("@stdlib/assert/is-plain-object"),hK=require("@stdlib/assert/is-collection"),qp=require("@stdlib/assert/is-uint32array"),pK=require("@stdlib/assert/is-boolean").isPrimitive,bp=require("@stdlib/assert/is-positive-integer").isPrimitive,_p=require("@stdlib/constants/float64/max-safe-integer"),Np=require("@stdlib/constants/uint32/max"),U=require("@stdlib/array/uint32"),yK=require("@stdlib/math/base/special/max"),kd=require("@stdlib/math/base/ops/umul"),va=require("@stdlib/blas/base/gcopy"),qK=require("@stdlib/array/to-json"),B=require("@stdlib/string/format"),wp=xd(),k=624,Gd=397,Sp=Np>>>0,bK=19650218,Vd=2147483648,Fd=2147483647,wK=1812433253,SK=1664525,OK=1566083941,EK=2636928640,_K=4022730752,NK=2567483615,Wd=[0,NK>>>0],Lp=1/(_p+1),LK=67108864,RK=2147483648,Id=1,PK=_p*Lp,Ru=1,Pu=3,dt=2,lt=k+3,C=k+5,Us=k+6;function Op(r,e){var t;return e?t="option":t="argument",r.length>>0,i=1;i>>0,t=(t^t>>>30)>>>0,r[i]=kd(t,wK)+i>>>0;return r}function TK(r,e,t,i){var n,a,u,o;for(a=1,u=0,o=yK(e,i);o>0;o--)n=r[a-1]>>>0,n=(n^n>>>30)>>>0,n=kd(n,SK)>>>0,r[a]=(r[a]>>>0^n)+t[u]+u>>>0,a+=1,u+=1,a>=e&&(r[0]=r[e-1],a=1),u>=i&&(u=0);for(o=e-1;o>0;o--)n=r[a-1]>>>0,n=(n^n>>>30)>>>0,n=kd(n,OK)>>>0,r[a]=(r[a]>>>0^n)-a>>>0,a+=1,a>=e&&(r[0]=r[e-1],a=1);return r[0]=RK,r}function jK(r){var e,t,i,n;for(n=k-Gd,t=0;t>>1^Wd[e&Id];for(i=k-1;t>>1^Wd[e&Id];return e=r[i]&Vd|r[0]&Fd,r[i]=r[Gd-1]^e>>>1^Wd[e&Id],r}function MK(r){var e,t,i,n,a,u;if(i={},arguments.length){if(!mK(r))throw new TypeError(B("invalid argument. Options argument must be an object. Value: `%s`.",r));if(Ad(r,"copy")&&(i.copy=r.copy,!pK(r.copy)))throw new TypeError(B("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy));if(Ad(r,"state")){if(t=r.state,i.state=!0,!qp(t))throw new TypeError(B("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",t));if(u=Op(t,!0),u)throw u;i.copy===!1?e=t:(e=new U(t.length),va(t.length,t,1,e,1)),t=new U(e.buffer,e.byteOffset+(dt+1)*e.BYTES_PER_ELEMENT,k),n=new U(e.buffer,e.byteOffset+(C+1)*e.BYTES_PER_ELEMENT,t[C])}if(n===void 0)if(Ad(r,"seed"))if(n=r.seed,i.seed=!0,bp(n)){if(n>Sp)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(hK(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],!bp(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>Sp)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]=Ru,e[1]=Pu,e[dt]=k,e[lt]=1,e[lt+1]=k,e[C]=a,va.ndarray(a,n,1,0,e,1,C+1),t=new U(e.buffer,e.byteOffset+(dt+1)*e.BYTES_PER_ELEMENT,k),n=new U(e.buffer,e.byteOffset+(C+1)*e.BYTES_PER_ELEMENT,a),t=Ep(t,k,bK),t=TK(t,k,n,a)}else n=wp()>>>0}else n=wp()>>>0;return t===void 0&&(e=new U(Us+1),e[0]=Ru,e[1]=Pu,e[dt]=k,e[lt]=1,e[lt+1]=k,e[C]=1,e[C+1]=n,t=new U(e.buffer,e.byteOffset+(dt+1)*e.BYTES_PER_ELEMENT,k),n=new U(e.buffer,e.byteOffset+(C+1)*e.BYTES_PER_ELEMENT,1),t=Ep(t,k,n)),Gr(p,"NAME","mt19937"),ft(p,"seed",o),ft(p,"seedLength",v),yp(p,"state",l,m),ft(p,"stateLength",g),ft(p,"byteLength",c),Gr(p,"toJSON",h),Gr(p,"MIN",0),Gr(p,"MAX",Np),Gr(p,"normalized",d),Gr(d,"NAME",p.NAME),ft(d,"seed",o),ft(d,"seedLength",v),yp(d,"state",l,m),ft(d,"stateLength",g),ft(d,"byteLength",c),Gr(d,"toJSON",h),Gr(d,"MIN",0),Gr(d,"MAX",PK),p;function o(){var f=e[C];return va(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 va(f,e,1,new U(f),1)}function m(f){var y;if(!qp(f))throw new TypeError(B("invalid argument. Must provide a Uint32Array. Value: `%s`.",f));if(y=Op(f,!1),y)throw y;i.copy===!1?i.state&&f.length===e.length?va(f.length,f,1,e,1):(e=f,i.state=!0):(f.length!==e.length&&(e=new U(f.length)),va(f.length,f,1,e,1)),t=new U(e.buffer,e.byteOffset+(dt+1)*e.BYTES_PER_ELEMENT,k),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=qK(e),f.params=[],f}function p(){var f,y;return y=e[lt+1],y>=k&&(t=jK(t),y=0),f=t[y],e[lt+1]=y+1,f^=f>>>11,f^=f<<7&EK,f^=f<<15&_K,f^=f>>>18,f>>>0}function d(){var f=p()>>>5,y=p()>>>6;return(f*LK+y)*Lp}}Rp.exports=MK});var Tp=s(function(k5e,Pp){"use strict";var xK=zd(),AK=xd(),GK=xK({seed:AK()});Pp.exports=GK});var T=s(function(z5e,Mp){"use strict";var VK=require("@stdlib/utils/define-nonenumerable-read-only-property"),jp=Tp(),FK=zd();VK(jp,"factory",FK);Mp.exports=jp});var Vp=s(function(J5e,Gp){"use strict";var xp=require("@stdlib/assert/is-number").isPrimitive,Jd=require("@stdlib/string/format"),Ap=require("@stdlib/assert/is-nan");function WK(r,e){return!xp(r)||Ap(r)?new TypeError(Jd("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):!xp(e)||Ap(e)?new TypeError(Jd("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):r>=e?new RangeError(Jd("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e)):null}Gp.exports=WK});var Wp=s(function(U5e,Fp){"use strict";var IK=require("@stdlib/math/base/special/pow"),kK=require("@stdlib/math/base/special/sin"),zK=require("@stdlib/constants/float64/half-pi");function JK(r,e,t){return e+IK(kK(zK*r()),2)*(t-e)}Fp.exports=JK});var Ud=s(function(C5e,Dp){"use strict";var Vr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Tu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Ip=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),kp=require("@stdlib/assert/is-plain-object"),zp=require("@stdlib/assert/is-function"),Jp=require("@stdlib/assert/has-own-property"),Up=require("@stdlib/utils/constant-function"),UK=require("@stdlib/utils/noop"),ju=T().factory,Cp=require("@stdlib/math/base/assert/is-nan"),CK=require("@stdlib/array/to-json"),Mu=require("@stdlib/string/format"),BK=Vp(),Bp=Wp();function DK(){var r,e,t,i,n,a;if(arguments.length===0)e=ju();else if(arguments.length===1){if(r=arguments[0],!kp(r))throw new TypeError(Mu("invalid argument. Options argument must be an object. Value: `%s`.",r));if(Jp(r,"prng")){if(!zp(r.prng))throw new TypeError(Mu("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=ju(r)}else{if(n=arguments[0],a=arguments[1],i=BK(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!kp(r))throw new TypeError(Mu("invalid argument. Options argument must be an object. Value: `%s`.",r));if(Jp(r,"prng")){if(!zp(r.prng))throw new TypeError(Mu("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=ju(r)}else e=ju()}return n===void 0?t=p:t=h,Vr(t,"NAME","arcsine"),r&&r.prng?(Vr(t,"seed",null),Vr(t,"seedLength",null),Ip(t,"state",Up(null),UK),Vr(t,"stateLength",null),Vr(t,"byteLength",null),Vr(t,"toJSON",Up(null)),Vr(t,"PRNG",e)):(Tu(t,"seed",u),Tu(t,"seedLength",o),Ip(t,"state",c,l),Tu(t,"stateLength",v),Tu(t,"byteLength",g),Vr(t,"toJSON",m),Vr(t,"PRNG",e),e=e.normalized),t;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=t.NAME,d.state=CK(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return Bp(e,n,a)}function p(d,f){return Cp(d)||Cp(f)||d>=f?NaN:Bp(e,d,f)}}Dp.exports=DK});var Yp=s(function(B5e,Xp){"use strict";var XK=Ud(),YK=XK();Xp.exports=YK});var nn=s(function(D5e,Zp){"use strict";var HK=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hp=Yp(),ZK=Ud();HK(Hp,"factory",ZK);Zp.exports=Hp});var Cd=s(function(X5e,Qp){"use strict";var QK=F(),$K=require("@stdlib/array/dtypes"),KK=require("@stdlib/array/defaults"),eee=nn(),ree=$K("real_floating_point_and_generic"),tee=QK(eee,ree,KK.get("dtypes.real_floating_point"));Qp.exports=tee});var Kp=s(function(Y5e,$p){"use strict";var iee=Cd(),nee=iee();$p.exports=nee});var ty=s(function(H5e,ry){"use strict";var aee=require("@stdlib/utils/define-nonenumerable-read-only-property"),ey=Kp(),see=Cd();aee(ey,"factory",see);ry.exports=ey});var ay=s(function(Z5e,ny){"use strict";var uee=require("@stdlib/assert/is-plain-object"),oee=require("@stdlib/assert/has-own-property"),vee=require("@stdlib/array/base/assert/contains"),iy=require("@stdlib/string/format");function gee(r,e,t){return uee(t)?oee(t,"dtype")&&(r.dtype=t.dtype,!vee(e,r.dtype))?new TypeError(iy('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),r.dtype)):null:new TypeError(iy("invalid argument. Options argument must be an object. Value: `%s`.",t))}ny.exports=gee});var vy=s(function(Q5e,oy){"use strict";var sy=require("@stdlib/utils/define-nonenumerable-read-only-property"),fee=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,dee=require("@stdlib/assert/is-function"),lee=require("@stdlib/assert/is-string-array").primitives,cee=require("@stdlib/assert/is-collection"),mee=require("@stdlib/array/base/assert/contains"),hee=require("@stdlib/array/base/filled-by"),uy=require("@stdlib/strided/base/unary"),pee=require("@stdlib/array/ctors"),Cs=require("@stdlib/string/format"),yee=ay();function Bs(r,e,t){if(!(this instanceof Bs))return new Bs(r,e,t);if(!dee(r))throw new TypeError(Cs("invalid argument. First argument must be a function. Value: `%s`.",r));if(!lee(e))throw new TypeError(Cs("invalid argument. Second argument must be an array of strings. Value: `%s`.",e));if(!mee(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}sy(Bs.prototype,"generate",function(e,t,i){var n,a,u,o,v,g;if(!fee(e))throw new TypeError(Cs("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if(a={},arguments.length>2&&(v=yee(a,this._dtypes,i),v))throw v;if(u=this._prng,g=a.dtype||this._dtype,g==="generic")return hee(e,c);return n=pee(g),o=new n(e),uy([[t],o],[e],[0,1],u),o;function c(){return u(t)}});sy(Bs.prototype,"assign",function(e,t){if(!cee(t))throw new TypeError(Cs("invalid argument. Second argument must be an array-like object. Value: `%s`.",t));return uy([[e],t],[t.length],[0,1],this._prng),t});oy.exports=Bs});var fy=s(function($5e,gy){"use strict";var qee=vy();gy.exports=qee});var my=s(function(K5e,cy){"use strict";var dy=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),xu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),ga=require("@stdlib/utils/define-nonenumerable-read-only-property"),bee=require("@stdlib/assert/is-string-array").primitives,wee=require("@stdlib/assert/is-function"),See=require("@stdlib/assert/is-method-in"),Oee=require("@stdlib/assert/is-plain-object"),Eee=require("@stdlib/assert/has-own-property"),ly=require("@stdlib/array/base/assert/contains").factory,_ee=require("@stdlib/utils/constant-function"),Nee=require("@stdlib/utils/noop"),Lee=fy(),Ree=Nu(),Ds=require("@stdlib/string/format");function Pee(r,e,t){var i;if(!wee(r))throw new TypeError(Ds("invalid argument. First argument must be a function. Value: `%s`.",r));if(!See(r,"factory"))throw new TypeError(Ds("invalid argument. First argument must have a `%s` method.","factory"));if(!bee(e))throw new TypeError(Ds("invalid argument. Second argument must an array of strings. Value: `%s`.",e));if(!ly(e,t))throw new TypeError(Ds("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return i=ly(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):Oee(arguments[0])?(l=arguments[0],c=r.factory(l),m=p):(o=arguments[0],l={},c=r.factory(o),m=d),Eee(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=Ree),u=new a(c,e,h),l&&l.prng?(ga(m,"seed",null),ga(m,"seedLength",null),dy(m,"state",_ee(null),Nee),ga(m,"stateLength",null),ga(m,"byteLength",null)):(xu(m,"seed",q),xu(m,"seedLength",b),dy(m,"state",W,J),xu(m,"stateLength",w),xu(m,"byteLength",S)),ga(m,"PRNG",c.PRNG),ga(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}}}cy.exports=Pee});var Fr=s(function(eYe,hy){"use strict";var Tee=my();hy.exports=Tee});var Bd=s(function(rYe,Sy){"use strict";var Wr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Au=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),py=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),yy=require("@stdlib/assert/is-plain-object"),jee=require("@stdlib/assert/is-probability").isPrimitive,qy=require("@stdlib/assert/is-function"),by=require("@stdlib/assert/has-own-property"),wy=require("@stdlib/utils/constant-function"),Mee=require("@stdlib/utils/noop"),Gu=T().factory,xee=require("@stdlib/math/base/assert/is-nan"),Aee=require("@stdlib/array/to-json"),Vu=require("@stdlib/string/format");function Gee(){var r,e,t,i;if(arguments.length===0)e=Gu();else if(arguments.length===1&&yy(arguments[0]))if(r=arguments[0],by(r,"prng")){if(!qy(r.prng))throw new TypeError(Vu("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Gu(r);else{if(i=arguments[0],!jee(i))throw new TypeError(Vu("invalid argument. First argument must be a probability. Value: `%s`.",i));if(arguments.length>1){if(r=arguments[1],!yy(r))throw new TypeError(Vu("invalid argument. Options argument must be an object. Value: `%s`.",r));if(by(r,"prng")){if(!qy(r.prng))throw new TypeError(Vu("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Gu(r)}else e=Gu()}return i===void 0?t=m:t=l,Wr(t,"NAME","bernoulli"),r&&r.prng?(Wr(t,"seed",null),Wr(t,"seedLength",null),py(t,"state",wy(null),Mee),Wr(t,"stateLength",null),Wr(t,"byteLength",null),Wr(t,"toJSON",wy(null)),Wr(t,"PRNG",e)):(Au(t,"seed",n),Au(t,"seedLength",a),py(t,"state",v,g),Au(t,"stateLength",u),Au(t,"byteLength",o),Wr(t,"toJSON",c),Wr(t,"PRNG",e),e=e.normalized),t;function n(){return e.seed}function a(){return e.seedLength}function u(){return e.stateLength}function o(){return e.byteLength}function v(){return e.state}function g(h){e.state=h}function c(){var h={};return h.type="PRNG",h.name=t.NAME,h.state=Aee(e.state),i===void 0?h.params=[]:h.params=[i],h}function l(){return e()<=i?1:0}function m(h){return xee(h)||h<0||h>1?NaN:e()<=h?1:0}}Sy.exports=Gee});var Ey=s(function(tYe,Oy){"use strict";var Vee=Bd(),Fee=Vee();Oy.exports=Fee});var an=s(function(iYe,Ny){"use strict";var Wee=require("@stdlib/utils/define-nonenumerable-read-only-property"),_y=Ey(),Iee=Bd();Wee(_y,"factory",Iee);Ny.exports=_y});var Dd=s(function(nYe,Ly){"use strict";var kee=Fr(),zee=require("@stdlib/array/dtypes"),Jee=require("@stdlib/array/defaults"),Uee=an(),Cee=zee("real_and_generic"),Bee=kee(Uee,Cee,Jee.get("dtypes.real"));Ly.exports=Bee});var Py=s(function(aYe,Ry){"use strict";var Dee=Dd(),Xee=Dee();Ry.exports=Xee});var My=s(function(sYe,jy){"use strict";var Yee=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ty=Py(),Hee=Dd();Yee(Ty,"factory",Hee);jy.exports=Ty});var Vy=s(function(uYe,Gy){"use strict";var Zee=require("@stdlib/math/base/special/sqrt"),xy=require("@stdlib/math/base/special/exp"),Qee=require("@stdlib/math/base/special/ln"),Ay=.00991256303526217;function $ee(r,e){var t,i,n;for(i=xy(-.5*e*e),t=[],t.push(Ay/i),t.push(e),n=2;n=0&&g<=1&&(v=r(),n=Hd(u,4),c=8*t-12,c=1-n/c,v<=c?i=!1:(c+=.5*Hd(n/(8*t-8),2),v=oq(v)&&(i=!1))));return g}vq.exports=Nre});var dq=s(function(pYe,fq){"use strict";var Lre=require("@stdlib/math/base/special/pow"),Iu=require("@stdlib/math/base/special/ln");function Rre(r,e,t,i){var n,a,u,o,v,g,c,l,m,h,p;for(o=t-1,v=i-1,g=o+v,c=g*Iu(g),u=o/g,n=.5/Lre(g,.5),a=!0;a===!0;)l=e(),h=u+l*n,h>=0&&h<=1&&(m=r(),p=o*Iu(h/o),p+=v*Iu((1-h)/v),p+=c+.5*l*l,p>=Iu(m)&&(a=!1));return h}fq.exports=Rre});var mq=s(function(yYe,cq){"use strict";var Zd=require("@stdlib/math/base/special/exp"),lq=require("@stdlib/math/base/special/pow"),Qd=require("@stdlib/math/base/special/ln");function Pre(r,e,t){for(var i,n,a,u,o,v,g;;)if(u=r(),o=r(),v=lq(u,1/e),g=lq(o,1/t),a=v+g,a<=1)return a>0?v/a:(i=Qd(u)/e,n=Qd(o)/t,i>n?(n-=i,i=0):(i-=n,n=0),Zd(i-Qd(Zd(i)+Zd(n))))}cq.exports=Pre});var yq=s(function(qYe,pq){"use strict";var hq=uq(),Tre=gq(),jre=dq(),Mre=mq();function xre(r,e,t,i){var n,a;return t===i&&t>1.5?Tre(r,e,t):t>1&&i>1?jre(r,e,t,i):t<1&&i<1?Mre(r,t,i):(n=hq(r,e,t),a=hq(r,e,i),n/(n+a))}pq.exports=xre});var rl=s(function(bYe,Rq){"use strict";var Ir=require("@stdlib/utils/define-nonenumerable-read-only-property"),ku=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),qq=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),bq=require("@stdlib/assert/is-plain-object"),wq=require("@stdlib/assert/is-boolean").isPrimitive,Sq=require("@stdlib/assert/is-function"),fa=require("@stdlib/assert/has-own-property"),Oq=require("@stdlib/utils/constant-function"),Are=require("@stdlib/utils/noop"),Eq=Q().factory,zu=T().factory,_q=require("@stdlib/math/base/assert/is-nan"),$d=require("@stdlib/blas/base/gcopy"),Kd=require("@stdlib/array/uint32"),el=require("@stdlib/assert/is-uint32array"),Nq=require("@stdlib/object/assign"),Gre=require("@stdlib/array/to-json"),kr=require("@stdlib/string/format"),Vre=tq(),Lq=yq();function Fre(){var r,e,t,i,n,a,u,o,v;if(o=!0,arguments.length===0)n={copy:!1},a=zu(n);else if(arguments.length===1){if(n=arguments[0],!bq(n))throw new TypeError(kr("invalid argument. Options argument must be an object. Value: `%s`.",n));if(fa(n,"copy")&&!wq(n.copy))throw new TypeError(kr("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(fa(n,"prng")){if(!Sq(n.prng))throw new TypeError(kr("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));a=n.prng}else{if(fa(n,"state")&&!el(n.state))throw new TypeError(kr("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=Nq({},n),n.copy===!1?o=!1:n.state&&(n.state=$d(n.state.length,n.state,1,new Kd(n.state.length),1)),n.copy=!1,a=zu(n)}}else{if(t=arguments[0],i=arguments[1],v=Vre(t,i),v)throw v;if(arguments.length>2){if(n=arguments[2],!bq(n))throw new TypeError(kr("invalid argument. Options argument must be an object. Value: `%s`.",n));if(fa(n,"copy")&&!wq(n.copy))throw new TypeError(kr("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(fa(n,"prng")){if(!Sq(n.prng))throw new TypeError(kr("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));a=n.prng}else{if(fa(n,"state")&&!el(n.state))throw new TypeError(kr("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=Nq({},n),n.copy===!1?o=!1:n.state&&(n.state=$d(n.state.length,n.state,1,new Kd(n.state.length),1)),n.copy=!1,a=zu(n)}}else n={copy:!1},a=zu(n)}return n&&n.prng?e=Eq({prng:n.prng}):(n.state?r=n.state:(r=a.state,a.state=r),e=Eq({state:r,copy:!1})),t===void 0?u=y:u=f,Ir(u,"NAME","beta"),n&&n.prng?(Ir(u,"seed",null),Ir(u,"seedLength",null),qq(u,"state",Oq(null),Are),Ir(u,"stateLength",null),Ir(u,"byteLength",null),Ir(u,"toJSON",Oq(null)),Ir(u,"PRNG",a)):(ku(u,"seed",g),ku(u,"seedLength",c),qq(u,"state",h,p),ku(u,"stateLength",l),ku(u,"byteLength",m),Ir(u,"toJSON",d),Ir(u,"PRNG",a),a=a.normalized),u;function g(){return a.seed}function c(){return a.seedLength}function l(){return a.stateLength}function m(){return a.byteLength}function h(){return a.state}function p(q){if(!el(q))throw new TypeError(kr("invalid argument. Must provide a Uint32Array. Value: `%s`.",q));o&&(q=$d(q.length,q,1,new Kd(q.length),1)),a.state=q}function d(){var q={};return q.type="PRNG",q.name=u.NAME,q.state=Gre(a.state),t===void 0?q.params=[]:q.params=[t,i],q}function f(){return Lq(a,e,t,i)}function y(q,b){return _q(q)||_q(b)||q<=0||b<=0?NaN:Lq(a,e,q,b)}}Rq.exports=Fre});var Tq=s(function(wYe,Pq){"use strict";var Wre=rl(),Ire=Wre();Pq.exports=Ire});var un=s(function(SYe,Mq){"use strict";var kre=require("@stdlib/utils/define-nonenumerable-read-only-property"),jq=Tq(),zre=rl();kre(jq,"factory",zre);Mq.exports=jq});var tl=s(function(OYe,xq){"use strict";var Jre=F(),Ure=require("@stdlib/array/dtypes"),Cre=require("@stdlib/array/defaults"),Bre=un(),Dre=Ure("real_floating_point_and_generic"),Xre=Jre(Bre,Dre,Cre.get("dtypes.real_floating_point"));xq.exports=Xre});var Gq=s(function(EYe,Aq){"use strict";var Yre=tl(),Hre=Yre();Aq.exports=Hre});var Wq=s(function(_Ye,Fq){"use strict";var Zre=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vq=Gq(),Qre=tl();Zre(Vq,"factory",Qre);Fq.exports=Vq});var Jq=s(function(NYe,zq){"use strict";var Iq=require("@stdlib/assert/is-positive-number").isPrimitive,kq=require("@stdlib/string/format");function $re(r,e){return Iq(r)?Iq(e)?null:new TypeError(kq("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(kq("invalid argument. First argument must be a positive number. Value: `%s`.",r))}zq.exports=$re});var Bq=s(function(LYe,Cq){"use strict";var Uq=require("@stdlib/math/base/special/ln");function Kre(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+Uq(l)),c=r(),(c2){if(n=arguments[2],!Xq(n))throw new TypeError(Jr("invalid argument. Options argument must be an object. Value: `%s`.",n));if(da(n,"copy")&&!Yq(n.copy))throw new TypeError(Jr("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(da(n,"prng")){if(!Hq(n.prng))throw new TypeError(Jr("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));a=n.prng}else{if(da(n,"state")&&!il(n.state))throw new TypeError(Jr("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=eb({},n),n.copy===!1?o=!1:n.state&&(n.state=al(n.state.length,n.state,1,new sl(n.state.length),1)),n.copy=!1,a=Uu(n)}}else n={copy:!1},a=Uu(n)}return n&&n.prng?t=Qq({prng:n.prng}):(n.state?r=n.state:(r=a.state,a.state=r),t=Qq({state:r,copy:!1})),e===void 0?u=w:(e>=1?(u=q,c=e-Bu):(u=b,c=e+1-Bu),g=1/nl(9*c)),zr(u,"NAME","gamma"),n&&n.prng?(zr(u,"seed",null),zr(u,"seedLength",null),Dq(u,"state",Zq(null),ete),zr(u,"stateLength",null),zr(u,"byteLength",null),zr(u,"toJSON",Zq(null)),zr(u,"PRNG",a)):(Ju(u,"seed",l),Ju(u,"seedLength",m),Dq(u,"state",d,f),Ju(u,"stateLength",h),Ju(u,"byteLength",p),zr(u,"toJSON",y),zr(u,"PRNG",a),a=a.normalized),u;function l(){return a.seed}function m(){return a.seedLength}function h(){return a.stateLength}function p(){return a.byteLength}function d(){return a.state}function f(S){if(!il(S))throw new TypeError(Jr("invalid argument. Must provide a Uint32Array. Value: `%s`.",S));o&&(S=al(S.length,S,1,new sl(S.length),1)),a.state=S}function y(){var S={};return S.type="PRNG",S.name=u.NAME,S.state=rte(a.state),e===void 0?S.params=[]:S.params=[e,i],S}function q(){return Cu(a,t,i,c,g)}function b(){return Cu(a,t,i,c,g)*Kq(a(),1/e)}function w(S,W){var J,x;return $q(S)||$q(W)||S<=0||W<=0?NaN:S<1?(x=S+1-Bu,J=1/nl(9*x),Cu(a,t,W,x,J)*Kq(a(),1/S)):(x=S-Bu,J=1/nl(9*x),Cu(a,t,W,x,J))}}rb.exports=ite});var ib=s(function(PYe,tb){"use strict";var nte=ul(),ate=nte();tb.exports=ate});var Ce=s(function(TYe,ab){"use strict";var ste=require("@stdlib/utils/define-nonenumerable-read-only-property"),nb=ib(),ute=ul();ste(nb,"factory",ute);ab.exports=nb});var vb=s(function(jYe,ob){"use strict";var sb=require("@stdlib/assert/is-positive-number").isPrimitive,ub=require("@stdlib/string/format");function ote(r,e){return sb(r)?sb(e)?null:new TypeError(ub("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(ub("invalid argument. First argument must be a positive number. Value: `%s`.",r))}ob.exports=ote});var fb=s(function(MYe,gb){"use strict";function vte(r,e,t){return r(e,1)/r(t,1)}gb.exports=vte});var ol=s(function(xYe,yb){"use strict";var mt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Du=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),db=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),lb=require("@stdlib/assert/is-plain-object"),cb=require("@stdlib/utils/constant-function"),gte=require("@stdlib/utils/noop"),Xu=Ce().factory,mb=require("@stdlib/math/base/assert/is-nan"),fte=require("@stdlib/array/to-json"),hb=require("@stdlib/string/format"),dte=vb(),pb=fb();function lte(){var r,e,t,i,n,a,u;if(arguments.length===0)r=Xu();else if(arguments.length===1){if(i=arguments[0],!lb(i))throw new TypeError(hb("invalid argument. Options argument must be an object. Value: `%s`.",i));r=Xu(i)}else{if(e=arguments[0],t=arguments[1],u=dte(e,t),u)throw u;if(arguments.length>2){if(i=arguments[2],!lb(i))throw new TypeError(hb("invalid argument. Options argument must be an object. Value: `%s`.",i));r=Xu(i)}else r=Xu()}return e===void 0?a=d:a=p,n=r.PRNG,mt(a,"NAME","betaprime"),i&&i.prng?(mt(a,"seed",null),mt(a,"seedLength",null),db(a,"state",cb(null),gte),mt(a,"stateLength",null),mt(a,"byteLength",null),mt(a,"toJSON",cb(null))):(Du(a,"seed",o),Du(a,"seedLength",v),db(a,"state",l,m),Du(a,"stateLength",g),Du(a,"byteLength",c),mt(a,"toJSON",h)),mt(a,"PRNG",n),a;function o(){return n.seed}function v(){return n.seedLength}function g(){return n.stateLength}function c(){return n.byteLength}function l(){return n.state}function m(f){n.state=f}function h(){var f={};return f.type="PRNG",f.name=a.NAME,f.state=fte(n.state),e===void 0?f.params=[]:f.params=[e,t],f}function p(){return pb(r,e,t)}function d(f,y){return mb(f)||mb(y)||f<=0||y<=0?NaN:pb(r,f,y)}}yb.exports=lte});var bb=s(function(AYe,qb){"use strict";var cte=ol(),mte=cte();qb.exports=mte});var on=s(function(GYe,Sb){"use strict";var hte=require("@stdlib/utils/define-nonenumerable-read-only-property"),wb=bb(),pte=ol();hte(wb,"factory",pte);Sb.exports=wb});var vl=s(function(VYe,Ob){"use strict";var yte=F(),qte=require("@stdlib/array/dtypes"),bte=require("@stdlib/array/defaults"),wte=on(),Ste=qte("real_floating_point_and_generic"),Ote=yte(wte,Ste,bte.get("dtypes.real_floating_point"));Ob.exports=Ote});var _b=s(function(FYe,Eb){"use strict";var Ete=vl(),_te=Ete();Eb.exports=_te});var Rb=s(function(WYe,Lb){"use strict";var Nte=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nb=_b(),Lte=vl();Nte(Nb,"factory",Lte);Lb.exports=Nb});var jb=s(function(IYe,Tb){"use strict";var Rte=require("@stdlib/assert/is-positive-integer").isPrimitive,Pte=require("@stdlib/assert/is-probability").isPrimitive,Pb=require("@stdlib/string/format");function Tte(r,e){return Rte(r)?Pte(e)?null:new TypeError(Pb("invalid argument. Second argument must be a probability. Value: `%s`.",e)):new TypeError(Pb("invalid argument. First argument must be a positive integer. Value: `%s`.",e))}Tb.exports=Tte});var xb=s(function(kYe,Mb){"use strict";function jte(r,e,t){var i=0,n;for(n=0;n=p?A=r()-.5:(A=G/p-.93,A=Fte(A)*.5-A,G=p*r()),l=.5-fl(A),S=gl(A*(2*d/l+f)+y),!(S<0||S>e))if(G=G*i/(d/(l*l)+f),m=fl(S-W),m>15){if(G=Yu(G),o=m/u,v=(m/3+.625)*m,v+=Ite,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}}}Vb.exports=kte});var kb=s(function(UYe,Ib){"use strict";var zte=xb(),Jte=Fb();function Wb(r,e,t){return t>.5?e-Wb(r,e,1-t):e*t<10?zte(r,e,t):Jte(r,e,t)}Ib.exports=Wb});var dl=s(function(CYe,Yb){"use strict";var Ur=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),zb=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Jb=require("@stdlib/assert/is-plain-object"),Ub=require("@stdlib/assert/is-function"),Cb=require("@stdlib/assert/has-own-property"),Bb=require("@stdlib/utils/constant-function"),Ute=require("@stdlib/utils/noop"),Db=require("@stdlib/math/base/assert/is-nan"),Cte=require("@stdlib/math/base/assert/is-positive-integer"),Bte=require("@stdlib/math/base/assert/is-probability"),Qu=T().factory,Dte=require("@stdlib/array/to-json"),$u=require("@stdlib/string/format"),Xte=jb(),Xb=kb();function Yte(){var r,e,t,i,n,a;if(arguments.length===0)e=Qu();else if(arguments.length===1){if(r=arguments[0],!Jb(r))throw new TypeError($u("invalid argument. Options argument must be an object. Value: `%s`.",r));if(Cb(r,"prng")){if(!Ub(r.prng))throw new TypeError($u("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Qu(r)}else{if(n=arguments[0],a=arguments[1],i=Xte(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!Jb(r))throw new TypeError($u("invalid argument. Options argument must be an object. Value: `%s`.",r));if(Cb(r,"prng")){if(!Ub(r.prng))throw new TypeError($u("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Qu(r)}else e=Qu()}return n===void 0?t=p:t=h,Ur(t,"NAME","binomial"),r&&r.prng?(Ur(t,"seed",null),Ur(t,"seedLength",null),zb(t,"state",Bb(null),Ute),Ur(t,"stateLength",null),Ur(t,"byteLength",null),Ur(t,"toJSON",Bb(null)),Ur(t,"PRNG",e)):(Zu(t,"seed",u),Zu(t,"seedLength",o),zb(t,"state",c,l),Zu(t,"stateLength",v),Zu(t,"byteLength",g),Ur(t,"toJSON",m),Ur(t,"PRNG",e),e=e.normalized),t;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=t.NAME,d.state=Dte(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return Xb(e,n,a)}function p(d,f){return Db(d)||Db(f)||!Cte(d)||!Bte(f)?NaN:Xb(e,d,f)}}Yb.exports=Yte});var Zb=s(function(BYe,Hb){"use strict";var Hte=dl(),Zte=Hte();Hb.exports=Zte});var la=s(function(DYe,$b){"use strict";var Qte=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qb=Zb(),$te=dl();Qte(Qb,"factory",$te);$b.exports=Qb});var ll=s(function(XYe,Kb){"use strict";var Kte=F(),eie=require("@stdlib/array/dtypes"),rie=require("@stdlib/array/defaults"),tie=la(),iie=eie("real_and_generic"),nie=Kte(tie,iie,rie.get("dtypes.real"));Kb.exports=nie});var rw=s(function(YYe,ew){"use strict";var aie=ll(),sie=aie();ew.exports=sie});var nw=s(function(HYe,iw){"use strict";var uie=require("@stdlib/utils/define-nonenumerable-read-only-property"),tw=rw(),oie=ll();uie(tw,"factory",oie);iw.exports=tw});var uw=s(function(ZYe,sw){"use strict";var vie=require("@stdlib/assert/is-number").isPrimitive,gie=require("@stdlib/assert/is-positive-number").isPrimitive,aw=require("@stdlib/string/format"),fie=require("@stdlib/assert/is-nan");function die(r,e){return!vie(r)||fie(r)?new TypeError(aw("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):gie(e)?null:new TypeError(aw("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}sw.exports=die});var vw=s(function(QYe,ow){"use strict";var lie=require("@stdlib/math/base/special/tan"),cie=require("@stdlib/constants/float64/pi");function mie(r,e,t){return e+t*lie(cie*(r()-.5))}ow.exports=mie});var cl=s(function($Ye,pw){"use strict";var ht=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ku=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),gw=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),fw=require("@stdlib/assert/is-plain-object"),dw=require("@stdlib/assert/is-function"),lw=require("@stdlib/assert/has-own-property"),cw=require("@stdlib/utils/constant-function"),hie=require("@stdlib/utils/noop"),mw=require("@stdlib/math/base/assert/is-nan"),ca=Q().factory,pie=require("@stdlib/array/to-json"),eo=require("@stdlib/string/format"),yie=uw(),hw=vw();function qie(){var r,e,t,i,n,a,u;if(arguments.length===0)e=ca();else if(arguments.length===1){if(t=arguments[0],!fw(t))throw new TypeError(eo("invalid argument. Options argument must be an object. Value: `%s`.",t));if(lw(t,"prng")){if(!dw(t.prng))throw new TypeError(eo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));e=ca({prng:t.prng})}else e=ca(t)}else{if(u=arguments[0],r=arguments[1],a=yie(u,r),a)throw a;if(arguments.length>2){if(t=arguments[2],!fw(t))throw new TypeError(eo("invalid argument. Options argument must be an object. Value: `%s`.",t));if(lw(t,"prng")){if(!dw(t.prng))throw new TypeError(eo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));e=ca({prng:t.prng})}else e=ca(t)}else e=ca()}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),gw(n,"state",cw(null),hie),ht(n,"stateLength",null),ht(n,"byteLength",null),ht(n,"toJSON",cw(null))):(Ku(n,"seed",o),Ku(n,"seedLength",v),gw(n,"state",l,m),Ku(n,"stateLength",g),Ku(n,"byteLength",c),ht(n,"toJSON",h)),ht(n,"PRNG",i),n;function o(){return i.seed}function v(){return i.seedLength}function g(){return i.stateLength}function c(){return i.byteLength}function l(){return i.state}function m(f){i.state=f}function h(){var f={};return f.type="PRNG",f.name=n.NAME,f.state=pie(i.state),u===void 0?f.params=[]:f.params=[u,r],f}function p(){return hw(e,u,r)}function d(f,y){return mw(f)||mw(y)||y<=0?NaN:hw(e,f,y)}}pw.exports=qie});var qw=s(function(KYe,yw){"use strict";var bie=cl(),wie=bie();yw.exports=wie});var ma=s(function(e6e,ww){"use strict";var Sie=require("@stdlib/utils/define-nonenumerable-read-only-property"),bw=qw(),Oie=cl();Sie(bw,"factory",Oie);ww.exports=bw});var ml=s(function(r6e,Sw){"use strict";var Eie=F(),_ie=require("@stdlib/array/dtypes"),Nie=require("@stdlib/array/defaults"),Lie=ma(),Rie=_ie("real_floating_point_and_generic"),Pie=Eie(Lie,Rie,Nie.get("dtypes.real_floating_point"));Sw.exports=Pie});var Ew=s(function(t6e,Ow){"use strict";var Tie=ml(),jie=Tie();Ow.exports=jie});var Lw=s(function(i6e,Nw){"use strict";var Mie=require("@stdlib/utils/define-nonenumerable-read-only-property"),_w=Ew(),xie=ml();Mie(_w,"factory",xie);Nw.exports=_w});var hl=s(function(n6e,xw){"use strict";var pt=require("@stdlib/utils/define-nonenumerable-read-only-property"),ro=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Rw=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Aie=require("@stdlib/assert/is-positive-number").isPrimitive,Pw=require("@stdlib/assert/is-plain-object"),Tw=require("@stdlib/assert/is-function"),jw=require("@stdlib/assert/has-own-property"),Mw=require("@stdlib/utils/constant-function"),Gie=require("@stdlib/utils/noop"),Vie=require("@stdlib/math/base/assert/is-nan"),ha=Ce().factory,Fie=require("@stdlib/array/to-json"),to=require("@stdlib/string/format");function Wie(){var r,e,t,i,n;if(arguments.length===0)r=ha();else if(arguments.length===1&&Pw(arguments[0]))if(t=arguments[0],jw(t,"prng")){if(!Tw(t.prng))throw new TypeError(to("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],!Aie(n))throw new TypeError(to("invalid argument. First argument must be a positive number. Value: `%s`.",n));if(arguments.length>1){if(t=arguments[1],!Pw(t))throw new TypeError(to("invalid argument. Options argument must be an object. Value: `%s`.",t));if(jw(t,"prng")){if(!Tw(t.prng))throw new TypeError(to("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));r=ha(n/2,.5,{prng:t.prng})}else r=ha(n/2,.5,t)}else r=ha(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),Rw(i,"state",Mw(null),Gie),pt(i,"stateLength",null),pt(i,"byteLength",null),pt(i,"toJSON",Mw(null))):(ro(i,"seed",a),ro(i,"seedLength",u),Rw(i,"state",g,c),ro(i,"stateLength",o),ro(i,"byteLength",v),pt(i,"toJSON",l)),pt(i,"PRNG",e),i;function a(){return e.seed}function u(){return e.seedLength}function o(){return e.stateLength}function v(){return e.byteLength}function g(){return e.state}function c(p){e.state=p}function l(){var p={};return p.type="PRNG",p.name=i.NAME,p.state=Fie(e.state),n===void 0?p.params=[]:p.params=[n],p}function m(){return r()}function h(p){return Vie(p)||p<=0?NaN:r(p/2,.5)}}xw.exports=Wie});var Gw=s(function(a6e,Aw){"use strict";var Iie=hl(),kie=Iie();Aw.exports=kie});var Xe=s(function(s6e,Fw){"use strict";var zie=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vw=Gw(),Jie=hl();zie(Vw,"factory",Jie);Fw.exports=Vw});var pl=s(function(u6e,Cw){"use strict";var yt=require("@stdlib/utils/define-nonenumerable-read-only-property"),io=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Ww=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Uie=require("@stdlib/assert/is-positive-number").isPrimitive,Iw=require("@stdlib/assert/is-plain-object"),kw=require("@stdlib/assert/is-function"),zw=require("@stdlib/assert/has-own-property"),Jw=require("@stdlib/utils/constant-function"),Cie=require("@stdlib/utils/noop"),Bie=require("@stdlib/math/base/assert/is-nan"),pa=Xe().factory,Die=require("@stdlib/array/to-json"),Uw=require("@stdlib/math/base/special/sqrt"),no=require("@stdlib/string/format");function Xie(){var r,e,t,i,n;if(arguments.length===0)r=pa();else if(arguments.length===1&&Iw(arguments[0]))if(t=arguments[0],zw(t,"prng")){if(!kw(t.prng))throw new TypeError(no("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));r=pa({prng:t.prng})}else r=pa(t);else{if(n=arguments[0],!Uie(n))throw new TypeError(no("invalid argument. First argument must be a positive number. Value: `%s`.",n));if(arguments.length>1){if(t=arguments[1],!Iw(t))throw new TypeError(no("invalid argument. Options argument must be an object. Value: `%s`.",t));if(zw(t,"prng")){if(!kw(t.prng))throw new TypeError(no("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));r=pa(n,{prng:t.prng})}else r=pa(n,t)}else r=pa(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),Ww(i,"state",Jw(null),Cie),yt(i,"stateLength",null),yt(i,"byteLength",null),yt(i,"toJSON",Jw(null))):(io(i,"seed",a),io(i,"seedLength",u),Ww(i,"state",g,c),io(i,"stateLength",o),io(i,"byteLength",v),yt(i,"toJSON",l)),yt(i,"PRNG",e),i;function a(){return e.seed}function u(){return e.seedLength}function o(){return e.stateLength}function v(){return e.byteLength}function g(){return e.state}function c(p){e.state=p}function l(){var p={};return p.type="PRNG",p.name=i.NAME,p.state=Die(e.state),n===void 0?p.params=[]:p.params=[n],p}function m(){return Uw(r())}function h(p){return Bie(p)||p<=0?NaN:Uw(r(p))}}Cw.exports=Xie});var Dw=s(function(o6e,Bw){"use strict";var Yie=pl(),Hie=Yie();Bw.exports=Hie});var vn=s(function(v6e,Yw){"use strict";var Zie=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xw=Dw(),Qie=pl();Zie(Xw,"factory",Qie);Yw.exports=Xw});var yl=s(function(g6e,Hw){"use strict";var $ie=Fr(),Kie=require("@stdlib/array/dtypes"),ene=require("@stdlib/array/defaults"),rne=vn(),tne=Kie("real_floating_point_and_generic"),ine=$ie(rne,tne,ene.get("dtypes.real_floating_point"));Hw.exports=ine});var Qw=s(function(f6e,Zw){"use strict";var nne=yl(),ane=nne();Zw.exports=ane});var eS=s(function(d6e,Kw){"use strict";var sne=require("@stdlib/utils/define-nonenumerable-read-only-property"),$w=Qw(),une=yl();sne($w,"factory",une);Kw.exports=$w});var ql=s(function(l6e,rS){"use strict";var one=Fr(),vne=require("@stdlib/array/dtypes"),gne=require("@stdlib/array/defaults"),fne=Xe(),dne=vne("real_floating_point_and_generic"),lne=one(fne,dne,gne.get("dtypes.real_floating_point"));rS.exports=lne});var iS=s(function(c6e,tS){"use strict";var cne=ql(),mne=cne();tS.exports=mne});var sS=s(function(m6e,aS){"use strict";var hne=require("@stdlib/utils/define-nonenumerable-read-only-property"),nS=iS(),pne=ql();hne(nS,"factory",pne);aS.exports=nS});var vS=s(function(h6e,oS){"use strict";var yne=require("@stdlib/assert/is-number").isPrimitive,qne=require("@stdlib/assert/is-positive-number").isPrimitive,uS=require("@stdlib/string/format"),bne=require("@stdlib/assert/is-nan");function wne(r,e){return!yne(r)||bne(r)?new TypeError(uS("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):qne(e)?null:new TypeError(uS("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}oS.exports=wne});var fS=s(function(p6e,gS){"use strict";var Sne=require("@stdlib/stats/base/dists/cosine/quantile");function One(r,e,t){return Sne(r(),e,t)}gS.exports=One});var bl=s(function(y6e,qS){"use strict";var Cr=require("@stdlib/utils/define-nonenumerable-read-only-property"),ao=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),dS=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),lS=require("@stdlib/assert/is-plain-object"),cS=require("@stdlib/assert/is-function"),mS=require("@stdlib/assert/has-own-property"),hS=require("@stdlib/utils/constant-function"),Ene=require("@stdlib/utils/noop"),so=T().factory,pS=require("@stdlib/math/base/assert/is-nan"),_ne=require("@stdlib/array/to-json"),uo=require("@stdlib/string/format"),Nne=vS(),yS=fS();function Lne(){var r,e,t,i,n,a;if(arguments.length===0)e=so();else if(arguments.length===1){if(r=arguments[0],!lS(r))throw new TypeError(uo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(mS(r,"prng")){if(!cS(r.prng))throw new TypeError(uo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=so(r)}else{if(n=arguments[0],a=arguments[1],i=Nne(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!lS(r))throw new TypeError(uo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(mS(r,"prng")){if(!cS(r.prng))throw new TypeError(uo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=so(r)}else e=so()}return n===void 0?t=p:t=h,Cr(t,"NAME","cosine"),r&&r.prng?(Cr(t,"seed",null),Cr(t,"seedLength",null),dS(t,"state",hS(null),Ene),Cr(t,"stateLength",null),Cr(t,"byteLength",null),Cr(t,"toJSON",hS(null)),Cr(t,"PRNG",e)):(ao(t,"seed",u),ao(t,"seedLength",o),dS(t,"state",c,l),ao(t,"stateLength",v),ao(t,"byteLength",g),Cr(t,"toJSON",m),Cr(t,"PRNG",e),e=e.normalized),t;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=t.NAME,d.state=_ne(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return yS(e,n,a)}function p(d,f){return pS(d)||pS(f)||f<=0?NaN:yS(e,d,f)}}qS.exports=Lne});var wS=s(function(q6e,bS){"use strict";var Rne=bl(),Pne=Rne();bS.exports=Pne});var gn=s(function(b6e,OS){"use strict";var Tne=require("@stdlib/utils/define-nonenumerable-read-only-property"),SS=wS(),jne=bl();Tne(SS,"factory",jne);OS.exports=SS});var wl=s(function(w6e,ES){"use strict";var Mne=F(),xne=require("@stdlib/array/dtypes"),Ane=require("@stdlib/array/defaults"),Gne=gn(),Vne=xne("real_floating_point_and_generic"),Fne=Mne(Gne,Vne,Ane.get("dtypes.real_floating_point"));ES.exports=Fne});var NS=s(function(S6e,_S){"use strict";var Wne=wl(),Ine=Wne();_S.exports=Ine});var PS=s(function(O6e,RS){"use strict";var kne=require("@stdlib/utils/define-nonenumerable-read-only-property"),LS=NS(),zne=wl();kne(LS,"factory",zne);RS.exports=LS});var xS=s(function(E6e,MS){"use strict";var TS=require("@stdlib/assert/is-integer").isPrimitive,Sl=require("@stdlib/string/format"),jS=require("@stdlib/assert/is-nan");function Jne(r,e){return!TS(r)||jS(r)?new TypeError(Sl("invalid argument. First argument must be an integer and not NaN. Value: `%s`.",r)):!TS(e)||jS(e)?new TypeError(Sl("invalid argument. Second argument must be an integer and not NaN. Value: `%s`.",e)):r>e?new RangeError(Sl("invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d, %d]`.",r,e)):null}MS.exports=Jne});var VS=s(function(_6e,GS){"use strict";var Ol=require("@stdlib/constants/float64/max-safe-integer"),ya=require("@stdlib/math/base/special/floor");function AS(r,e,t){var i,n,a,u,o,v,g,c,l;if(a=t-e,a===0)return e;if(g=r.MIN,c=r.MAX,n=c-g,n===a)return r()-g+e;if(nOl/v)&&(l*=v,i+=l,!(i>a)))return i+e}for(n===Ol?(o=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}GS.exports=AS});var El=s(function(N6e,CS){"use strict";var Br=require("@stdlib/utils/define-nonenumerable-read-only-property"),oo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),FS=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),WS=require("@stdlib/assert/is-plain-object"),IS=require("@stdlib/assert/is-function"),kS=require("@stdlib/assert/has-own-property"),zS=require("@stdlib/utils/constant-function"),Une=require("@stdlib/utils/noop"),vo=T().factory,JS=require("@stdlib/math/base/assert/is-nan"),qa=require("@stdlib/math/base/assert/is-integer"),Cne=require("@stdlib/array/to-json"),qt=require("@stdlib/string/format"),Bne=xS(),US=VS();function Dne(){var r,e,t,i,n,a;if(arguments.length===0)e=vo();else if(arguments.length===1){if(r=arguments[0],!WS(r))throw new TypeError(qt("invalid argument. Options argument must be an object. Value: `%s`.",r));if(kS(r,"prng")){if(!IS(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=vo(r)}else{if(n=arguments[0],a=arguments[1],i=Bne(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!WS(r))throw new TypeError(qt("invalid argument. Options argument must be an object. Value: `%s`.",r));if(kS(r,"prng")){if(!IS(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=vo(r)}else e=vo()}return n===void 0?t=p:t=h,Br(t,"NAME","discrete-uniform"),r&&r.prng?(Br(t,"seed",null),Br(t,"seedLength",null),FS(t,"state",zS(null),Une),Br(t,"stateLength",null),Br(t,"byteLength",null),Br(t,"toJSON",zS(null)),Br(t,"PRNG",e)):(oo(t,"seed",u),oo(t,"seedLength",o),FS(t,"state",c,l),oo(t,"stateLength",v),oo(t,"byteLength",g),Br(t,"toJSON",m),Br(t,"PRNG",e)),t;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=t.NAME,d.state=Cne(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return US(e,n,a)}function p(d,f){return JS(d)||JS(f)||!qa(d)||!qa(f)||d>f?NaN:US(e,d,f)}}CS.exports=Dne});var DS=s(function(L6e,BS){"use strict";var Xne=El(),Yne=Xne();BS.exports=Yne});var fn=s(function(R6e,YS){"use strict";var Hne=require("@stdlib/utils/define-nonenumerable-read-only-property"),XS=DS(),Zne=El();Hne(XS,"factory",Zne);YS.exports=XS});var _l=s(function(P6e,HS){"use strict";var Qne=F(),$ne=require("@stdlib/array/dtypes"),Kne=require("@stdlib/array/defaults"),eae=fn(),rae=$ne("real_and_generic"),tae=Qne(eae,rae,Kne.get("dtypes.real"));HS.exports=tae});var QS=s(function(T6e,ZS){"use strict";var iae=_l(),nae=iae();ZS.exports=nae});var eO=s(function(j6e,KS){"use strict";var aae=require("@stdlib/utils/define-nonenumerable-read-only-property"),$S=QS(),sae=_l();aae($S,"factory",sae);KS.exports=$S});var iO=s(function(M6e,tO){"use strict";var uae=require("@stdlib/assert/is-positive-number").isPrimitive,oae=require("@stdlib/assert/is-positive-integer").isPrimitive,rO=require("@stdlib/string/format");function vae(r,e){return oae(r)?uae(e)?null:new TypeError(rO("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(rO("invalid argument. First argument must be a positive integer. Value: `%s`.",r))}tO.exports=vae});var aO=s(function(x6e,nO){"use strict";var gae=require("@stdlib/math/base/special/ln");function fae(r,e,t){var i,n;for(i=1,n=0;n2){if(t=arguments[2],!uO(t))throw new TypeError(lo("invalid argument. Options argument must be an object. Value: `%s`.",t));if(vO(t,"prng")){if(!oO(t.prng))throw new TypeError(lo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));e=t.prng}else e=fo(t)}else e=fo()}return a===void 0?i=p:i=h,Dr(i,"NAME","erlang"),t&&t.prng?(Dr(i,"seed",null),Dr(i,"seedLength",null),sO(i,"state",gO(null),dae),Dr(i,"stateLength",null),Dr(i,"byteLength",null),Dr(i,"toJSON",gO(null)),Dr(i,"PRNG",e)):(go(i,"seed",u),go(i,"seedLength",o),sO(i,"state",c,l),go(i,"stateLength",v),go(i,"byteLength",g),Dr(i,"toJSON",m),Dr(i,"PRNG",e),e=e.normalized),i;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=i.NAME,d.state=cae(e.state),a===void 0?d.params=[]:d.params=[a,r],d}function h(){return dO(e,a,r)}function p(d,f){return fO(d)||fO(f)||!lae(d)||f<=0?NaN:dO(e,d,f)}}lO.exports=hae});var mO=s(function(G6e,cO){"use strict";var pae=Nl(),yae=pae();cO.exports=yae});var ba=s(function(V6e,pO){"use strict";var qae=require("@stdlib/utils/define-nonenumerable-read-only-property"),hO=mO(),bae=Nl();qae(hO,"factory",bae);pO.exports=hO});var Ll=s(function(F6e,yO){"use strict";var wae=F(),Sae=require("@stdlib/array/dtypes"),Oae=require("@stdlib/array/defaults"),Eae=ba(),_ae=Sae("real_floating_point_and_generic"),Nae=wae(Eae,_ae,Oae.get("dtypes.real_floating_point"));yO.exports=Nae});var bO=s(function(W6e,qO){"use strict";var Lae=Ll(),Rae=Lae();qO.exports=Rae});var OO=s(function(I6e,SO){"use strict";var Pae=require("@stdlib/utils/define-nonenumerable-read-only-property"),wO=bO(),Tae=Ll();Pae(wO,"factory",Tae);SO.exports=wO});var _O=s(function(k6e,EO){"use strict";var jae=require("@stdlib/math/base/special/ln");function Mae(r,e){return-jae(1-r())/e}EO.exports=Mae});var Rl=s(function(z6e,MO){"use strict";var Xr=require("@stdlib/utils/define-nonenumerable-read-only-property"),co=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),NO=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),xae=require("@stdlib/assert/is-positive-number").isPrimitive,LO=require("@stdlib/assert/is-plain-object"),RO=require("@stdlib/assert/is-function"),PO=require("@stdlib/assert/has-own-property"),TO=require("@stdlib/utils/constant-function"),Aae=require("@stdlib/utils/noop"),mo=T().factory,Gae=require("@stdlib/math/base/assert/is-nan"),Vae=require("@stdlib/array/to-json"),ho=require("@stdlib/string/format"),jO=_O();function Fae(){var r,e,t,i;if(arguments.length===0)t=mo();else if(arguments.length===1&&LO(arguments[0]))if(e=arguments[0],PO(e,"prng")){if(!RO(e.prng))throw new TypeError(ho("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=mo(e);else{if(r=arguments[0],!xae(r))throw new TypeError(ho("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(e=arguments[1],!LO(e))throw new TypeError(ho("invalid argument. Options argument must be an object. Value: `%s`.",e));if(PO(e,"prng")){if(!RO(e.prng))throw new TypeError(ho("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=mo(e)}else t=mo()}return r===void 0?i=m:i=l,Xr(i,"NAME","exponential"),e&&e.prng?(Xr(i,"seed",null),Xr(i,"seedLength",null),NO(i,"state",TO(null),Aae),Xr(i,"stateLength",null),Xr(i,"byteLength",null),Xr(i,"toJSON",TO(null)),Xr(i,"PRNG",t)):(co(i,"seed",n),co(i,"seedLength",a),NO(i,"state",v,g),co(i,"stateLength",u),co(i,"byteLength",o),Xr(i,"toJSON",c),Xr(i,"PRNG",t),t=t.normalized),i;function n(){return t.seed}function a(){return t.seedLength}function u(){return t.stateLength}function o(){return t.byteLength}function v(){return t.state}function g(h){t.state=h}function c(){var h={};return h.type="PRNG",h.name=i.NAME,h.state=Vae(t.state),r===void 0?h.params=[]:h.params=[r],h}function l(){return jO(t,r)}function m(h){return Gae(h)||h<=0?NaN:jO(t,h)}}MO.exports=Fae});var AO=s(function(J6e,xO){"use strict";var Wae=Rl(),Iae=Wae();xO.exports=Iae});var dn=s(function(U6e,VO){"use strict";var kae=require("@stdlib/utils/define-nonenumerable-read-only-property"),GO=AO(),zae=Rl();kae(GO,"factory",zae);VO.exports=GO});var Pl=s(function(C6e,FO){"use strict";var Jae=Fr(),Uae=require("@stdlib/array/dtypes"),Cae=require("@stdlib/array/defaults"),Bae=dn(),Dae=Uae("real_floating_point_and_generic"),Xae=Jae(Bae,Dae,Cae.get("dtypes.real_floating_point"));FO.exports=Xae});var IO=s(function(B6e,WO){"use strict";var Yae=Pl(),Hae=Yae();WO.exports=Hae});var JO=s(function(D6e,zO){"use strict";var Zae=require("@stdlib/utils/define-nonenumerable-read-only-property"),kO=IO(),Qae=Pl();Zae(kO,"factory",Qae);zO.exports=kO});var DO=s(function(X6e,BO){"use strict";var UO=require("@stdlib/assert/is-positive-number").isPrimitive,CO=require("@stdlib/string/format");function $ae(r,e){return UO(r)?UO(e)?null:new TypeError(CO("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(CO("invalid argument. First argument must be a positive number. Value: `%s`.",r))}BO.exports=$ae});var YO=s(function(Y6e,XO){"use strict";function Kae(r,e,t){var i=r(e)/e,n=r(t)/t;return i/n}XO.exports=Kae});var Tl=s(function(H6e,tE){"use strict";var bt=require("@stdlib/utils/define-nonenumerable-read-only-property"),po=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),HO=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ZO=require("@stdlib/assert/is-plain-object"),QO=require("@stdlib/assert/is-function"),$O=require("@stdlib/assert/has-own-property"),KO=require("@stdlib/utils/constant-function"),ese=require("@stdlib/utils/noop"),wa=Xe().factory,eE=require("@stdlib/math/base/assert/is-nan"),rse=require("@stdlib/array/to-json"),yo=require("@stdlib/string/format"),tse=DO(),rE=YO();function ise(){var r,e,t,i,n,a,u;if(arguments.length===0)r=wa();else if(arguments.length===1){if(e=arguments[0],!ZO(e))throw new TypeError(yo("invalid argument. Options argument must be an object. Value: `%s`.",e));if($O(e,"prng")){if(!QO(e.prng))throw new TypeError(yo("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=tse(a,u),n)throw n;if(arguments.length>2){if(e=arguments[2],!ZO(e))throw new TypeError(yo("invalid argument. Options argument must be an object. Value: `%s`.",e));if($O(e,"prng")){if(!QO(e.prng))throw new TypeError(yo("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),HO(i,"state",KO(null),ese),bt(i,"stateLength",null),bt(i,"byteLength",null),bt(i,"toJSON",KO(null))):(po(i,"seed",o),po(i,"seedLength",v),HO(i,"state",l,m),po(i,"stateLength",g),po(i,"byteLength",c),bt(i,"toJSON",h)),bt(i,"PRNG",t),i;function o(){return t.seed}function v(){return t.seedLength}function g(){return t.stateLength}function c(){return t.byteLength}function l(){return t.state}function m(f){t.state=f}function h(){var f={};return f.type="PRNG",f.name=i.NAME,f.state=rse(t.state),a===void 0?f.params=[]:f.params=[a,u],f}function p(){return rE(r,a,u)}function d(f,y){return eE(f)||eE(y)||f<=0||y<=0?NaN:rE(r,f,y)}}tE.exports=ise});var nE=s(function(Z6e,iE){"use strict";var nse=Tl(),ase=nse();iE.exports=ase});var Sa=s(function(Q6e,sE){"use strict";var sse=require("@stdlib/utils/define-nonenumerable-read-only-property"),aE=nE(),use=Tl();sse(aE,"factory",use);sE.exports=aE});var jl=s(function($6e,uE){"use strict";var ose=F(),vse=require("@stdlib/array/dtypes"),gse=require("@stdlib/array/defaults"),fse=Sa(),dse=vse("real_floating_point_and_generic"),lse=ose(fse,dse,gse.get("dtypes.real_floating_point"));uE.exports=lse});var vE=s(function(K6e,oE){"use strict";var cse=jl(),mse=cse();oE.exports=mse});var dE=s(function(e4e,fE){"use strict";var hse=require("@stdlib/utils/define-nonenumerable-read-only-property"),gE=vE(),pse=jl();hse(gE,"factory",pse);fE.exports=gE});var mE=s(function(r4e,cE){"use strict";var yse=require("@stdlib/assert/is-plain-object"),qse=require("@stdlib/assert/has-own-property"),bse=require("@stdlib/array/base/assert/contains"),lE=require("@stdlib/string/format");function wse(r,e,t){return yse(t)?qse(t,"dtype")&&(r.dtype=t.dtype,!bse(e,r.dtype))?new TypeError(lE('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),r.dtype)):null:new TypeError(lE("invalid argument. Options argument must be an object. Value: `%s`.",t))}cE.exports=wse});var qE=s(function(t4e,yE){"use strict";var hE=require("@stdlib/utils/define-nonenumerable-read-only-property"),Sse=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ose=require("@stdlib/assert/is-function"),Ese=require("@stdlib/assert/is-string-array").primitives,_se=require("@stdlib/assert/is-collection"),Nse=require("@stdlib/array/base/assert/contains"),Lse=require("@stdlib/array/base/filled-by"),pE=require("@stdlib/strided/base/ternary"),Rse=require("@stdlib/array/ctors"),Ys=require("@stdlib/string/format"),Pse=mE();function Hs(r,e,t){if(!(this instanceof Hs))return new Hs(r,e,t);if(!Ose(r))throw new TypeError(Ys("invalid argument. First argument must be a function. Value: `%s`.",r));if(!Ese(e))throw new TypeError(Ys("invalid argument. Second argument must be an array of strings. Value: `%s`.",e));if(!Nse(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}hE(Hs.prototype,"generate",function(e,t,i,n,a){var u,o,v,g,c,l;if(!Sse(e))throw new TypeError(Ys("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if(o={},arguments.length>4&&(c=Pse(o,this._dtypes,a),c))throw c;if(v=this._prng,l=o.dtype||this._dtype,l==="generic")return Lse(e,m);return u=Rse(l),g=new u(e),pE([[t],[i],[n],g],[e],[0,0,0,1],v),g;function m(){return v(t,i,n)}});hE(Hs.prototype,"assign",function(e,t,i,n){if(!_se(n))throw new TypeError(Ys("invalid argument. Third argument must be an array-like object. Value: `%s`.",n));return pE([[e],[t],[i],n],[n.length],[0,0,0,1],this._prng),n});yE.exports=Hs});var wE=s(function(i4e,bE){"use strict";var Tse=qE();bE.exports=Tse});var _E=s(function(n4e,EE){"use strict";var SE=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),qo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Oa=require("@stdlib/utils/define-nonenumerable-read-only-property"),jse=require("@stdlib/assert/is-string-array").primitives,Mse=require("@stdlib/assert/is-function"),xse=require("@stdlib/assert/is-method-in"),Ase=require("@stdlib/assert/has-own-property"),OE=require("@stdlib/array/base/assert/contains").factory,Gse=require("@stdlib/utils/constant-function"),Vse=require("@stdlib/utils/noop"),Fse=wE(),Wse=Nu(),Zs=require("@stdlib/string/format");function Ise(r,e,t){var i;if(!Mse(r))throw new TypeError(Zs("invalid argument. First argument must be a function. Value: `%s`.",r));if(!xse(r,"factory"))throw new TypeError(Zs("invalid argument. First argument must have a `%s` method.","factory"));if(!jse(e))throw new TypeError(Zs("invalid argument. Second argument must an array of strings. Value: `%s`.",e));if(!OE(e,t))throw new TypeError(Zs("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return i=OE(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),Ase(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=Fse):(c=b,a=Wse),u=new a(m,e,d),h&&h.prng?(Oa(p,"seed",null),Oa(p,"seedLength",null),SE(p,"state",Gse(null),Vse),Oa(p,"stateLength",null),Oa(p,"byteLength",null)):(qo(p,"seed",w),qo(p,"seedLength",S),SE(p,"state",x,V),qo(p,"stateLength",W),qo(p,"byteLength",J)),Oa(p,"PRNG",m.PRNG),Oa(p,"assign",c),p;function f(A,G,Ue,_u,R$){return arguments.length<5?u.generate(A,G,Ue,_u):u.generate(A,G,Ue,_u,R$)}function y(A,G){return arguments.length<2?u.generate(A):u.generate(A,G)}function q(A,G,Ue,_u){return u.assign(A,G,Ue,_u)}function b(A){return u.assign(A)}function w(){return p.PRNG.seed}function S(){return p.PRNG.seedLength}function W(){return p.PRNG.stateLength}function J(){return p.PRNG.byteLength}function x(){return p.PRNG.state}function V(A){p.PRNG.state=A}}}EE.exports=Ise});var bo=s(function(a4e,NE){"use strict";var kse=_E();NE.exports=kse});var PE=s(function(s4e,RE){"use strict";var LE=require("@stdlib/assert/is-positive-number").isPrimitive,zse=require("@stdlib/assert/is-number").isPrimitive,Ml=require("@stdlib/assert/is-nan"),xl=require("@stdlib/string/format");function Jse(r,e,t){return!LE(r)||Ml(r)?new TypeError(xl("invalid argument. First argument must be a positive number and not NaN. Value: `%s`.",r)):!LE(e)||Ml(e)?new TypeError(xl("invalid argument. Second argument must be a positive number and not NaN. Value: `%s`.",e)):!zse(t)||Ml(t)?new TypeError(xl("invalid argument. Third argument must be a number and not NaN. Value: `%s`.",t)):null}RE.exports=Jse});var jE=s(function(u4e,TE){"use strict";var Use=require("@stdlib/math/base/special/pow"),Cse=require("@stdlib/math/base/special/ln");function Bse(r,e,t,i){return i+t*Use(-Cse(r()),-1/e)}TE.exports=Bse});var Gl=s(function(o4e,WE){"use strict";var Yr=require("@stdlib/utils/define-nonenumerable-read-only-property"),wo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),ME=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),xE=require("@stdlib/assert/is-plain-object"),AE=require("@stdlib/assert/is-function"),GE=require("@stdlib/assert/has-own-property"),VE=require("@stdlib/utils/constant-function"),Dse=require("@stdlib/utils/noop"),So=T().factory,Al=require("@stdlib/math/base/assert/is-nan"),Xse=require("@stdlib/array/to-json"),Oo=require("@stdlib/string/format"),Yse=PE(),FE=jE();function Hse(){var r,e,t,i,n,a,u;if(arguments.length===0)t=So();else if(arguments.length===1){if(e=arguments[0],!xE(e))throw new TypeError(Oo("invalid argument. Options argument must be an object. Value: `%s`.",e));if(GE(e,"prng")){if(!AE(e.prng))throw new TypeError(Oo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=So(e)}else{if(r=arguments[0],a=arguments[1],u=arguments[2],n=Yse(r,a,u),n)throw n;if(arguments.length>3){if(e=arguments[3],!xE(e))throw new TypeError(Oo("invalid argument. Options argument must be an object. Value: `%s`.",e));if(GE(e,"prng")){if(!AE(e.prng))throw new TypeError(Oo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=So(e)}else t=So()}return r===void 0?i=d:i=p,Yr(i,"NAME","frechet"),e&&e.prng?(Yr(i,"seed",null),Yr(i,"seedLength",null),ME(i,"state",VE(null),Dse),Yr(i,"stateLength",null),Yr(i,"byteLength",null),Yr(i,"toJSON",VE(null)),Yr(i,"PRNG",t)):(wo(i,"seed",o),wo(i,"seedLength",v),ME(i,"state",l,m),wo(i,"stateLength",g),wo(i,"byteLength",c),Yr(i,"toJSON",h),Yr(i,"PRNG",t),t=t.normalized),i;function o(){return t.seed}function v(){return t.seedLength}function g(){return t.stateLength}function c(){return t.byteLength}function l(){return t.state}function m(f){t.state=f}function h(){var f={};return f.type="PRNG",f.name=i.NAME,f.state=Xse(t.state),r===void 0?f.params=[]:f.params=[r,a,u],f}function p(){return FE(t,r,a,u)}function d(f,y,q){return Al(f)||Al(y)||Al(q)||f<=0||y<=0?NaN:FE(t,f,y,q)}}WE.exports=Hse});var kE=s(function(v4e,IE){"use strict";var Zse=Gl(),Qse=Zse();IE.exports=Qse});var Ea=s(function(g4e,JE){"use strict";var $se=require("@stdlib/utils/define-nonenumerable-read-only-property"),zE=kE(),Kse=Gl();$se(zE,"factory",Kse);JE.exports=zE});var Vl=s(function(f4e,UE){"use strict";var eue=bo(),rue=require("@stdlib/array/dtypes"),tue=require("@stdlib/array/defaults"),iue=Ea(),nue=rue("real_floating_point_and_generic"),aue=eue(iue,nue,tue.get("dtypes.real_floating_point"));UE.exports=aue});var BE=s(function(d4e,CE){"use strict";var sue=Vl(),uue=sue();CE.exports=uue});var YE=s(function(l4e,XE){"use strict";var oue=require("@stdlib/utils/define-nonenumerable-read-only-property"),DE=BE(),vue=Vl();oue(DE,"factory",vue);XE.exports=DE});var Fl=s(function(c4e,HE){"use strict";var gue=F(),fue=require("@stdlib/array/dtypes"),due=require("@stdlib/array/defaults"),lue=Ce(),cue=fue("real_floating_point_and_generic"),mue=gue(lue,cue,due.get("dtypes.real_floating_point"));HE.exports=mue});var QE=s(function(m4e,ZE){"use strict";var hue=Fl(),pue=hue();ZE.exports=pue});var e_=s(function(h4e,KE){"use strict";var yue=require("@stdlib/utils/define-nonenumerable-read-only-property"),$E=QE(),que=Fl();yue($E,"factory",que);KE.exports=$E});var i_=s(function(p4e,t_){"use strict";var bue=require("@stdlib/math/base/special/floor"),r_=require("@stdlib/math/base/special/ln");function wue(r,e){var t=r();return t===0&&(t=r()),bue(r_(t)/r_(1-e))}t_.exports=wue});var Wl=s(function(y4e,g_){"use strict";var Hr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Eo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),n_=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),a_=require("@stdlib/assert/is-plain-object"),Sue=require("@stdlib/assert/is-probability").isPrimitive,s_=require("@stdlib/assert/is-function"),u_=require("@stdlib/assert/has-own-property"),o_=require("@stdlib/utils/constant-function"),Oue=require("@stdlib/utils/noop"),_o=T().factory,Eue=require("@stdlib/math/base/assert/is-nan"),_ue=require("@stdlib/array/to-json"),No=require("@stdlib/string/format"),v_=i_();function Nue(){var r,e,t,i;if(arguments.length===0)e=_o();else if(arguments.length===1&&a_(arguments[0]))if(r=arguments[0],u_(r,"prng")){if(!s_(r.prng))throw new TypeError(No("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=_o(r);else{if(i=arguments[0],!Sue(i))throw new TypeError(No("invalid argument. First argument must be a probability. Value: `%s`.",i));if(arguments.length>1){if(r=arguments[1],!a_(r))throw new TypeError(No("invalid argument. Options argument must be an object. Value: `%s`.",r));if(u_(r,"prng")){if(!s_(r.prng))throw new TypeError(No("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=_o(r)}else e=_o()}return i===void 0?t=m:t=l,Hr(t,"NAME","geometric"),r&&r.prng?(Hr(t,"seed",null),Hr(t,"seedLength",null),n_(t,"state",o_(null),Oue),Hr(t,"stateLength",null),Hr(t,"byteLength",null),Hr(t,"toJSON",o_(null)),Hr(t,"PRNG",e)):(Eo(t,"seed",n),Eo(t,"seedLength",a),n_(t,"state",v,g),Eo(t,"stateLength",u),Eo(t,"byteLength",o),Hr(t,"toJSON",c),Hr(t,"PRNG",e),e=e.normalized),t;function n(){return e.seed}function a(){return e.seedLength}function u(){return e.stateLength}function o(){return e.byteLength}function v(){return e.state}function g(h){e.state=h}function c(){var h={};return h.type="PRNG",h.name=t.NAME,h.state=_ue(e.state),i===void 0?h.params=[]:h.params=[i],h}function l(){return v_(e,i)}function m(h){return Eue(h)||h<0||h>1?NaN:v_(e,h)}}g_.exports=Nue});var d_=s(function(q4e,f_){"use strict";var Lue=Wl(),Rue=Lue();f_.exports=Rue});var _a=s(function(b4e,c_){"use strict";var Pue=require("@stdlib/utils/define-nonenumerable-read-only-property"),l_=d_(),Tue=Wl();Pue(l_,"factory",Tue);c_.exports=l_});var Il=s(function(w4e,m_){"use strict";var jue=Fr(),Mue=require("@stdlib/array/dtypes"),xue=require("@stdlib/array/defaults"),Aue=_a(),Gue=Mue("real_and_generic"),Vue=jue(Aue,Gue,xue.get("dtypes.real"));m_.exports=Vue});var p_=s(function(S4e,h_){"use strict";var Fue=Il(),Wue=Fue();h_.exports=Wue});var b_=s(function(O4e,q_){"use strict";var Iue=require("@stdlib/utils/define-nonenumerable-read-only-property"),y_=p_(),kue=Il();Iue(y_,"factory",kue);q_.exports=y_});var O_=s(function(E4e,S_){"use strict";var zue=require("@stdlib/assert/is-number").isPrimitive,Jue=require("@stdlib/assert/is-positive-number").isPrimitive,w_=require("@stdlib/string/format"),Uue=require("@stdlib/assert/is-nan");function Cue(r,e){return!zue(r)||Uue(r)?new TypeError(w_("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Jue(e)?null:new TypeError(w_("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}S_.exports=Cue});var N_=s(function(_4e,__){"use strict";var E_=require("@stdlib/math/base/special/ln");function Bue(r,e,t){return e-t*E_(-E_(r()))}__.exports=Bue});var kl=s(function(N4e,A_){"use strict";var Zr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Lo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),L_=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),R_=require("@stdlib/assert/is-plain-object"),P_=require("@stdlib/assert/is-function"),T_=require("@stdlib/assert/has-own-property"),j_=require("@stdlib/utils/constant-function"),Due=require("@stdlib/utils/noop"),Ro=T().factory,M_=require("@stdlib/math/base/assert/is-nan"),Xue=require("@stdlib/array/to-json"),Po=require("@stdlib/string/format"),Yue=O_(),x_=N_();function Hue(){var r,e,t,i,n,a;if(arguments.length===0)t=Ro();else if(arguments.length===1){if(e=arguments[0],!R_(e))throw new TypeError(Po("invalid argument. Options argument must be an object. Value: `%s`.",e));if(T_(e,"prng")){if(!P_(e.prng))throw new TypeError(Po("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=Ro(e)}else{if(a=arguments[0],r=arguments[1],n=Yue(a,r),n)throw n;if(arguments.length>2){if(e=arguments[2],!R_(e))throw new TypeError(Po("invalid argument. Options argument must be an object. Value: `%s`.",e));if(T_(e,"prng")){if(!P_(e.prng))throw new TypeError(Po("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=Ro(e)}else t=Ro()}return a===void 0?i=p:i=h,Zr(i,"NAME","gumbel"),e&&e.prng?(Zr(i,"seed",null),Zr(i,"seedLength",null),L_(i,"state",j_(null),Due),Zr(i,"stateLength",null),Zr(i,"byteLength",null),Zr(i,"toJSON",j_(null)),Zr(i,"PRNG",t)):(Lo(i,"seed",u),Lo(i,"seedLength",o),L_(i,"state",c,l),Lo(i,"stateLength",v),Lo(i,"byteLength",g),Zr(i,"toJSON",m),Zr(i,"PRNG",t),t=t.normalized),i;function u(){return t.seed}function o(){return t.seedLength}function v(){return t.stateLength}function g(){return t.byteLength}function c(){return t.state}function l(d){t.state=d}function m(){var d={};return d.type="PRNG",d.name=i.NAME,d.state=Xue(t.state),a===void 0?d.params=[]:d.params=[a,r],d}function h(){return x_(t,a,r)}function p(d,f){return M_(d)||M_(f)||f<=0?NaN:x_(t,d,f)}}A_.exports=Hue});var V_=s(function(L4e,G_){"use strict";var Zue=kl(),Que=Zue();G_.exports=Que});var Na=s(function(R4e,W_){"use strict";var $ue=require("@stdlib/utils/define-nonenumerable-read-only-property"),F_=V_(),Kue=kl();$ue(F_,"factory",Kue);W_.exports=F_});var zl=s(function(P4e,I_){"use strict";var eoe=F(),roe=require("@stdlib/array/dtypes"),toe=require("@stdlib/array/defaults"),ioe=Na(),noe=roe("real_floating_point_and_generic"),aoe=eoe(ioe,noe,toe.get("dtypes.real_floating_point"));I_.exports=aoe});var z_=s(function(T4e,k_){"use strict";var soe=zl(),uoe=soe();k_.exports=uoe});var C_=s(function(j4e,U_){"use strict";var ooe=require("@stdlib/utils/define-nonenumerable-read-only-property"),J_=z_(),voe=zl();ooe(J_,"factory",voe);U_.exports=J_});var D_=s(function(M4e,B_){"use strict";var Jl=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Qs=require("@stdlib/string/format");function goe(r,e,t){return Jl(r)?Jl(e)?Jl(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))}B_.exports=goe});var Y_=s(function(x4e,X_){"use strict";var wt=require("@stdlib/math/base/special/factorial");function foe(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}X_.exports=foe});var Z_=s(function(A4e,H_){"use strict";var To=Y_();function doe(r,e,t,i){var n,a,u,o;return i>e/2?(u=e-i,2*t<=e?(n=t,a=e-t,o=To(r,n,a,u),t-o):(a=t,n=e-t,o=To(r,n,a,u),i-e+t+o)):(u=i,2*t<=e?(n=t,a=e-t,o=To(r,n,a,u),o):(n=e-t,a=t,o=To(r,n,a,u),i-o))}H_.exports=doe});var Cl=s(function(G4e,nN){"use strict";var Qr=require("@stdlib/utils/define-nonenumerable-read-only-property"),jo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Q_=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),$_=require("@stdlib/assert/is-plain-object"),K_=require("@stdlib/assert/is-function"),eN=require("@stdlib/assert/has-own-property"),rN=require("@stdlib/utils/constant-function"),loe=require("@stdlib/utils/noop"),Mo=T().factory,Ul=require("@stdlib/math/base/assert/is-nonnegative-integer"),tN=require("@stdlib/constants/float64/pinf"),coe=require("@stdlib/array/to-json"),xo=require("@stdlib/string/format"),moe=D_(),iN=Z_();function hoe(){var r,e,t,i,n,a,u;if(arguments.length===0)e=Mo();else if(arguments.length===1){if(r=arguments[0],!$_(r))throw new TypeError(xo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(eN(r,"prng")){if(!K_(r.prng))throw new TypeError(xo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Mo(r)}else{if(n=arguments[0],a=arguments[1],u=arguments[2],i=moe(n,a,u),i)throw i;if(arguments.length>3){if(r=arguments[3],!$_(r))throw new TypeError(xo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(eN(r,"prng")){if(!K_(r.prng))throw new TypeError(xo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Mo(r)}else e=Mo()}return n===void 0?t=d:t=p,Qr(t,"NAME","hypergeometric"),r&&r.prng?(Qr(t,"seed",null),Qr(t,"seedLength",null),Q_(t,"state",rN(null),loe),Qr(t,"stateLength",null),Qr(t,"byteLength",null),Qr(t,"toJSON",rN(null)),Qr(t,"PRNG",e)):(jo(t,"seed",o),jo(t,"seedLength",v),Q_(t,"state",l,m),jo(t,"stateLength",g),jo(t,"byteLength",c),Qr(t,"toJSON",h),Qr(t,"PRNG",e),e=e.normalized),t;function o(){return e.seed}function v(){return e.seedLength}function g(){return e.stateLength}function c(){return e.byteLength}function l(){return e.state}function m(f){e.state=f}function h(){var f={};return f.type="PRNG",f.name=t.NAME,f.state=coe(e.state),n===void 0?f.params=[]:f.params=[n,a,u],f}function p(){return iN(e,n,a,u)}function d(f,y,q){return f===tN||y===tN||!Ul(f)||!Ul(y)||!Ul(q)||q>f?NaN:iN(e,f,y,q)}}nN.exports=hoe});var sN=s(function(V4e,aN){"use strict";var poe=Cl(),yoe=poe();aN.exports=yoe});var La=s(function(F4e,oN){"use strict";var qoe=require("@stdlib/utils/define-nonenumerable-read-only-property"),uN=sN(),boe=Cl();qoe(uN,"factory",boe);oN.exports=uN});var Bl=s(function(W4e,vN){"use strict";var woe=bo(),Soe=require("@stdlib/array/dtypes"),Ooe=require("@stdlib/array/defaults"),Eoe=La(),_oe=Soe("real_and_generic"),Noe=woe(Eoe,_oe,Ooe.get("dtypes.real"));vN.exports=Noe});var fN=s(function(I4e,gN){"use strict";var Loe=Bl(),Roe=Loe();gN.exports=Roe});var cN=s(function(k4e,lN){"use strict";var Poe=require("@stdlib/utils/define-nonenumerable-read-only-property"),dN=fN(),Toe=Bl();Poe(dN,"factory",Toe);lN.exports=dN});var yN=s(function(z4e,pN){"use strict";var mN=require("@stdlib/assert/is-positive-number").isPrimitive,hN=require("@stdlib/string/format");function joe(r,e){return mN(r)?mN(e)?null:new TypeError(hN("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(hN("invalid argument. First argument must be a positive number. Value: `%s`.",r))}pN.exports=joe});var Dl=s(function(J4e,_N){"use strict";var St=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ao=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),qN=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),bN=require("@stdlib/assert/is-plain-object"),wN=require("@stdlib/assert/is-function"),SN=require("@stdlib/assert/has-own-property"),ON=require("@stdlib/utils/constant-function"),Moe=require("@stdlib/utils/noop"),Ra=Ce().factory,EN=require("@stdlib/math/base/assert/is-nan"),xoe=require("@stdlib/array/to-json"),Go=require("@stdlib/string/format"),Aoe=yN();function Goe(){var r,e,t,i,n,a,u;if(arguments.length===0)r=Ra();else if(arguments.length===1){if(i=arguments[0],!bN(i))throw new TypeError(Go("invalid argument. Options argument must be an object. Value: `%s`.",i));if(SN(i,"prng")){if(!wN(i.prng))throw new TypeError(Go("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));r=Ra({prng:i.prng})}else r=Ra(i)}else{if(e=arguments[0],t=arguments[1],u=Aoe(e,t),u)throw u;if(arguments.length>2){if(i=arguments[2],!bN(i))throw new TypeError(Go("invalid argument. Options argument must be an object. Value: `%s`.",i));if(SN(i,"prng")){if(!wN(i.prng))throw new TypeError(Go("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));r=Ra(e,t,{prng:i.prng})}else r=Ra(e,t,i)}else r=Ra(e,t)}return e===void 0?a=d:a=p,n=r.PRNG,St(a,"NAME","invgamma"),i&&i.prng?(St(a,"seed",null),St(a,"seedLength",null),qN(a,"state",ON(null),Moe),St(a,"stateLength",null),St(a,"byteLength",null),St(a,"toJSON",ON(null))):(Ao(a,"seed",o),Ao(a,"seedLength",v),qN(a,"state",l,m),Ao(a,"stateLength",g),Ao(a,"byteLength",c),St(a,"toJSON",h)),St(a,"PRNG",n),a;function o(){return n.seed}function v(){return n.seedLength}function g(){return n.stateLength}function c(){return n.byteLength}function l(){return n.state}function m(f){n.state=f}function h(){var f={};return f.type="PRNG",f.name=a.NAME,f.state=xoe(n.state),e===void 0?f.params=[]:f.params=[e,t],f}function p(){return 1/r()}function d(f,y){return EN(f)||EN(y)||f<=0||y<=0?NaN:1/r(f,y)}}_N.exports=Goe});var LN=s(function(U4e,NN){"use strict";var Voe=Dl(),Foe=Voe();NN.exports=Foe});var ln=s(function(C4e,PN){"use strict";var Woe=require("@stdlib/utils/define-nonenumerable-read-only-property"),RN=LN(),Ioe=Dl();Woe(RN,"factory",Ioe);PN.exports=RN});var Xl=s(function(B4e,TN){"use strict";var koe=F(),zoe=require("@stdlib/array/dtypes"),Joe=require("@stdlib/array/defaults"),Uoe=ln(),Coe=zoe("real_floating_point_and_generic"),Boe=koe(Uoe,Coe,Joe.get("dtypes.real_floating_point"));TN.exports=Boe});var MN=s(function(D4e,jN){"use strict";var Doe=Xl(),Xoe=Doe();jN.exports=Xoe});var GN=s(function(X4e,AN){"use strict";var Yoe=require("@stdlib/utils/define-nonenumerable-read-only-property"),xN=MN(),Hoe=Xl();Yoe(xN,"factory",Hoe);AN.exports=xN});var IN=s(function(Y4e,WN){"use strict";var VN=require("@stdlib/assert/is-positive-number").isPrimitive,FN=require("@stdlib/string/format");function Zoe(r,e){return VN(r)?VN(e)?null:new TypeError(FN("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(FN("invalid argument. First argument must be a positive number. Value: `%s`.",r))}WN.exports=Zoe});var JN=s(function(H4e,zN){"use strict";var kN=require("@stdlib/math/base/special/pow");function Qoe(r,e,t){var i=r();return kN(1-kN(1-i,1/t),1/e)}zN.exports=Qoe});var Yl=s(function(Z4e,ZN){"use strict";var $r=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),UN=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),CN=require("@stdlib/assert/is-plain-object"),BN=require("@stdlib/assert/is-function"),DN=require("@stdlib/assert/has-own-property"),XN=require("@stdlib/utils/constant-function"),$oe=require("@stdlib/utils/noop"),Fo=T().factory,YN=require("@stdlib/math/base/assert/is-nan"),Koe=require("@stdlib/array/to-json"),Wo=require("@stdlib/string/format"),eve=IN(),HN=JN();function rve(){var r,e,t,i,n,a;if(arguments.length===0)e=Fo();else if(arguments.length===1){if(r=arguments[0],!CN(r))throw new TypeError(Wo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(DN(r,"prng")){if(!BN(r.prng))throw new TypeError(Wo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Fo(r)}else{if(n=arguments[0],a=arguments[1],i=eve(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!CN(r))throw new TypeError(Wo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(DN(r,"prng")){if(!BN(r.prng))throw new TypeError(Wo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Fo(r)}else e=Fo()}return n===void 0?t=p:t=h,$r(t,"NAME","kumaraswamy"),r&&r.prng?($r(t,"seed",null),$r(t,"seedLength",null),UN(t,"state",XN(null),$oe),$r(t,"stateLength",null),$r(t,"byteLength",null),$r(t,"toJSON",XN(null)),$r(t,"PRNG",e)):(Vo(t,"seed",u),Vo(t,"seedLength",o),UN(t,"state",c,l),Vo(t,"stateLength",v),Vo(t,"byteLength",g),$r(t,"toJSON",m),$r(t,"PRNG",e),e=e.normalized),t;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=t.NAME,d.state=Koe(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return HN(e,n,a)}function p(d,f){return YN(d)||YN(f)||d<=0||f<=0?NaN:HN(e,d,f)}}ZN.exports=rve});var $N=s(function(Q4e,QN){"use strict";var tve=Yl(),ive=tve();QN.exports=ive});var Pa=s(function($4e,eL){"use strict";var nve=require("@stdlib/utils/define-nonenumerable-read-only-property"),KN=$N(),ave=Yl();nve(KN,"factory",ave);eL.exports=KN});var Hl=s(function(K4e,rL){"use strict";var sve=F(),uve=require("@stdlib/array/dtypes"),ove=require("@stdlib/array/defaults"),vve=Pa(),gve=uve("real_floating_point_and_generic"),fve=sve(vve,gve,ove.get("dtypes.real_floating_point"));rL.exports=fve});var iL=s(function(eHe,tL){"use strict";var dve=Hl(),lve=dve();tL.exports=lve});var sL=s(function(rHe,aL){"use strict";var cve=require("@stdlib/utils/define-nonenumerable-read-only-property"),nL=iL(),mve=Hl();cve(nL,"factory",mve);aL.exports=nL});var vL=s(function(tHe,oL){"use strict";var hve=require("@stdlib/assert/is-number").isPrimitive,pve=require("@stdlib/assert/is-positive-number").isPrimitive,uL=require("@stdlib/string/format"),yve=require("@stdlib/assert/is-nan");function qve(r,e){return!hve(r)||yve(r)?new TypeError(uL("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):pve(e)?null:new TypeError(uL("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}oL.exports=qve});var fL=s(function(iHe,gL){"use strict";var bve=require("@stdlib/math/base/special/signum"),wve=require("@stdlib/math/base/special/abs"),Sve=require("@stdlib/math/base/special/ln");function Ove(r,e,t){var i=r()-.5;return e-t*bve(i)*Sve(1-2*wve(i))}gL.exports=Ove});var Zl=s(function(nHe,qL){"use strict";var Kr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Io=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),dL=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),lL=require("@stdlib/assert/is-plain-object"),cL=require("@stdlib/assert/is-function"),mL=require("@stdlib/assert/has-own-property"),hL=require("@stdlib/utils/constant-function"),Eve=require("@stdlib/utils/noop"),ko=T().factory,pL=require("@stdlib/math/base/assert/is-nan"),_ve=require("@stdlib/array/to-json"),zo=require("@stdlib/string/format"),Nve=vL(),yL=fL();function Lve(){var r,e,t,i,n,a;if(arguments.length===0)e=ko();else if(arguments.length===1){if(r=arguments[0],!lL(r))throw new TypeError(zo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(mL(r,"prng")){if(!cL(r.prng))throw new TypeError(zo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=ko(r)}else{if(n=arguments[0],a=arguments[1],i=Nve(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!lL(r))throw new TypeError(zo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(mL(r,"prng")){if(!cL(r.prng))throw new TypeError(zo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=ko(r)}else e=ko()}return n===void 0?t=p:t=h,Kr(t,"NAME","laplace"),r&&r.prng?(Kr(t,"seed",null),Kr(t,"seedLength",null),dL(t,"state",hL(null),Eve),Kr(t,"stateLength",null),Kr(t,"byteLength",null),Kr(t,"toJSON",hL(null)),Kr(t,"PRNG",e)):(Io(t,"seed",u),Io(t,"seedLength",o),dL(t,"state",c,l),Io(t,"stateLength",v),Io(t,"byteLength",g),Kr(t,"toJSON",m),Kr(t,"PRNG",e),e=e.normalized),t;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=t.NAME,d.state=_ve(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return yL(e,n,a)}function p(d,f){return pL(d)||pL(f)||f<=0?NaN:yL(e,d,f)}}qL.exports=Lve});var wL=s(function(aHe,bL){"use strict";var Rve=Zl(),Pve=Rve();bL.exports=Pve});var Ta=s(function(sHe,OL){"use strict";var Tve=require("@stdlib/utils/define-nonenumerable-read-only-property"),SL=wL(),jve=Zl();Tve(SL,"factory",jve);OL.exports=SL});var Ql=s(function(uHe,EL){"use strict";var Mve=F(),xve=require("@stdlib/array/dtypes"),Ave=require("@stdlib/array/defaults"),Gve=Ta(),Vve=xve("real_floating_point_and_generic"),Fve=Mve(Gve,Vve,Ave.get("dtypes.real_floating_point"));EL.exports=Fve});var NL=s(function(oHe,_L){"use strict";var Wve=Ql(),Ive=Wve();_L.exports=Ive});var PL=s(function(vHe,RL){"use strict";var kve=require("@stdlib/utils/define-nonenumerable-read-only-property"),LL=NL(),zve=Ql();kve(LL,"factory",zve);RL.exports=LL});var ML=s(function(gHe,jL){"use strict";var Jve=require("@stdlib/assert/is-number").isPrimitive,Uve=require("@stdlib/assert/is-positive-number").isPrimitive,TL=require("@stdlib/string/format"),Cve=require("@stdlib/assert/is-nan");function Bve(r,e){return!Jve(r)||Cve(r)?new TypeError(TL("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Uve(e)?null:new TypeError(TL("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}jL.exports=Bve});var AL=s(function(fHe,xL){"use strict";var Dve=require("@stdlib/stats/base/dists/normal/quantile");function Xve(r,e,t){var i=Dve(1-r()/2,0,1);return e+t/(i*i)}xL.exports=Xve});var $l=s(function(dHe,JL){"use strict";var et=require("@stdlib/utils/define-nonenumerable-read-only-property"),Jo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),GL=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),VL=require("@stdlib/assert/is-plain-object"),FL=require("@stdlib/assert/is-function"),WL=require("@stdlib/assert/has-own-property"),IL=require("@stdlib/utils/constant-function"),Yve=require("@stdlib/utils/noop"),Uo=T().factory,kL=require("@stdlib/math/base/assert/is-nan"),Hve=require("@stdlib/array/to-json"),Co=require("@stdlib/string/format"),Zve=ML(),zL=AL();function Qve(){var r,e,t,i,n,a;if(arguments.length===0)e=Uo();else if(arguments.length===1){if(r=arguments[0],!VL(r))throw new TypeError(Co("invalid argument. Options argument must be an object. Value: `%s`.",r));if(WL(r,"prng")){if(!FL(r.prng))throw new TypeError(Co("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Uo(r)}else{if(n=arguments[0],a=arguments[1],i=Zve(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!VL(r))throw new TypeError(Co("invalid argument. Options argument must be an object. Value: `%s`.",r));if(WL(r,"prng")){if(!FL(r.prng))throw new TypeError(Co("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Uo(r)}else e=Uo()}return n===void 0?t=p:t=h,et(t,"NAME","levy"),r&&r.prng?(et(t,"seed",null),et(t,"seedLength",null),GL(t,"state",IL(null),Yve),et(t,"stateLength",null),et(t,"byteLength",null),et(t,"toJSON",IL(null)),et(t,"PRNG",e)):(Jo(t,"seed",u),Jo(t,"seedLength",o),GL(t,"state",c,l),Jo(t,"stateLength",v),Jo(t,"byteLength",g),et(t,"toJSON",m),et(t,"PRNG",e),e=e.normalized),t;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=t.NAME,d.state=Hve(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return zL(e,n,a)}function p(d,f){return kL(d)||kL(f)||f<=0?NaN:zL(e,d,f)}}JL.exports=Qve});var CL=s(function(lHe,UL){"use strict";var $ve=$l(),Kve=$ve();UL.exports=Kve});var ja=s(function(cHe,DL){"use strict";var ege=require("@stdlib/utils/define-nonenumerable-read-only-property"),BL=CL(),rge=$l();ege(BL,"factory",rge);DL.exports=BL});var Kl=s(function(mHe,XL){"use strict";var tge=F(),ige=require("@stdlib/array/dtypes"),nge=require("@stdlib/array/defaults"),age=ja(),sge=ige("real_floating_point_and_generic"),uge=tge(age,sge,nge.get("dtypes.real_floating_point"));XL.exports=uge});var HL=s(function(hHe,YL){"use strict";var oge=Kl(),vge=oge();YL.exports=vge});var $L=s(function(pHe,QL){"use strict";var gge=require("@stdlib/utils/define-nonenumerable-read-only-property"),ZL=HL(),fge=Kl();gge(ZL,"factory",fge);QL.exports=ZL});var rR=s(function(yHe,eR){"use strict";var dge=require("@stdlib/assert/is-number").isPrimitive,lge=require("@stdlib/assert/is-positive-number").isPrimitive,cge=require("@stdlib/assert/is-nan"),KL=require("@stdlib/string/format");function mge(r,e){return!dge(r)||cge(r)?new TypeError(KL("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):lge(e)?null:new TypeError(KL("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}eR.exports=mge});var iR=s(function(qHe,tR){"use strict";var hge=require("@stdlib/math/base/special/ln");function pge(r,e,t){var i=r();return e+t*hge(i/(1-i))}tR.exports=pge});var ec=s(function(bHe,fR){"use strict";var rt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),nR=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),aR=require("@stdlib/assert/is-plain-object"),sR=require("@stdlib/assert/is-function"),uR=require("@stdlib/assert/has-own-property"),oR=require("@stdlib/utils/constant-function"),yge=require("@stdlib/utils/noop"),Do=T().factory,vR=require("@stdlib/math/base/assert/is-nan"),qge=require("@stdlib/array/to-json"),Xo=require("@stdlib/string/format"),bge=rR(),gR=iR();function wge(){var r,e,t,i,n,a;if(arguments.length===0)e=Do();else if(arguments.length===1){if(r=arguments[0],!aR(r))throw new TypeError(Xo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(uR(r,"prng")){if(!sR(r.prng))throw new TypeError(Xo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Do(r)}else{if(n=arguments[0],a=arguments[1],i=bge(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!aR(r))throw new TypeError(Xo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(uR(r,"prng")){if(!sR(r.prng))throw new TypeError(Xo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Do(r)}else e=Do()}return n===void 0?t=p:t=h,rt(t,"NAME","logistic"),r&&r.prng?(rt(t,"seed",null),rt(t,"seedLength",null),nR(t,"state",oR(null),yge),rt(t,"stateLength",null),rt(t,"byteLength",null),rt(t,"toJSON",oR(null)),rt(t,"PRNG",e)):(Bo(t,"seed",u),Bo(t,"seedLength",o),nR(t,"state",c,l),Bo(t,"stateLength",v),Bo(t,"byteLength",g),rt(t,"toJSON",m),rt(t,"PRNG",e),e=e.normalized),t;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=t.NAME,d.state=qge(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return gR(e,n,a)}function p(d,f){return vR(d)||vR(f)||f<=0?NaN:gR(e,d,f)}}fR.exports=wge});var lR=s(function(wHe,dR){"use strict";var Sge=ec(),Oge=Sge();dR.exports=Oge});var Ma=s(function(SHe,mR){"use strict";var Ege=require("@stdlib/utils/define-nonenumerable-read-only-property"),cR=lR(),_ge=ec();Ege(cR,"factory",_ge);mR.exports=cR});var rc=s(function(OHe,hR){"use strict";var Nge=F(),Lge=require("@stdlib/array/dtypes"),Rge=require("@stdlib/array/defaults"),Pge=Ma(),Tge=Lge("real_floating_point_and_generic"),jge=Nge(Pge,Tge,Rge.get("dtypes.real_floating_point"));hR.exports=jge});var yR=s(function(EHe,pR){"use strict";var Mge=rc(),xge=Mge();pR.exports=xge});var wR=s(function(_He,bR){"use strict";var Age=require("@stdlib/utils/define-nonenumerable-read-only-property"),qR=yR(),Gge=rc();Age(qR,"factory",Gge);bR.exports=qR});var ER=s(function(NHe,OR){"use strict";var Vge=require("@stdlib/assert/is-number").isPrimitive,Fge=require("@stdlib/assert/is-positive-number").isPrimitive,SR=require("@stdlib/string/format"),Wge=require("@stdlib/assert/is-nan");function Ige(r,e){return!Vge(r)||Wge(r)?new TypeError(SR("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Fge(e)?null:new TypeError(SR("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}OR.exports=Ige});var NR=s(function(LHe,_R){"use strict";var kge=require("@stdlib/math/base/special/exp");function zge(r,e,t){return kge(e+t*r())}_R.exports=zge});var tc=s(function(RHe,AR){"use strict";var Ot=require("@stdlib/utils/define-nonenumerable-read-only-property"),Yo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),LR=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),RR=require("@stdlib/assert/is-plain-object"),PR=require("@stdlib/assert/is-function"),TR=require("@stdlib/assert/has-own-property"),jR=require("@stdlib/utils/constant-function"),Jge=require("@stdlib/utils/noop"),xa=Q().factory,MR=require("@stdlib/math/base/assert/is-nan"),Uge=require("@stdlib/array/to-json"),Ho=require("@stdlib/string/format"),Cge=ER(),xR=NR();function Bge(){var r,e,t,i,n,a,u;if(arguments.length===0)e=xa();else if(arguments.length===1){if(t=arguments[0],!RR(t))throw new TypeError(Ho("invalid argument. Options argument must be an object. Value: `%s`.",t));if(TR(t,"prng")){if(!PR(t.prng))throw new TypeError(Ho("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));e=xa({prng:t.prng})}else e=xa(t)}else{if(u=arguments[0],r=arguments[1],a=Cge(u,r),a)throw a;if(arguments.length>2){if(t=arguments[2],!RR(t))throw new TypeError(Ho("invalid argument. Options argument must be an object. Value: `%s`.",t));if(TR(t,"prng")){if(!PR(t.prng))throw new TypeError(Ho("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));e=xa({prng:t.prng})}else e=xa(t)}else e=xa()}return u===void 0?n=d:n=p,i=e.PRNG,Ot(n,"NAME","lognormal"),t&&t.prng?(Ot(n,"seed",null),Ot(n,"seedLength",null),LR(n,"state",jR(null),Jge),Ot(n,"stateLength",null),Ot(n,"byteLength",null),Ot(n,"toJSON",jR(null))):(Yo(n,"seed",o),Yo(n,"seedLength",v),LR(n,"state",l,m),Yo(n,"stateLength",g),Yo(n,"byteLength",c),Ot(n,"toJSON",h)),Ot(n,"PRNG",i),n;function o(){return i.seed}function v(){return i.seedLength}function g(){return i.stateLength}function c(){return i.byteLength}function l(){return i.state}function m(f){i.state=f}function h(){var f={};return f.type="PRNG",f.name=n.NAME,f.state=Uge(i.state),u===void 0?f.params=[]:f.params=[u,r],f}function p(){return xR(e,u,r)}function d(f,y){return MR(f)||MR(y)||y<=0?NaN:xR(e,f,y)}}AR.exports=Bge});var VR=s(function(PHe,GR){"use strict";var Dge=tc(),Xge=Dge();GR.exports=Xge});var cn=s(function(THe,WR){"use strict";var Yge=require("@stdlib/utils/define-nonenumerable-read-only-property"),FR=VR(),Hge=tc();Yge(FR,"factory",Hge);WR.exports=FR});var ic=s(function(jHe,IR){"use strict";var Zge=F(),Qge=require("@stdlib/array/dtypes"),$ge=require("@stdlib/array/defaults"),Kge=cn(),efe=Qge("real_floating_point_and_generic"),rfe=Zge(Kge,efe,$ge.get("dtypes.real_floating_point"));IR.exports=rfe});var zR=s(function(MHe,kR){"use strict";var tfe=ic(),ife=tfe();kR.exports=ife});var CR=s(function(xHe,UR){"use strict";var nfe=require("@stdlib/utils/define-nonenumerable-read-only-property"),JR=zR(),afe=ic();nfe(JR,"factory",afe);UR.exports=JR});var nc=s(function(AHe,BR){"use strict";var sfe=require("@stdlib/constants/int32/max"),ufe=require("@stdlib/math/base/special/floor"),ofe=sfe-1;function vfe(){var r=ufe(1+ofe*Math.random());return r|0}BR.exports=vfe});var uc=s(function(GHe,ZR){"use strict";var tt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Et=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),DR=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ac=require("@stdlib/assert/has-own-property"),gfe=require("@stdlib/assert/is-plain-object"),ffe=require("@stdlib/assert/is-boolean").isPrimitive,dfe=require("@stdlib/assert/is-collection"),lfe=require("@stdlib/assert/is-positive-integer").isPrimitive,XR=require("@stdlib/assert/is-int32array"),Be=require("@stdlib/string/format"),Zo=require("@stdlib/constants/int32/max"),D=require("@stdlib/array/int32"),Aa=require("@stdlib/blas/base/gcopy"),cfe=require("@stdlib/array/to-json"),YR=nc(),sc=Zo-1|0,mfe=Zo-1|0,hfe=16807,Qo=1,$o=2,_t=2,X=4,$s=5;function HR(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]!==Qo?new RangeError(Be("invalid %s. State array has an incompatible schema version. Expected: `%s`. Actual: `%s`.",t,Qo,r[0])):r[1]!==$o?new RangeError(Be("invalid %s. State array has an incompatible number of sections. Expected: `%s`. Actual: `%s`.",t,$o,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 pfe(r){var e,t,i,n,a,u;if(i={},arguments.length){if(!gfe(r))throw new TypeError(Be("invalid argument. Options argument must be an object. Value: `%s`.",r));if(ac(r,"copy")&&(i.copy=r.copy,!ffe(r.copy)))throw new TypeError(Be("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy));if(ac(r,"state")){if(t=r.state,i.state=!0,!XR(t))throw new TypeError(Be("invalid option. `%s` option must be an Int32Array. Option: `%s`.","state",t));if(u=HR(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(ac(r,"seed"))if(n=r.seed,i.seed=!0,lfe(n)){if(n>mfe)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(dfe(n)&&n.length>0)a=n.length,e=new D($s+a),e[0]=Qo,e[1]=$o,e[_t]=1,e[X]=a,Aa.ndarray(a,n,1,0,e,1,X+1),t=new D(e.buffer,e.byteOffset+(_t+1)*e.BYTES_PER_ELEMENT,1),n=new D(e.buffer,e.byteOffset+(X+1)*e.BYTES_PER_ELEMENT,a),t[0]=n[0];else throw new TypeError(Be("invalid option. `%s` option must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integer values less than the maximum signed 32-bit integer. Option: `%s`.","seed",n));else n=YR()|0}else n=YR()|0;return t===void 0&&(e=new D($s+1),e[0]=Qo,e[1]=$o,e[_t]=1,e[X]=1,e[X+1]=n,t=new D(e.buffer,e.byteOffset+(_t+1)*e.BYTES_PER_ELEMENT,1),n=new D(e.buffer,e.byteOffset+(X+1)*e.BYTES_PER_ELEMENT,1),t[0]=n[0]),tt(p,"NAME","minstd"),Et(p,"seed",o),Et(p,"seedLength",v),DR(p,"state",l,m),Et(p,"stateLength",g),Et(p,"byteLength",c),tt(p,"toJSON",h),tt(p,"MIN",1),tt(p,"MAX",Zo-1),tt(p,"normalized",d),tt(d,"NAME",p.NAME),Et(d,"seed",o),Et(d,"seedLength",v),DR(d,"state",l,m),Et(d,"stateLength",g),Et(d,"byteLength",c),tt(d,"toJSON",h),tt(d,"MIN",(p.MIN-1)/sc),tt(d,"MAX",(p.MAX-1)/sc),p;function o(){var f=e[X];return Aa(f,n,1,new D(f),1)}function v(){return e[X]}function g(){return e.length}function c(){return e.byteLength}function l(){var f=e.length;return Aa(f,e,1,new D(f),1)}function m(f){var y;if(!XR(f))throw new TypeError(Be("invalid argument. Must provide an Int32Array. Value: `%s`.",f));if(y=HR(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=cfe(e),f.params=[],f}function p(){var f=t[0]|0;return f=hfe*f%Zo|0,t[0]=f,f|0}function d(){return(p()-1)/sc}}ZR.exports=pfe});var $R=s(function(VHe,QR){"use strict";var yfe=uc(),qfe=nc(),bfe=yfe({seed:qfe()});QR.exports=bfe});var $=s(function(FHe,eP){"use strict";var wfe=require("@stdlib/utils/define-nonenumerable-read-only-property"),KR=$R(),Sfe=uc();wfe(KR,"factory",Sfe);eP.exports=KR});var rP=s(function(WHe,Ofe){Ofe.exports={idtype:"float64",ndtype:"float64"}});var iP=s(function(IHe,tP){"use strict";var Efe=require("@stdlib/array/typed-real-float-dtypes"),_fe=require("@stdlib/array/typed-real-dtypes"),Nfe=require("@stdlib/assert/is-plain-object"),Ko=require("@stdlib/assert/has-own-property"),Ks=require("@stdlib/string/format"),eu=_fe(),ru=Efe();eu.push("generic");ru.push("generic");function Lfe(r,e,t){if(!Nfe(e))return new TypeError(Ks("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t===0){if(Ko(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(Ko(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&&Ko(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(Ko(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}tP.exports=Lfe});var vc=s(function(kHe,dP){"use strict";var nP=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,aP=require("@stdlib/utils/define-nonenumerable-read-only-property"),ev=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Rfe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),sP=$(),uP=require("@stdlib/array/typed-real-ctors"),oP=require("@stdlib/array/base/filled-by"),vP=require("@stdlib/strided/base/nullary"),gP=require("@stdlib/string/format"),fP=rP(),oc=iP();function Pfe(){var r,e,t,i,n,a;if(t={idtype:fP.idtype,ndtype:fP.ndtype},e=arguments.length,i=u,e===0)n=sP;else if(e===1&&(r=arguments[0],n=sP.factory(r),a=oc(t,r,0),a))throw a;return ev(i,"seed",v),ev(i,"seedLength",g),Rfe(i,"state",m,h),ev(i,"stateLength",c),ev(i,"byteLength",l),aP(i,"PRNG",n),aP(i,"normalized",o),i;function u(p,d){var f,y,q,b,w;if(!nP(p))throw new TypeError(gP("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=oc(w,d,1),q))throw q;return b=w.dtype||t.idtype,b==="generic"?oP(p,n):(f=uP(b),y=new f(p),vP([y],[p],[1],n),y)}function o(p,d){var f,y,q,b,w;if(!nP(p))throw new TypeError(gP("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=oc(w,d,2),q))throw q;return b=w.dtype||t.ndtype,b==="generic"?oP(p,n.normalized):(f=uP(b),y=new f(p),vP([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}}dP.exports=Pfe});var cP=s(function(zHe,lP){"use strict";var Tfe=vc(),jfe=Tfe();lP.exports=jfe});var pP=s(function(JHe,hP){"use strict";var Mfe=require("@stdlib/utils/define-nonenumerable-read-only-property"),mP=cP(),xfe=vc();Mfe(mP,"factory",xfe);hP.exports=mP});var qP=s(function(UHe,yP){"use strict";var Afe=require("@stdlib/math/base/assert/is-nan"),Gfe=8;function Vfe(r,e,t){var i,n;for(n=0;n=0;n--)e[n]=r();return e}yP.exports=Vfe});var gc=s(function(CHe,bP){"use strict";var Ffe=require("@stdlib/constants/int32/max"),Wfe=require("@stdlib/math/base/special/floor"),Ife=Ffe-1;function kfe(){var r=Wfe(1+Ife*Math.random());return r|0}bP.exports=kfe});var lc=s(function(BHe,NP){"use strict";var it=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nt=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),wP=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),fc=require("@stdlib/assert/has-own-property"),zfe=require("@stdlib/assert/is-plain-object"),Jfe=require("@stdlib/assert/is-boolean").isPrimitive,Ufe=require("@stdlib/assert/is-collection"),Cfe=require("@stdlib/assert/is-positive-integer").isPrimitive,SP=require("@stdlib/assert/is-int32array"),Ga=require("@stdlib/blas/base/gcopy"),Bfe=require("@stdlib/math/base/special/floor"),Y=require("@stdlib/array/int32"),tu=require("@stdlib/constants/int32/max"),Dfe=require("@stdlib/array/to-json"),K=require("@stdlib/string/format"),OP=qP(),EP=gc(),dc=tu-1|0,Xfe=tu-1|0,Yfe=16807,Z=32,iv=1,nv=3,Lt=2,Va=Z+3,H=Z+6,iu=Z+7,rv=Va+1,tv=Va+2;function _P(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(Ufe(n)&&n.length>0)a=n.length,e=new Y(iu+a),e[0]=iv,e[1]=nv,e[Lt]=Z,e[Va]=2,e[tv]=n[0],e[H]=a,Ga.ndarray(a,n,1,0,e,1,H+1),t=new Y(e.buffer,e.byteOffset+(Lt+1)*e.BYTES_PER_ELEMENT,Z),n=new Y(e.buffer,e.byteOffset+(H+1)*e.BYTES_PER_ELEMENT,a),t=OP(p,t,Z),e[rv]=t[0];else throw new TypeError(K("invalid option. `%s` option must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integer values less than the maximum signed 32-bit integer. Option: `%s`.","seed",n));else n=EP()|0}else n=EP()|0;return t===void 0&&(e=new Y(iu+1),e[0]=iv,e[1]=nv,e[Lt]=Z,e[Va]=2,e[tv]=n,e[H]=1,e[H+1]=n,t=new Y(e.buffer,e.byteOffset+(Lt+1)*e.BYTES_PER_ELEMENT,Z),n=new Y(e.buffer,e.byteOffset+(H+1)*e.BYTES_PER_ELEMENT,1),t=OP(p,t,Z),e[rv]=t[0]),it(d,"NAME","minstd-shuffle"),Nt(d,"seed",o),Nt(d,"seedLength",v),wP(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),wP(f,"state",l,m),Nt(f,"stateLength",g),Nt(f,"byteLength",c),it(f,"toJSON",h),it(f,"MIN",(d.MIN-1)/dc),it(f,"MAX",(d.MAX-1)/dc),d;function o(){var y=e[H];return Ga(y,n,1,new Y(y),1)}function v(){return e[H]}function g(){return e.length}function c(){return e.byteLength}function l(){var y=e.length;return Ga(y,e,1,new Y(y),1)}function m(y){var q;if(!SP(y))throw new TypeError(K("invalid argument. Must provide an Int32Array. Value: `%s`.",y));if(q=_P(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=Dfe(e),y.params=[],y}function p(){var y=e[tv]|0;return y=Yfe*y%tu|0,e[tv]=y,y|0}function d(){var y,q;return y=e[rv],q=Bfe(Z*(y/tu)),y=t[q],e[rv]=y,t[q]=p(),y}function f(){return(d()-1)/dc}}NP.exports=Hfe});var RP=s(function(DHe,LP){"use strict";var Zfe=lc(),Qfe=gc(),$fe=Zfe({seed:Qfe()});LP.exports=$fe});var ee=s(function(XHe,TP){"use strict";var Kfe=require("@stdlib/utils/define-nonenumerable-read-only-property"),PP=RP(),ede=lc();Kfe(PP,"factory",ede);TP.exports=PP});var jP=s(function(YHe,rde){rde.exports={idtype:"float64",ndtype:"float64"}});var xP=s(function(HHe,MP){"use strict";var tde=require("@stdlib/array/typed-real-float-dtypes"),ide=require("@stdlib/array/typed-real-dtypes"),nde=require("@stdlib/assert/is-plain-object"),av=require("@stdlib/assert/has-own-property"),nu=require("@stdlib/string/format"),au=ide(),su=tde();au.push("generic");su.push("generic");function ade(r,e,t){if(!nde(e))return new TypeError(nu("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t===0){if(av(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(av(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&&av(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(av(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}MP.exports=ade});var mc=s(function(ZHe,JP){"use strict";var AP=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,GP=require("@stdlib/utils/define-nonenumerable-read-only-property"),sv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),sde=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),VP=ee(),FP=require("@stdlib/array/typed-real-ctors"),WP=require("@stdlib/array/base/filled-by"),IP=require("@stdlib/strided/base/nullary"),kP=require("@stdlib/string/format"),zP=jP(),cc=xP();function ude(){var r,e,t,i,n,a;if(t={idtype:zP.idtype,ndtype:zP.ndtype},e=arguments.length,i=u,e===0)n=VP;else if(e===1&&(r=arguments[0],n=VP.factory(r),a=cc(t,r,0),a))throw a;return sv(i,"seed",v),sv(i,"seedLength",g),sde(i,"state",m,h),sv(i,"stateLength",c),sv(i,"byteLength",l),GP(i,"PRNG",n),GP(i,"normalized",o),i;function u(p,d){var f,y,q,b,w;if(!AP(p))throw new TypeError(kP("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=cc(w,d,1),q))throw q;return b=w.dtype||t.idtype,b==="generic"?WP(p,n):(f=FP(b),y=new f(p),IP([y],[p],[1],n),y)}function o(p,d){var f,y,q,b,w;if(!AP(p))throw new TypeError(kP("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=cc(w,d,2),q))throw q;return b=w.dtype||t.ndtype,b==="generic"?WP(p,n.normalized):(f=FP(b),y=new f(p),IP([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}}JP.exports=ude});var CP=s(function(QHe,UP){"use strict";var ode=mc(),vde=ode();UP.exports=vde});var XP=s(function($He,DP){"use strict";var gde=require("@stdlib/utils/define-nonenumerable-read-only-property"),BP=CP(),fde=mc();gde(BP,"factory",fde);DP.exports=BP});var YP=s(function(KHe,dde){dde.exports={idtype:"float64",ndtype:"float64"}});var ZP=s(function(eZe,HP){"use strict";var lde=require("@stdlib/array/typed-real-float-dtypes"),cde=require("@stdlib/array/typed-real-dtypes"),mde=require("@stdlib/assert/is-plain-object"),uv=require("@stdlib/assert/has-own-property"),uu=require("@stdlib/string/format"),ou=cde(),vu=lde();ou.push("generic");vu.push("generic");function hde(r,e,t){if(!mde(e))return new TypeError(uu("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t===0){if(uv(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(uv(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&&uv(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(uv(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}HP.exports=hde});var pc=s(function(rZe,aT){"use strict";var QP=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,$P=require("@stdlib/utils/define-nonenumerable-read-only-property"),ov=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),pde=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),KP=T(),eT=require("@stdlib/array/typed-real-ctors"),rT=require("@stdlib/array/base/filled-by"),tT=require("@stdlib/strided/base/nullary"),iT=require("@stdlib/string/format"),nT=YP(),hc=ZP();function yde(){var r,e,t,i,n,a;if(t={idtype:nT.idtype,ndtype:nT.ndtype},e=arguments.length,i=u,e===0)n=KP;else if(e===1&&(r=arguments[0],n=KP.factory(r),a=hc(t,r,0),a))throw a;return ov(i,"seed",v),ov(i,"seedLength",g),pde(i,"state",m,h),ov(i,"stateLength",c),ov(i,"byteLength",l),$P(i,"PRNG",n),$P(i,"normalized",o),i;function u(p,d){var f,y,q,b,w;if(!QP(p))throw new TypeError(iT("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=hc(w,d,1),q))throw q;return b=w.dtype||t.idtype,b==="generic"?rT(p,n):(f=eT(b),y=new f(p),tT([y],[p],[1],n),y)}function o(p,d){var f,y,q,b,w;if(!QP(p))throw new TypeError(iT("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=hc(w,d,2),q))throw q;return b=w.dtype||t.ndtype,b==="generic"?rT(p,n.normalized):(f=eT(b),y=new f(p),tT([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}}aT.exports=yde});var uT=s(function(tZe,sT){"use strict";var qde=pc(),bde=qde();sT.exports=bde});var gT=s(function(iZe,vT){"use strict";var wde=require("@stdlib/utils/define-nonenumerable-read-only-property"),oT=uT(),Sde=pc();wde(oT,"factory",Sde);vT.exports=oT});var dT=s(function(nZe,fT){"use strict";var Ode=require("@stdlib/math/base/special/exp");function Ede(r,e){for(var t=r(),i=1;t>Ode(-e);)i+=1,t*=r();return i-1}fT.exports=Ede});var hT=s(function(aZe,mT){"use strict";var _de=require("@stdlib/math/base/special/factorialln"),lT=require("@stdlib/math/base/special/floor"),Nde=require("@stdlib/math/base/special/signum"),Lde=require("@stdlib/math/base/special/sqrt"),cT=require("@stdlib/math/base/special/abs"),vv=require("@stdlib/math/base/special/ln"),Rde=require("@stdlib/constants/float64/ln-sqrt-two-pi"),Pde=1/12,Tde=1/360;function jde(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-cT(c))+v,c+=e+.445,lT(c);if(l>=u?c=r()-.5:(c=l/u-.93,c=Nde(c)*.5-c,l=u*r()),a=.5-cT(c),(a>=.013||a>=l)&&(g=lT((2*o/a+v)*c+e+.445),l*=i/(o/(a*a)+v),c=(g+.5)*vv(e/g),c+=-e-Rde+g,c-=(Pde-Tde/(g*g))/g,g>=10&&c>=vv(l*t)||(c=g*vv(e)-e-_de(g),g>=0&&g<=9&&c>=vv(l))))return g}}mT.exports=jde});var yT=s(function(sZe,pT){"use strict";var Mde=dT(),xde=hT();function Ade(r,e){return e<30?Mde(r,e):xde(r,e)}pT.exports=Ade});var yc=s(function(uZe,_T){"use strict";var nt=require("@stdlib/utils/define-nonenumerable-read-only-property"),gv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),qT=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Gde=require("@stdlib/assert/is-positive-number").isPrimitive,bT=require("@stdlib/assert/is-plain-object"),wT=require("@stdlib/assert/is-function"),ST=require("@stdlib/assert/has-own-property"),OT=require("@stdlib/utils/constant-function"),Vde=require("@stdlib/utils/noop"),fv=T().factory,Fde=require("@stdlib/math/base/assert/is-nan"),Wde=require("@stdlib/array/to-json"),dv=require("@stdlib/string/format"),ET=yT();function Ide(){var r,e,t,i;if(arguments.length===0)t=fv();else if(arguments.length===1&&bT(arguments[0]))if(e=arguments[0],ST(e,"prng")){if(!wT(e.prng))throw new TypeError(dv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=fv(e);else{if(r=arguments[0],!Gde(r))throw new TypeError(dv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(e=arguments[1],!bT(e))throw new TypeError(dv("invalid argument. Options argument must be an object. Value: `%s`.",e));if(ST(e,"prng")){if(!wT(e.prng))throw new TypeError(dv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=fv(e)}else t=fv()}return r===void 0?i=m:i=l,nt(i,"NAME","poisson"),e&&e.prng?(nt(i,"seed",null),nt(i,"seedLength",null),qT(i,"state",OT(null),Vde),nt(i,"stateLength",null),nt(i,"byteLength",null),nt(i,"toJSON",OT(null)),nt(i,"PRNG",t)):(gv(i,"seed",n),gv(i,"seedLength",a),qT(i,"state",v,g),gv(i,"stateLength",u),gv(i,"byteLength",o),nt(i,"toJSON",c),nt(i,"PRNG",t),t=t.normalized),i;function n(){return t.seed}function a(){return t.seedLength}function u(){return t.stateLength}function o(){return t.byteLength}function v(){return t.state}function g(h){t.state=h}function c(){var h={};return h.type="PRNG",h.name=i.NAME,h.state=Wde(t.state),r===void 0?h.params=[]:h.params=[r],h}function l(){return ET(t,r)}function m(h){return Fde(h)||h<=0?NaN:ET(t,h)}}_T.exports=Ide});var LT=s(function(oZe,NT){"use strict";var kde=yc(),zde=kde();NT.exports=zde});var mn=s(function(vZe,PT){"use strict";var Jde=require("@stdlib/utils/define-nonenumerable-read-only-property"),RT=LT(),Ude=yc();Jde(RT,"factory",Ude);PT.exports=RT});var jT=s(function(gZe,TT){"use strict";var Cde=require("@stdlib/assert/is-positive-number").isPrimitive,Bde=require("@stdlib/assert/is-number").isPrimitive,qc=require("@stdlib/string/format"),Dde=require("@stdlib/assert/is-nan");function Xde(r,e){return Cde(r)?!Bde(e)||Dde(e)?new TypeError(qc("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):e<=0||e>=1?new RangeError(qc("invalid argument. Second argument must be on the interval: (0, 1). Value: `%f`.",e)):null:new TypeError(qc("invalid argument. First argument must be a positive number. Value: `%s`.",r))}TT.exports=Xde});var Oc=s(function(fZe,IT){"use strict";var Rt=require("@stdlib/utils/define-nonenumerable-read-only-property"),lv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),MT=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Fa=require("@stdlib/assert/has-own-property"),xT=require("@stdlib/assert/is-plain-object"),bc=require("@stdlib/assert/is-uint32array"),AT=require("@stdlib/assert/is-boolean").isPrimitive,GT=require("@stdlib/assert/is-function"),VT=require("@stdlib/utils/constant-function"),Yde=require("@stdlib/utils/noop"),FT=require("@stdlib/math/base/assert/is-nan"),Wa=mn().factory,cv=Ce().factory,wc=require("@stdlib/blas/base/gcopy"),Sc=require("@stdlib/array/uint32"),WT=require("@stdlib/object/assign"),Hde=require("@stdlib/array/to-json"),at=require("@stdlib/string/format"),Zde=jT();function Qde(){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],!xT(i))throw new TypeError(at("invalid argument. Options argument must be an object. Value: `%s`.",i));if(Fa(i,"copy")&&!AT(i.copy))throw new TypeError(at("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",i.copy));if(Fa(i,"prng")){if(!GT(i.prng))throw new TypeError(at("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));t=Wa({prng:i.prng})}else{if(Fa(i,"state")&&!bc(i.state))throw new TypeError(at("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",i.state));i=WT({},i),i.copy===!1?u=!1:i.state&&(i.state=wc(i.state.length,i.state,1,new Sc(i.state.length),1)),i.copy=!1,t=Wa(i)}}else{if(g=arguments[0],v=arguments[1],o=Zde(g,v),o)throw o;if(arguments.length>2){if(i=arguments[2],!xT(i))throw new TypeError(at("invalid argument. Options argument must be an object. Value: `%s`.",i));if(Fa(i,"copy")&&!AT(i.copy))throw new TypeError(at("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",i.copy));if(Fa(i,"prng")){if(!GT(i.prng))throw new TypeError(at("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));t=Wa({prng:i.prng})}else{if(Fa(i,"state")&&!bc(i.state))throw new TypeError(at("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",i.state));i=WT({},i),i.copy===!1?u=!1:i.state&&(i.state=wc(i.state.length,i.state,1,new Sc(i.state.length),1)),i.copy=!1,t=Wa(i)}}else i={copy:!1},t=Wa(i)}return i&&i.prng?g===void 0?r=cv({prng:i.prng}):r=cv(g,v/(1-v),{prng:i.prng}):(i.state?e=i.state:(e=t.state,t.state=e),g===void 0?r=cv({state:e,copy:!1}):r=cv(g,v/(1-v),{state:e,copy:!1})),g===void 0?n=q:n=y,a=t.PRNG,Rt(n,"NAME","negative-binomial"),i&&i.prng?(Rt(n,"seed",null),Rt(n,"seedLength",null),MT(n,"state",VT(null),Yde),Rt(n,"stateLength",null),Rt(n,"byteLength",null),Rt(n,"toJSON",VT(null))):(lv(n,"seed",c),lv(n,"seedLength",l),MT(n,"state",p,d),lv(n,"stateLength",m),lv(n,"byteLength",h),Rt(n,"toJSON",f)),Rt(n,"PRNG",a),n;function c(){return a.seed}function l(){return a.seedLength}function m(){return a.stateLength}function h(){return a.byteLength}function p(){return a.state}function d(b){if(!bc(b))throw new TypeError(at("invalid argument. Must provide a Uint32Array. Value: `%s`.",b));u&&(b=wc(b.length,b,1,new Sc(b.length),1)),a.state=b}function f(){var b={};return b.type="PRNG",b.name=n.NAME,b.state=Hde(a.state),g===void 0?b.params=[]:b.params=[g,v],b}function y(){return t(r())}function q(b,w){return FT(b)||FT(w)||w<=0||w>=1?NaN:t(r(b,w/(1-w)))}}IT.exports=Qde});var zT=s(function(dZe,kT){"use strict";var $de=Oc(),Kde=$de();kT.exports=Kde});var Ia=s(function(lZe,UT){"use strict";var ele=require("@stdlib/utils/define-nonenumerable-read-only-property"),JT=zT(),rle=Oc();ele(JT,"factory",rle);UT.exports=JT});var Ec=s(function(cZe,CT){"use strict";var tle=F(),ile=require("@stdlib/array/dtypes"),nle=require("@stdlib/array/defaults"),ale=Ia(),sle=ile("real_and_generic"),ule=tle(ale,sle,nle.get("dtypes.real"));CT.exports=ule});var DT=s(function(mZe,BT){"use strict";var ole=Ec(),vle=ole();BT.exports=vle});var HT=s(function(hZe,YT){"use strict";var gle=require("@stdlib/utils/define-nonenumerable-read-only-property"),XT=DT(),fle=Ec();gle(XT,"factory",fle);YT.exports=XT});var $T=s(function(pZe,QT){"use strict";var dle=require("@stdlib/assert/is-number").isPrimitive,lle=require("@stdlib/assert/is-positive-number").isPrimitive,ZT=require("@stdlib/string/format"),cle=require("@stdlib/assert/is-nan");function mle(r,e){return!dle(r)||cle(r)?new TypeError(ZT("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):lle(e)?null:new TypeError(ZT("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}QT.exports=mle});var ej=s(function(yZe,KT){"use strict";function hle(r,e,t){return e+t*r()}KT.exports=hle});var _c=s(function(qZe,oj){"use strict";var Pt=require("@stdlib/utils/define-nonenumerable-read-only-property"),mv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),rj=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),tj=require("@stdlib/assert/is-plain-object"),ij=require("@stdlib/assert/is-function"),nj=require("@stdlib/assert/has-own-property"),aj=require("@stdlib/utils/constant-function"),ple=require("@stdlib/utils/noop"),ka=Q().factory,sj=require("@stdlib/math/base/assert/is-nan"),yle=require("@stdlib/array/to-json"),hv=require("@stdlib/string/format"),qle=$T(),uj=ej();function ble(){var r,e,t,i,n,a,u;if(arguments.length===0)e=ka();else if(arguments.length===1){if(t=arguments[0],!tj(t))throw new TypeError(hv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(nj(t,"prng")){if(!ij(t.prng))throw new TypeError(hv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));e=ka({prng:t.prng})}else e=ka(t)}else{if(u=arguments[0],r=arguments[1],a=qle(u,r),a)throw a;if(arguments.length>2){if(t=arguments[2],!tj(t))throw new TypeError(hv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(nj(t,"prng")){if(!ij(t.prng))throw new TypeError(hv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));e=ka({prng:t.prng})}else e=ka(t)}else e=ka()}return u===void 0?n=d:n=p,i=e.PRNG,Pt(n,"NAME","normal"),t&&t.prng?(Pt(n,"seed",null),Pt(n,"seedLength",null),rj(n,"state",aj(null),ple),Pt(n,"stateLength",null),Pt(n,"byteLength",null),Pt(n,"toJSON",aj(null))):(mv(n,"seed",o),mv(n,"seedLength",v),rj(n,"state",l,m),mv(n,"stateLength",g),mv(n,"byteLength",c),Pt(n,"toJSON",h)),Pt(n,"PRNG",i),n;function o(){return i.seed}function v(){return i.seedLength}function g(){return i.stateLength}function c(){return i.byteLength}function l(){return i.state}function m(f){i.state=f}function h(){var f={};return f.type="PRNG",f.name=n.NAME,f.state=yle(i.state),u===void 0?f.params=[]:f.params=[u,r],f}function p(){return uj(e,u,r)}function d(f,y){return sj(f)||sj(y)||y<=0?NaN:uj(e,f,y)}}oj.exports=ble});var gj=s(function(bZe,vj){"use strict";var wle=_c(),Sle=wle();vj.exports=Sle});var hn=s(function(wZe,dj){"use strict";var Ole=require("@stdlib/utils/define-nonenumerable-read-only-property"),fj=gj(),Ele=_c();Ole(fj,"factory",Ele);dj.exports=fj});var Nc=s(function(SZe,lj){"use strict";var _le=F(),Nle=require("@stdlib/array/dtypes"),Lle=require("@stdlib/array/defaults"),Rle=hn(),Ple=Nle("real_floating_point_and_generic"),Tle=_le(Rle,Ple,Lle.get("dtypes.real_floating_point"));lj.exports=Tle});var mj=s(function(OZe,cj){"use strict";var jle=Nc(),Mle=jle();cj.exports=Mle});var yj=s(function(EZe,pj){"use strict";var xle=require("@stdlib/utils/define-nonenumerable-read-only-property"),hj=mj(),Ale=Nc();xle(hj,"factory",Ale);pj.exports=hj});var Sj=s(function(_Ze,wj){"use strict";var qj=require("@stdlib/assert/is-positive-number").isPrimitive,bj=require("@stdlib/string/format");function Gle(r,e){return qj(r)?qj(e)?null:new TypeError(bj("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(bj("invalid argument. First argument must be a positive number. Value: `%s`.",r))}wj.exports=Gle});var Ej=s(function(NZe,Oj){"use strict";var Vle=require("@stdlib/math/base/special/pow");function Fle(r,e,t){return t/Vle(r(),1/e)}Oj.exports=Fle});var Lc=s(function(LZe,Mj){"use strict";var st=require("@stdlib/utils/define-nonenumerable-read-only-property"),pv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),_j=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Nj=require("@stdlib/assert/is-plain-object"),Lj=require("@stdlib/assert/is-function"),Rj=require("@stdlib/assert/has-own-property"),Pj=require("@stdlib/utils/constant-function"),Wle=require("@stdlib/utils/noop"),yv=T().factory,Tj=require("@stdlib/math/base/assert/is-nan"),Ile=require("@stdlib/array/to-json"),qv=require("@stdlib/string/format"),kle=Sj(),jj=Ej();function zle(){var r,e,t,i,n,a;if(arguments.length===0)i=yv();else if(arguments.length===1){if(t=arguments[0],!Nj(t))throw new TypeError(qv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(Rj(t,"prng")){if(!Lj(t.prng))throw new TypeError(qv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));i=t.prng}else i=yv(t)}else{if(r=arguments[0],e=arguments[1],a=kle(r,e),a)throw a;if(arguments.length>2){if(t=arguments[2],!Nj(t))throw new TypeError(qv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(Rj(t,"prng")){if(!Lj(t.prng))throw new TypeError(qv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));i=t.prng}else i=yv(t)}else i=yv()}return r===void 0?n=p:n=h,st(n,"NAME","pareto-type1"),t&&t.prng?(st(n,"seed",null),st(n,"seedLength",null),_j(n,"state",Pj(null),Wle),st(n,"stateLength",null),st(n,"byteLength",null),st(n,"toJSON",Pj(null)),st(n,"PRNG",i)):(pv(n,"seed",u),pv(n,"seedLength",o),_j(n,"state",c,l),pv(n,"stateLength",v),pv(n,"byteLength",g),st(n,"toJSON",m),st(n,"PRNG",i),i=i.normalized),n;function u(){return i.seed}function o(){return i.seedLength}function v(){return i.stateLength}function g(){return i.byteLength}function c(){return i.state}function l(d){i.state=d}function m(){var d={};return d.type="PRNG",d.name=n.NAME,d.state=Ile(i.state),r===void 0?d.params=[]:d.params=[r,e],d}function h(){return jj(i,r,e)}function p(d,f){return Tj(d)||Tj(f)||d<=0||f<=0?NaN:jj(i,d,f)}}Mj.exports=zle});var Aj=s(function(RZe,xj){"use strict";var Jle=Lc(),Ule=Jle();xj.exports=Ule});var za=s(function(PZe,Vj){"use strict";var Cle=require("@stdlib/utils/define-nonenumerable-read-only-property"),Gj=Aj(),Ble=Lc();Cle(Gj,"factory",Ble);Vj.exports=Gj});var Rc=s(function(TZe,Fj){"use strict";var Dle=F(),Xle=require("@stdlib/array/dtypes"),Yle=require("@stdlib/array/defaults"),Hle=za(),Zle=Xle("real_floating_point_and_generic"),Qle=Dle(Hle,Zle,Yle.get("dtypes.real_floating_point"));Fj.exports=Qle});var Ij=s(function(jZe,Wj){"use strict";var $le=Rc(),Kle=$le();Wj.exports=Kle});var Jj=s(function(MZe,zj){"use strict";var ece=require("@stdlib/utils/define-nonenumerable-read-only-property"),kj=Ij(),rce=Rc();ece(kj,"factory",rce);zj.exports=kj});var Pc=s(function(xZe,Uj){"use strict";var tce=Fr(),ice=require("@stdlib/array/dtypes"),nce=require("@stdlib/array/defaults"),ace=mn(),sce=ice("real_and_generic"),uce=tce(ace,sce,nce.get("dtypes.real"));Uj.exports=uce});var Bj=s(function(AZe,Cj){"use strict";var oce=Pc(),vce=oce();Cj.exports=vce});var Yj=s(function(GZe,Xj){"use strict";var gce=require("@stdlib/utils/define-nonenumerable-read-only-property"),Dj=Bj(),fce=Pc();gce(Dj,"factory",fce);Xj.exports=Dj});var Hj=s(function(VZe,dce){dce.exports={name:"mt19937",copy:!0}});var Qj=s(function(FZe,Zj){"use strict";var lce=$(),cce=ee(),mce=T(),bv={};bv.minstd=lce;bv["minstd-shuffle"]=cce;bv.mt19937=mce;Zj.exports=bv});var Tc=s(function(WZe,Kj){"use strict";var gu=require("@stdlib/utils/define-nonenumerable-read-only-property"),wv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),hce=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),pce=require("@stdlib/assert/is-plain-object"),yce=require("@stdlib/assert/is-boolean").isPrimitive,Sv=require("@stdlib/assert/has-own-property"),qce=require("@stdlib/array/to-json"),fu=require("@stdlib/string/format"),$j=Hj(),bce=Qj();function wce(r){var e,t,i;if(e={name:$j.name,copy:$j.copy},arguments.length){if(!pce(r))throw new TypeError(fu("invalid argument. Must provide an object. Value: `%s`.",r));if(Sv(r,"name")&&(e.name=r.name),Sv(r,"state")){if(e.state=r.state,e.state===void 0)throw new TypeError(fu("invalid option. `%s` option cannot be undefined. Option: `%s`.","state",e.state))}else if(Sv(r,"seed")&&(e.seed=r.seed,e.seed===void 0))throw new TypeError(fu("invalid option. `%s` option cannot be undefined. Option: `%s`.","seed",e.seed));if(Sv(r,"copy")&&(e.copy=r.copy,!yce(e.copy)))throw new TypeError(fu("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",e.copy))}if(i=bce[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"),wv(l,"seed",n),wv(l,"seedLength",a),hce(l,"state",v,g),wv(l,"stateLength",u),wv(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=qce(t.state),m.params=[],m}function l(){return t.normalized()}}Kj.exports=wce});var r0=s(function(IZe,e0){"use strict";var Sce=Tc(),Oce=Sce();e0.exports=Oce});var Tt=s(function(kZe,i0){"use strict";var Ece=require("@stdlib/utils/define-nonenumerable-read-only-property"),t0=r0(),_ce=Tc();Ece(t0,"factory",_ce);i0.exports=t0});var n0=s(function(zZe,Nce){Nce.exports={dtype:"float64"}});var u0=s(function(JZe,s0){"use strict";var Lce=require("@stdlib/array/typed-real-float-dtypes"),Rce=require("@stdlib/assert/is-plain-object"),Pce=require("@stdlib/assert/has-own-property"),a0=require("@stdlib/string/format"),jc=Lce();jc.push("generic");function Tce(r,e){return Rce(e)?Pce(e,"dtype")&&(r.dtype=e.dtype,jc.indexOf(r.dtype)<0)?new TypeError(a0('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",jc.join('", "'),r.dtype)):null:new TypeError(a0("invalid argument. Options argument must be an object. Value: `%s`.",e))}s0.exports=Tce});var Mc=s(function(UZe,g0){"use strict";var jce=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Mce=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ov=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),xce=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),o0=Tt(),Ace=require("@stdlib/array/typed-real-float-ctors"),Gce=require("@stdlib/array/base/filled-by"),Vce=require("@stdlib/strided/base/nullary"),Fce=require("@stdlib/string/format"),Wce=n0(),v0=u0();function Ice(){var r,e,t,i,n,a;if(t={dtype:Wce.dtype},e=arguments.length,i=u,e===0)n=o0;else if(e===1&&(r=arguments[0],n=o0.factory(r),a=v0(t,r),a))throw a;return Ov(i,"seed",o),Ov(i,"seedLength",v),xce(i,"state",l,m),Ov(i,"stateLength",g),Ov(i,"byteLength",c),Mce(i,"PRNG",n.PRNG),i;function u(h,p){var d,f,y,q,b;if(!jce(h))throw new TypeError(Fce("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",h));if(b={},arguments.length>1&&(y=v0(b,p),y))throw y;return q=b.dtype||t.dtype,q==="generic"?Gce(h,n):(d=Ace(q),f=new d(h),Vce([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}}g0.exports=Ice});var d0=s(function(CZe,f0){"use strict";var kce=Mc(),zce=kce();f0.exports=zce});var m0=s(function(BZe,c0){"use strict";var Jce=require("@stdlib/utils/define-nonenumerable-read-only-property"),l0=d0(),Uce=Mc();Jce(l0,"factory",Uce);c0.exports=l0});var p0=s(function(DZe,h0){"use strict";var Cce=require("@stdlib/math/base/special/sqrt"),Bce=require("@stdlib/math/base/special/ln");function Dce(r,e){return e*Cce(-2*Bce(r()))}h0.exports=Dce});var xc=s(function(XZe,E0){"use strict";var ut=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ev=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),y0=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Xce=require("@stdlib/assert/is-positive-number").isPrimitive,q0=require("@stdlib/assert/is-plain-object"),b0=require("@stdlib/assert/is-function"),w0=require("@stdlib/assert/has-own-property"),S0=require("@stdlib/utils/constant-function"),Yce=require("@stdlib/utils/noop"),_v=T().factory,Hce=require("@stdlib/math/base/assert/is-nan"),Zce=require("@stdlib/array/to-json"),Nv=require("@stdlib/string/format"),O0=p0();function Qce(){var r,e,t,i;if(arguments.length===0)t=_v();else if(arguments.length===1&&q0(arguments[0]))if(e=arguments[0],w0(e,"prng")){if(!b0(e.prng))throw new TypeError(Nv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=_v(e);else{if(r=arguments[0],!Xce(r))throw new TypeError(Nv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(e=arguments[1],!q0(e))throw new TypeError(Nv("invalid argument. Options argument must be an object. Value: `%s`.",e));if(w0(e,"prng")){if(!b0(e.prng))throw new TypeError(Nv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=_v(e)}else t=_v()}return r===void 0?i=m:i=l,ut(i,"NAME","rayleigh"),e&&e.prng?(ut(i,"seed",null),ut(i,"seedLength",null),y0(i,"state",S0(null),Yce),ut(i,"stateLength",null),ut(i,"byteLength",null),ut(i,"toJSON",S0(null)),ut(i,"PRNG",t)):(Ev(i,"seed",n),Ev(i,"seedLength",a),y0(i,"state",v,g),Ev(i,"stateLength",u),Ev(i,"byteLength",o),ut(i,"toJSON",c),ut(i,"PRNG",t),t=t.normalized),i;function n(){return t.seed}function a(){return t.seedLength}function u(){return t.stateLength}function o(){return t.byteLength}function v(){return t.state}function g(h){t.state=h}function c(){var h={};return h.type="PRNG",h.name=i.NAME,h.state=Zce(t.state),r===void 0?h.params=[]:h.params=[r],h}function l(){return O0(t,r)}function m(h){return Hce(h)||h<=0?NaN:O0(t,h)}}E0.exports=Qce});var N0=s(function(YZe,_0){"use strict";var $ce=xc(),Kce=$ce();_0.exports=Kce});var Ja=s(function(HZe,R0){"use strict";var eme=require("@stdlib/utils/define-nonenumerable-read-only-property"),L0=N0(),rme=xc();eme(L0,"factory",rme);R0.exports=L0});var Ac=s(function(ZZe,P0){"use strict";var tme=Fr(),ime=require("@stdlib/array/dtypes"),nme=require("@stdlib/array/defaults"),ame=Ja(),sme=ime("real_floating_point_and_generic"),ume=tme(ame,sme,nme.get("dtypes.real_floating_point"));P0.exports=ume});var j0=s(function(QZe,T0){"use strict";var ome=Ac(),vme=ome();T0.exports=vme});var A0=s(function($Ze,x0){"use strict";var gme=require("@stdlib/utils/define-nonenumerable-read-only-property"),M0=j0(),fme=Ac();gme(M0,"factory",fme);x0.exports=M0});var Wc=s(function(KZe,U0){"use strict";var jt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Lv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),G0=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ua=require("@stdlib/assert/has-own-property"),V0=require("@stdlib/assert/is-positive-number").isPrimitive,F0=require("@stdlib/assert/is-plain-object"),Gc=require("@stdlib/assert/is-uint32array"),W0=require("@stdlib/assert/is-boolean").isPrimitive,dme=require("@stdlib/math/base/assert/is-nan"),I0=require("@stdlib/assert/is-function"),k0=require("@stdlib/utils/constant-function"),lme=require("@stdlib/utils/noop"),Rv=Xe().factory,Ca=Q().factory,Vc=require("@stdlib/blas/base/gcopy"),Fc=require("@stdlib/array/uint32"),z0=require("@stdlib/object/assign"),cme=require("@stdlib/array/to-json"),Ye=require("@stdlib/string/format"),J0=require("@stdlib/math/base/special/sqrt");function mme(){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(F0(arguments[0])){if(n=arguments[0],Ua(n,"copy")&&!W0(n.copy))throw new TypeError(Ye("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(Ua(n,"prng")){if(!I0(n.prng))throw new TypeError(Ye("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));t=Ca({prng:n.prng})}else{if(Ua(n,"state")&&!Gc(n.state))throw new TypeError(Ye("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=z0({},n),n.copy===!1?u=!1:n.state&&(n.state=Vc(n.state.length,n.state,1,new Fc(n.state.length),1)),n.copy=!1,t=Ca(n)}}else{if(o=arguments[0],!V0(o))throw new TypeError(Ye("invalid argument. First argument must be a positive number or an options object. Value: `%s`.",o));n={copy:!1},t=Ca(n)}else{if(o=arguments[0],!V0(o))throw new TypeError(Ye("invalid argument. First argument must be a positive number. Value: `%s`.",o));if(n=arguments[1],!F0(n))throw new TypeError(Ye("invalid argument. Options argument must be an object. Value: `%s`.",n));if(Ua(n,"copy")&&!W0(n.copy))throw new TypeError(Ye("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(Ua(n,"prng")){if(!I0(n.prng))throw new TypeError(Ye("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));t=Ca({prng:n.prng})}else{if(Ua(n,"state")&&!Gc(n.state))throw new TypeError(Ye("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=z0({},n),n.copy===!1?u=!1:n.state&&(n.state=Vc(n.state.length,n.state,1,new Fc(n.state.length),1)),n.copy=!1,t=Ca(n)}}return n&&n.prng?o===void 0?r=Rv({prng:n.prng}):r=Rv(o,{prng:n.prng}):(n.state?e=n.state:(e=t.state,t.state=e),o===void 0?r=Rv({state:e,copy:!1}):r=Rv(o,{state:e,copy:!1})),o===void 0?a=f:a=d,i=t.PRNG,jt(a,"NAME","t"),n&&n.prng?(jt(a,"seed",null),jt(a,"seedLength",null),G0(a,"state",k0(null),lme),jt(a,"stateLength",null),jt(a,"byteLength",null),jt(a,"toJSON",k0(null))):(Lv(a,"seed",v),Lv(a,"seedLength",g),G0(a,"state",m,h),Lv(a,"stateLength",c),Lv(a,"byteLength",l),jt(a,"toJSON",p)),jt(a,"PRNG",i),a;function v(){return i.seed}function g(){return i.seedLength}function c(){return i.stateLength}function l(){return i.byteLength}function m(){return i.state}function h(y){if(!Gc(y))throw new TypeError(Ye("invalid argument. Must provide a Uint32Array. Value: `%s`.",y));u&&(y=Vc(y.length,y,1,new Fc(y.length),1)),i.state=y}function p(){var y={};return y.type="PRNG",y.name=a.NAME,y.state=cme(i.state),o===void 0?y.params=[]:y.params=[o],y}function d(){return t()/J0(r()/o)}function f(y){return dme(y)||y<=0?NaN:t()/J0(r(y)/y)}}U0.exports=mme});var B0=s(function(eQe,C0){"use strict";var hme=Wc(),pme=hme();C0.exports=pme});var Ba=s(function(rQe,X0){"use strict";var yme=require("@stdlib/utils/define-nonenumerable-read-only-property"),D0=B0(),qme=Wc();yme(D0,"factory",qme);X0.exports=D0});var Ic=s(function(tQe,Y0){"use strict";var bme=Fr(),wme=require("@stdlib/array/dtypes"),Sme=require("@stdlib/array/defaults"),Ome=Ba(),Eme=wme("real_floating_point_and_generic"),_me=bme(Ome,Eme,Sme.get("dtypes.real_floating_point"));Y0.exports=_me});var Z0=s(function(iQe,H0){"use strict";var Nme=Ic(),Lme=Nme();H0.exports=Lme});var K0=s(function(nQe,$0){"use strict";var Rme=require("@stdlib/utils/define-nonenumerable-read-only-property"),Q0=Z0(),Pme=Ic();Rme(Q0,"factory",Pme);$0.exports=Q0});var rM=s(function(aQe,eM){"use strict";var kc=require("@stdlib/assert/is-number").isPrimitive,Pv=require("@stdlib/string/format"),zc=require("@stdlib/assert/is-nan");function Tme(r,e,t){return!kc(r)||zc(r)?new TypeError(Pv("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):!kc(e)||zc(e)?new TypeError(Pv("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):!kc(t)||zc(t)?new TypeError(Pv("invalid argument. Third argument must be a number and not NaN. Value: `%s`.",t)):r<=t&&t<=e?null:new RangeError(Pv("invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.","a <= c <= b",r,e,t))}eM.exports=Tme});var nM=s(function(sQe,iM){"use strict";var tM=require("@stdlib/math/base/special/sqrt");function jme(r,e,t,i){var n,a,u;return n=(i-e)/(t-e),u=r(),u3){if(r=arguments[3],!sM(r))throw new TypeError(Mv("invalid argument. Options argument must be an object. Value: `%s`.",r));if(oM(r,"prng")){if(!uM(r.prng))throw new TypeError(Mv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=jv(r)}else e=jv()}return n===void 0?t=d:t=p,ot(t,"NAME","triangular"),r&&r.prng?(ot(t,"seed",null),ot(t,"seedLength",null),aM(t,"state",vM(null),Mme),ot(t,"stateLength",null),ot(t,"byteLength",null),ot(t,"toJSON",vM(null)),ot(t,"PRNG",e)):(Tv(t,"seed",o),Tv(t,"seedLength",v),aM(t,"state",l,m),Tv(t,"stateLength",g),Tv(t,"byteLength",c),ot(t,"toJSON",h),ot(t,"PRNG",e),e=e.normalized),t;function o(){return e.seed}function v(){return e.seedLength}function g(){return e.stateLength}function c(){return e.byteLength}function l(){return e.state}function m(f){e.state=f}function h(){var f={};return f.type="PRNG",f.name=t.NAME,f.state=xme(e.state),n===void 0?f.params=[]:f.params=[n,a,u],f}function p(){return gM(e,n,a,u)}function d(f,y,q){return Jc(f)||Jc(y)||Jc(q)||!(f<=q&&q<=y)?NaN:gM(e,f,y,q)}}fM.exports=Gme});var lM=s(function(oQe,dM){"use strict";var Vme=Uc(),Fme=Vme();dM.exports=Fme});var Da=s(function(vQe,mM){"use strict";var Wme=require("@stdlib/utils/define-nonenumerable-read-only-property"),cM=lM(),Ime=Uc();Wme(cM,"factory",Ime);mM.exports=cM});var Cc=s(function(gQe,hM){"use strict";var kme=bo(),zme=require("@stdlib/array/dtypes"),Jme=require("@stdlib/array/defaults"),Ume=Da(),Cme=zme("real_floating_point_and_generic"),Bme=kme(Ume,Cme,Jme.get("dtypes.real_floating_point"));hM.exports=Bme});var yM=s(function(fQe,pM){"use strict";var Dme=Cc(),Xme=Dme();pM.exports=Xme});var wM=s(function(dQe,bM){"use strict";var Yme=require("@stdlib/utils/define-nonenumerable-read-only-property"),qM=yM(),Hme=Cc();Yme(qM,"factory",Hme);bM.exports=qM});var _M=s(function(lQe,EM){"use strict";var SM=require("@stdlib/assert/is-number").isPrimitive,Bc=require("@stdlib/string/format"),OM=require("@stdlib/assert/is-nan");function Zme(r,e){return!SM(r)||OM(r)?new TypeError(Bc("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):!SM(e)||OM(e)?new TypeError(Bc("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):r>=e?new RangeError(Bc("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e)):null}EM.exports=Zme});var LM=s(function(cQe,NM){"use strict";function Qme(r,e,t){var i=r();return t*i+(1-i)*e}NM.exports=Qme});var Dc=s(function(mQe,GM){"use strict";var vt=require("@stdlib/utils/define-nonenumerable-read-only-property"),xv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),RM=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),PM=require("@stdlib/assert/is-plain-object"),TM=require("@stdlib/assert/is-function"),jM=require("@stdlib/assert/has-own-property"),MM=require("@stdlib/utils/constant-function"),$me=require("@stdlib/utils/noop"),Av=T().factory,xM=require("@stdlib/math/base/assert/is-nan"),Kme=require("@stdlib/array/to-json"),Gv=require("@stdlib/string/format"),ehe=_M(),AM=LM();function rhe(){var r,e,t,i,n,a;if(arguments.length===0)e=Av();else if(arguments.length===1){if(r=arguments[0],!PM(r))throw new TypeError(Gv("invalid argument. Options argument must be an object. Value: `%s`.",r));if(jM(r,"prng")){if(!TM(r.prng))throw new TypeError(Gv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Av(r)}else{if(n=arguments[0],a=arguments[1],i=ehe(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!PM(r))throw new TypeError(Gv("invalid argument. Options argument must be an object. Value: `%s`.",r));if(jM(r,"prng")){if(!TM(r.prng))throw new TypeError(Gv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Av(r)}else e=Av()}return n===void 0?t=p:t=h,vt(t,"NAME","uniform"),r&&r.prng?(vt(t,"seed",null),vt(t,"seedLength",null),RM(t,"state",MM(null),$me),vt(t,"stateLength",null),vt(t,"byteLength",null),vt(t,"toJSON",MM(null)),vt(t,"PRNG",e)):(xv(t,"seed",u),xv(t,"seedLength",o),RM(t,"state",c,l),xv(t,"stateLength",v),xv(t,"byteLength",g),vt(t,"toJSON",m),vt(t,"PRNG",e),e=e.normalized),t;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=t.NAME,d.state=Kme(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return AM(e,n,a)}function p(d,f){return xM(d)||xM(f)||d>=f?NaN:AM(e,d,f)}}GM.exports=rhe});var FM=s(function(hQe,VM){"use strict";var the=Dc(),ihe=the();VM.exports=ihe});var pn=s(function(pQe,IM){"use strict";var nhe=require("@stdlib/utils/define-nonenumerable-read-only-property"),WM=FM(),ahe=Dc();nhe(WM,"factory",ahe);IM.exports=WM});var Xc=s(function(yQe,kM){"use strict";var she=F(),uhe=require("@stdlib/array/dtypes"),ohe=require("@stdlib/array/defaults"),vhe=pn(),ghe=uhe("real_floating_point_and_generic"),fhe=she(vhe,ghe,ohe.get("dtypes.real_floating_point"));kM.exports=fhe});var JM=s(function(qQe,zM){"use strict";var dhe=Xc(),lhe=dhe();zM.exports=lhe});var BM=s(function(bQe,CM){"use strict";var che=require("@stdlib/utils/define-nonenumerable-read-only-property"),UM=JM(),mhe=Xc();che(UM,"factory",mhe);CM.exports=UM});var HM=s(function(wQe,YM){"use strict";var DM=require("@stdlib/assert/is-positive-number").isPrimitive,XM=require("@stdlib/string/format");function hhe(r,e){return DM(r)?DM(e)?null:new TypeError(XM("invalid argument. Shape parameter must be a positive number. Value: `%s`.",e)):new TypeError(XM("invalid argument. Scale parameter must be a positive number. Value: `%s`.",r))}YM.exports=hhe});var QM=s(function(SQe,ZM){"use strict";var phe=require("@stdlib/math/base/special/pow"),yhe=require("@stdlib/math/base/special/ln");function qhe(r,e,t){return t*phe(-yhe(1-r()),1/e)}ZM.exports=qhe});var Yc=s(function(OQe,ax){"use strict";var gt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),$M=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),KM=require("@stdlib/assert/is-plain-object"),ex=require("@stdlib/assert/is-function"),rx=require("@stdlib/assert/has-own-property"),tx=require("@stdlib/utils/constant-function"),bhe=require("@stdlib/utils/noop"),Fv=T().factory,ix=require("@stdlib/math/base/assert/is-nan"),whe=require("@stdlib/array/to-json"),Wv=require("@stdlib/string/format"),She=HM(),nx=QM();function Ohe(){var r,e,t,i,n,a;if(arguments.length===0)t=Fv();else if(arguments.length===1){if(e=arguments[0],!KM(e))throw new TypeError(Wv("invalid argument. Options argument must be an object. Value: `%s`.",e));if(rx(e,"prng")){if(!ex(e.prng))throw new TypeError(Wv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=Fv(e)}else{if(a=arguments[0],r=arguments[1],n=She(r,a),n)throw n;if(arguments.length>2){if(e=arguments[2],!KM(e))throw new TypeError(Wv("invalid argument. Options argument must be an object. Value: `%s`.",e));if(rx(e,"prng")){if(!ex(e.prng))throw new TypeError(Wv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=Fv(e)}else t=Fv()}return r===void 0?i=p:i=h,gt(i,"NAME","weibull"),e&&e.prng?(gt(i,"seed",null),gt(i,"seedLength",null),$M(i,"state",tx(null),bhe),gt(i,"stateLength",null),gt(i,"byteLength",null),gt(i,"toJSON",tx(null)),gt(i,"PRNG",t)):(Vv(i,"seed",u),Vv(i,"seedLength",o),$M(i,"state",c,l),Vv(i,"stateLength",v),Vv(i,"byteLength",g),gt(i,"toJSON",m),gt(i,"PRNG",t),t=t.normalized),i;function u(){return t.seed}function o(){return t.seedLength}function v(){return t.stateLength}function g(){return t.byteLength}function c(){return t.state}function l(d){t.state=d}function m(){var d={};return d.type="PRNG",d.name=i.NAME,d.state=whe(t.state),a===void 0?d.params=[]:d.params=[a,r],d}function h(){return nx(t,a,r)}function p(d,f){return ix(d)||ix(f)||d<=0||f<=0?NaN:nx(t,d,f)}}ax.exports=Ohe});var ux=s(function(EQe,sx){"use strict";var Ehe=Yc(),_he=Ehe();sx.exports=_he});var yn=s(function(_Qe,vx){"use strict";var Nhe=require("@stdlib/utils/define-nonenumerable-read-only-property"),ox=ux(),Lhe=Yc();Nhe(ox,"factory",Lhe);vx.exports=ox});var Hc=s(function(NQe,gx){"use strict";var Rhe=F(),Phe=require("@stdlib/array/dtypes"),The=require("@stdlib/array/defaults"),jhe=yn(),Mhe=Phe("real_floating_point_and_generic"),xhe=Rhe(jhe,Mhe,The.get("dtypes.real_floating_point"));gx.exports=xhe});var dx=s(function(LQe,fx){"use strict";var Ahe=Hc(),Ghe=Ahe();fx.exports=Ghe});var mx=s(function(RQe,cx){"use strict";var Vhe=require("@stdlib/utils/define-nonenumerable-read-only-property"),lx=dx(),Fhe=Hc();Vhe(lx,"factory",Fhe);cx.exports=lx});var px=s(function(PQe,hx){"use strict";var M=require("@stdlib/utils/define-read-only-property"),j={};M(j,"arcsine",ty());M(j,"bernoulli",My());M(j,"beta",Wq());M(j,"betaprime",Rb());M(j,"binomial",nw());M(j,"cauchy",Lw());M(j,"chi",eS());M(j,"chisquare",sS());M(j,"cosine",PS());M(j,"discreteUniform",eO());M(j,"erlang",OO());M(j,"exponential",JO());M(j,"f",dE());M(j,"frechet",YE());M(j,"gamma",e_());M(j,"geometric",b_());M(j,"gumbel",C_());M(j,"hypergeometric",cN());M(j,"invgamma",GN());M(j,"kumaraswamy",sL());M(j,"laplace",PL());M(j,"levy",$L());M(j,"logistic",wR());M(j,"lognormal",CR());M(j,"minstd",pP());M(j,"minstdShuffle",XP());M(j,"mt19937",gT());M(j,"negativeBinomial",HT());M(j,"normal",yj());M(j,"pareto1",Jj());M(j,"poisson",Yj());M(j,"randu",m0());M(j,"rayleigh",A0());M(j,"t",K0());M(j,"triangular",wM());M(j,"uniform",BM());M(j,"weibull",mx());hx.exports=j});var qx=s(function(TQe,yx){"use strict";var Whe=require("@stdlib/math/base/special/sqrt"),Ihe=require("@stdlib/math/base/special/ln"),khe=require("@stdlib/math/base/special/sin"),zhe=require("@stdlib/math/base/special/cos"),Jhe=require("@stdlib/constants/float64/two-pi");function Uhe(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=Whe(-2*Ihe(n)),o=Jhe*a,t=u*zhe(o),e=!1,u*khe(o)}return e=!0,t}}yx.exports=Uhe});var wx=s(function(jQe,bx){"use strict";var Che=require("@stdlib/math/base/special/sqrt"),Bhe=require("@stdlib/math/base/special/ln"),Dhe=require("@stdlib/math/base/special/cos"),Xhe=require("@stdlib/constants/float64/pi"),Yhe=Dhe(Xhe);function Hhe(r){var e=Che(-2*Bhe(r));return e*Yhe}bx.exports=Hhe});var Ox=s(function(MQe,Sx){"use strict";var Zhe=require("@stdlib/math/base/special/sqrt"),Qhe=require("@stdlib/math/base/special/ln"),$he=require("@stdlib/math/base/special/cos"),Khe=require("@stdlib/constants/float64/two-pi");function epe(r){var e=Zhe(-2*Qhe(r)),t=Khe*r;return e*$he(t)}Sx.exports=epe});var Zc=s(function(xQe,Lx){"use strict";var re=require("@stdlib/utils/define-nonenumerable-read-only-property"),Iv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Ex=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),rpe=require("@stdlib/assert/is-plain-object"),tpe=require("@stdlib/assert/is-function"),ipe=require("@stdlib/assert/is-boolean").isPrimitive,du=require("@stdlib/assert/has-own-property"),npe=require("@stdlib/assert/is-uint32array"),_x=T().factory,Nx=require("@stdlib/utils/constant-function"),ape=require("@stdlib/utils/noop"),spe=require("@stdlib/array/to-json"),lu=require("@stdlib/string/format"),upe=qx(),ope=wx(),vpe=Ox();function gpe(r){var e,t,i,n;if(n={copy:!0},arguments.length){if(!rpe(r))throw new TypeError(lu("invalid argument. Must provide an object. Value: `%s`.",r));if(du(r,"copy")&&(n.copy=r.copy,!ipe(r.copy)))throw new TypeError(lu("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy));if(du(r,"prng")){if(!tpe(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,!npe(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=_x(n),e=i.normalized):n.seed=null:(i=_x(n),e=i.normalized),t=upe(e),re(t,"NAME","box-muller"),n.seed===null?(re(t,"seed",null),re(t,"seedLength",null)):(Iv(t,"seed",a),Iv(t,"seedLength",u)),r&&r.prng?(Ex(t,"state",Nx(null),ape),re(t,"stateLength",null),re(t,"byteLength",null),re(t,"toJSON",Nx(null))):(Ex(t,"state",g,c),Iv(t,"stateLength",o),Iv(t,"byteLength",v),re(t,"toJSON",l)),re(t,"PRNG",e),du(e,"MIN")?(re(t,"MIN",ope(e.MIN)),re(t,"MAX",vpe(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=spe(i.state),m.params=[],m}}Lx.exports=gpe});var Px=s(function(AQe,Rx){"use strict";var fpe=Zc(),dpe=fpe();Rx.exports=dpe});var Xa=s(function(GQe,jx){"use strict";var lpe=require("@stdlib/utils/define-nonenumerable-read-only-property"),Tx=Px(),cpe=Zc();lpe(Tx,"factory",cpe);jx.exports=Tx});var Mx=s(function(VQe,mpe){mpe.exports={name:"mt19937",copy:!0}});var Ax=s(function(FQe,xx){"use strict";var hpe=$(),ppe=ee(),ype=T(),kv={};kv.minstd=hpe;kv["minstd-shuffle"]=ppe;kv.mt19937=ype;xx.exports=kv});var Qc=s(function(WQe,Vx){"use strict";var cu=require("@stdlib/utils/define-nonenumerable-read-only-property"),zv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),qpe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),bpe=require("@stdlib/assert/is-plain-object"),wpe=require("@stdlib/assert/is-boolean").isPrimitive,Jv=require("@stdlib/assert/has-own-property"),Spe=require("@stdlib/array/to-json"),mu=require("@stdlib/string/format"),Gx=Mx(),Ope=Ax();function Epe(r){var e,t,i;if(e={name:Gx.name,copy:Gx.copy},arguments.length){if(!bpe(r))throw new TypeError(mu("invalid argument. Must provide an object. Value: `%s`.",r));if(Jv(r,"name")&&(e.name=r.name),Jv(r,"state")){if(e.state=r.state,e.state===void 0)throw new TypeError(mu("invalid option. `%s` option cannot be undefined. Option: `%s`.","state",e.state))}else if(Jv(r,"seed")&&(e.seed=r.seed,e.seed===void 0))throw new TypeError(mu("invalid option. `%s` option cannot be undefined. Option: `%s`.","seed",e.seed));if(Jv(r,"copy")&&(e.copy=r.copy,!wpe(e.copy)))throw new TypeError(mu("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",e.copy))}if(i=Ope[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"),zv(l,"seed",n),zv(l,"seedLength",a),qpe(l,"state",v,g),zv(l,"stateLength",u),zv(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=Spe(t.state),m.params=[],m}function l(){return t()}}Vx.exports=Epe});var Wx=s(function(IQe,Fx){"use strict";var _pe=Qc(),Npe=_pe();Fx.exports=Npe});var hu=s(function(kQe,kx){"use strict";var Lpe=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ix=Wx(),Rpe=Qc();Lpe(Ix,"factory",Rpe);kx.exports=Ix});var zx=s(function(zQe,Ppe){Ppe.exports={name:"improved-ziggurat",copy:!0}});var Ux=s(function(JQe,Jx){"use strict";var Tpe=Xa(),jpe=Q(),$c={};$c["box-muller"]=Tpe;$c["improved-ziggurat"]=jpe;Jx.exports=$c});var Kc=s(function(UQe,Xx){"use strict";var Mt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Uv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Cx=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Mpe=require("@stdlib/assert/is-plain-object"),xpe=require("@stdlib/assert/is-boolean").isPrimitive,pu=require("@stdlib/assert/has-own-property"),Bx=require("@stdlib/utils/constant-function"),Ya=require("@stdlib/string/format"),Ape=require("@stdlib/utils/noop"),Gpe=require("@stdlib/array/to-json"),Dx=zx(),Vpe=Ux();function Fpe(r){var e,t,i;if(e={name:Dx.name,copy:Dx.copy},arguments.length){if(!Mpe(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,!xpe(e.copy)))throw new TypeError(Ya("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",e.copy))}if(i=Vpe[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),Cx(l,"state",Bx(null),Ape),Mt(l,"stateLength",null),Mt(l,"byteLength",null),Mt(l,"toJSON",Bx(null))):(Uv(l,"seed",n),Uv(l,"seedLength",a),Cx(l,"state",v,g),Uv(l,"stateLength",u),Uv(l,"byteLength",o),Mt(l,"toJSON",c)),Mt(l,"PRNG",t.PRNG),l;function n(){return t.seed}function a(){return t.seedLength}function u(){return t.stateLength}function o(){return t.byteLength}function v(){return t.state}function g(m){t.state=m}function c(){var m={};return m.type="PRNG",m.name=l.NAME+"-"+t.NAME,m.state=Gpe(t.state),m.params=[],m}function l(){return t()}}Xx.exports=Fpe});var Hx=s(function(CQe,Yx){"use strict";var Wpe=Kc(),Ipe=Wpe();Yx.exports=Ipe});var yu=s(function(BQe,Qx){"use strict";var kpe=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zx=Hx(),zpe=Kc();kpe(Zx,"factory",zpe);Qx.exports=Zx});var Kx=s(function(DQe,$x){"use strict";var Jpe=nn(),Upe=an(),Cpe=un(),Bpe=on(),Dpe=la(),Xpe=Xa(),Ype=ma(),Hpe=vn(),Zpe=Xe(),Qpe=gn(),$pe=fn(),Kpe=ba(),eye=dn(),rye=Sa(),tye=Ea(),iye=Ce(),nye=_a(),aye=Na(),sye=La(),uye=Q(),oye=ln(),vye=Pa(),gye=Ta(),fye=ja(),dye=Ma(),lye=cn(),cye=$(),mye=ee(),hye=T(),pye=Ia(),yye=hn(),qye=za(),bye=mn(),wye=hu(),Sye=yu(),Oye=Tt(),Eye=Ja(),_ye=Ba(),Nye=Da(),Lye=pn(),Rye=yn(),E={};E.arcsine=Jpe.factory;E.bernoulli=Upe.factory;E.beta=Cpe.factory;E.betaprime=Bpe.factory;E.binomial=Dpe.factory;E["box-muller"]=Xpe.factory;E.cauchy=Ype.factory;E.chi=Hpe.factory;E.chisquare=Zpe.factory;E.cosine=Qpe.factory;E["discrete-uniform"]=$pe.factory;E.erlang=Kpe.factory;E.exponential=eye.factory;E.f=rye.factory;E.frechet=tye.factory;E.gamma=iye.factory;E.geometric=nye.factory;E.gumbel=aye.factory;E.hypergeometric=sye.factory;E["improved-ziggurat"]=uye.factory;E.invgamma=oye.factory;E.kumaraswamy=vye.factory;E.laplace=gye.factory;E.levy=fye.factory;E.logistic=dye.factory;E.lognormal=lye.factory;E.minstd=cye.factory;E["minstd-shuffle"]=mye.factory;E.mt19937=hye.factory;E["negative-binomial"]=pye.factory;E.normal=yye.factory;E["pareto-type1"]=qye.factory;E.poisson=bye.factory;E.randi=wye.factory;E.randn=Sye.factory;E.randu=Oye.factory;E.rayleigh=Eye.factory;E.t=_ye.factory;E.triangular=Nye.factory;E.uniform=Lye.factory;E.weibull=Rye.factory;$x.exports=E});var n1=s(function(XQe,i1){"use strict";var e1=require("@stdlib/assert/is-string").isPrimitive,Pye=require("@stdlib/assert/is-plain-object"),r1=require("@stdlib/assert/is-array"),Tye=require("@stdlib/assert/contains"),jye=require("@stdlib/array/int32"),Mye=require("@stdlib/array/uint32"),t1=Kx(),xye={Int32Array:jye,Uint32Array:Mye},Aye=["randi","randn","randu"];function Gye(r,e){var t,i,n,a,u;if(e&&e.type==="PRNG"&&e1(e.name)&&Pye(e.state)&&r1(e.params)&&e1(e.state.type)&&r1(e.state.data)&&(i={},t=t1[e.name],t===void 0&&(u=e.name.split("-"),Tye(Aye,u[0])&&(t=t1[u[0]],i.name=u.slice(1).join("-"))),t&&(a=xye[e.state.type],a))){i.state=new a(e.state.data),n=e.params.slice(),n.push(i);try{return t.apply(null,n)}catch(o){}}return e}i1.exports=Gye});var s1=s(function(YQe,a1){"use strict";var Vye=n1();a1.exports=Vye});var o1=s(function(HQe,u1){"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",la());_(O,"boxMuller",Xa());_(O,"cauchy",ma());_(O,"chi",vn());_(O,"chisquare",Xe());_(O,"cosine",gn());_(O,"discreteUniform",fn());_(O,"erlang",ba());_(O,"exponential",dn());_(O,"f",Sa());_(O,"frechet",Ea());_(O,"gamma",Ce());_(O,"geometric",_a());_(O,"gumbel",Na());_(O,"hypergeometric",La());_(O,"improvedZiggurat",Q());_(O,"invgamma",ln());_(O,"kumaraswamy",Pa());_(O,"laplace",Ta());_(O,"levy",ja());_(O,"logistic",Ma());_(O,"lognormal",cn());_(O,"minstd",$());_(O,"minstdShuffle",ee());_(O,"mt19937",T());_(O,"negativeBinomial",Ia());_(O,"normal",hn());_(O,"pareto1",za());_(O,"poisson",mn());_(O,"randi",hu());_(O,"randn",yu());_(O,"randu",Tt());_(O,"rayleigh",Ja());_(O,"reviveBasePRNG",s1());_(O,"t",Ba());_(O,"triangular",Da());_(O,"uniform",pn());_(O,"weibull",yn());u1.exports=O});var p1=s(function(ZQe,h1){"use strict";var xt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Cv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),v1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Fye=require("@stdlib/utils/constant-function"),Wye=require("@stdlib/utils/noop"),Iye=require("@stdlib/object/assign"),g1=require("@stdlib/assert/is-number").isPrimitive,f1=require("@stdlib/math/base/assert/is-nan"),kye=require("@stdlib/assert/is-plain-object"),zye=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Jye=require("@stdlib/assert/has-own-property"),d1=require("@stdlib/constants/float64/max"),l1=nn().factory,c1=require("@stdlib/symbol/iterator"),qu=require("@stdlib/string/format");function m1(r,e,t){var i,n,a,u,o;if(!g1(r)||f1(r))throw new TypeError(qu("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!g1(e)||f1(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(!kye(t))throw new TypeError(qu("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Iye({},t),Jye(i,"iter")){if(!zye(i.iter))throw new TypeError(qu("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=d1;a=l1(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=l1(r,e),i={iter:d1,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),v1(n,"state",Fye(null),Wye),xt(n,"stateLength",null),xt(n,"byteLength",null)):(Cv(n,"seed",l),Cv(n,"seedLength",m),v1(n,"state",d,f),Cv(n,"stateLength",h),Cv(n,"byteLength",p)),xt(n,"PRNG",a.PRNG),c1&&xt(n,c1,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return 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}}h1.exports=m1});var q1=s(function(QQe,y1){"use strict";var Uye=p1();y1.exports=Uye});var N1=s(function($Qe,_1){"use strict";var At=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),b1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Cye=require("@stdlib/utils/constant-function"),Bye=require("@stdlib/utils/noop"),Dye=require("@stdlib/object/assign"),Xye=require("@stdlib/assert/is-probability").isPrimitive,Yye=require("@stdlib/assert/is-plain-object"),Hye=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Zye=require("@stdlib/assert/has-own-property"),w1=require("@stdlib/constants/float64/max"),S1=an().factory,O1=require("@stdlib/symbol/iterator"),em=require("@stdlib/string/format");function E1(r,e){var t,i,n,a,u;if(!Xye(r))throw new TypeError(em("invalid argument. First argument must be a probability. Value: `%s`.",r));if(arguments.length>1){if(!Yye(e))throw new TypeError(em("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=Dye({},e),Zye(t,"iter")){if(!Hye(t.iter))throw new TypeError(em("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=w1;n=S1(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=S1(r),t={iter:w1,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),b1(i,"state",Cye(null),Bye),At(i,"stateLength",null),At(i,"byteLength",null)):(Bv(i,"seed",c),Bv(i,"seedLength",l),b1(i,"state",p,d),Bv(i,"stateLength",m),Bv(i,"byteLength",h)),At(i,"PRNG",n.PRNG),O1&&At(i,O1,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 E1(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}}_1.exports=E1});var R1=s(function(KQe,L1){"use strict";var Qye=N1();L1.exports=Qye});var V1=s(function(e$e,G1){"use strict";var Gt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Dv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),P1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),$ye=require("@stdlib/utils/constant-function"),Kye=require("@stdlib/utils/noop"),eqe=require("@stdlib/object/assign"),T1=require("@stdlib/assert/is-positive-number").isPrimitive,rqe=require("@stdlib/assert/is-plain-object"),tqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,iqe=require("@stdlib/assert/has-own-property"),j1=require("@stdlib/constants/float64/max"),M1=un().factory,x1=require("@stdlib/symbol/iterator"),Xv=require("@stdlib/string/format");function A1(r,e,t){var i,n,a,u,o;if(!T1(r))throw new TypeError(Xv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!T1(e))throw new TypeError(Xv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!rqe(t))throw new TypeError(Xv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=eqe({},t),iqe(i,"iter")){if(!tqe(i.iter))throw new TypeError(Xv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=j1;a=M1(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=M1(r,e),i={iter:j1,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),P1(n,"state",$ye(null),Kye),Gt(n,"stateLength",null),Gt(n,"byteLength",null)):(Dv(n,"seed",l),Dv(n,"seedLength",m),P1(n,"state",d,f),Dv(n,"stateLength",h),Dv(n,"byteLength",p)),Gt(n,"PRNG",a.PRNG),x1&&Gt(n,x1,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 A1(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}}G1.exports=A1});var W1=s(function(r$e,F1){"use strict";var nqe=V1();F1.exports=nqe});var D1=s(function(t$e,B1){"use strict";var Vt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Yv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),I1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),aqe=require("@stdlib/utils/constant-function"),sqe=require("@stdlib/utils/noop"),uqe=require("@stdlib/object/assign"),k1=require("@stdlib/assert/is-positive-number").isPrimitive,oqe=require("@stdlib/assert/is-plain-object"),vqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,gqe=require("@stdlib/assert/has-own-property"),z1=require("@stdlib/constants/float64/max"),J1=on().factory,U1=require("@stdlib/symbol/iterator"),Hv=require("@stdlib/string/format");function C1(r,e,t){var i,n,a,u,o;if(!k1(r))throw new TypeError(Hv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!k1(e))throw new TypeError(Hv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!oqe(t))throw new TypeError(Hv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=uqe({},t),gqe(i,"iter")){if(!vqe(i.iter))throw new TypeError(Hv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=z1;a=J1(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=J1(r,e),i={iter:z1,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),I1(n,"state",aqe(null),sqe),Vt(n,"stateLength",null),Vt(n,"byteLength",null)):(Yv(n,"seed",l),Yv(n,"seedLength",m),I1(n,"state",d,f),Yv(n,"stateLength",h),Yv(n,"byteLength",p)),Vt(n,"PRNG",a.PRNG),U1&&Vt(n,U1,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 C1(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}}B1.exports=C1});var Y1=s(function(i$e,X1){"use strict";var fqe=D1();X1.exports=fqe});var rA=s(function(n$e,eA){"use strict";var Ft=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),H1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),dqe=require("@stdlib/utils/constant-function"),lqe=require("@stdlib/utils/noop"),cqe=require("@stdlib/object/assign"),mqe=require("@stdlib/assert/is-probability").isPrimitive,hqe=require("@stdlib/assert/is-plain-object"),pqe=require("@stdlib/assert/is-positive-integer").isPrimitive,yqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,qqe=require("@stdlib/assert/has-own-property"),Z1=require("@stdlib/constants/float64/max"),Q1=la().factory,$1=require("@stdlib/symbol/iterator"),Qv=require("@stdlib/string/format");function K1(r,e,t){var i,n,a,u,o;if(!pqe(r))throw new TypeError(Qv("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!mqe(e))throw new TypeError(Qv("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(arguments.length>2){if(!hqe(t))throw new TypeError(Qv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=cqe({},t),qqe(i,"iter")){if(!yqe(i.iter))throw new TypeError(Qv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=Z1;a=Q1(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=Q1(r,e),i={iter:Z1,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),H1(n,"state",dqe(null),lqe),Ft(n,"stateLength",null),Ft(n,"byteLength",null)):(Zv(n,"seed",l),Zv(n,"seedLength",m),H1(n,"state",d,f),Zv(n,"stateLength",h),Zv(n,"byteLength",p)),Ft(n,"PRNG",a.PRNG),$1&&Ft(n,$1,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}}eA.exports=K1});var iA=s(function(a$e,tA){"use strict";var bqe=rA();tA.exports=bqe});var fA=s(function(s$e,gA){"use strict";var Wt=require("@stdlib/utils/define-nonenumerable-read-only-property"),$v=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),nA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),wqe=require("@stdlib/utils/constant-function"),Sqe=require("@stdlib/utils/noop"),Oqe=require("@stdlib/object/assign"),Eqe=require("@stdlib/assert/is-plain-object"),_qe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Nqe=require("@stdlib/assert/has-own-property"),aA=require("@stdlib/constants/float64/max"),sA=Xa().factory,uA=require("@stdlib/symbol/iterator"),oA=require("@stdlib/string/format");function vA(r){var e,t,i,n,a;if(arguments.length>0){if(!Eqe(r))throw new TypeError(oA("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=Oqe({},r),Nqe(e,"iter")){if(!_qe(e.iter))throw new TypeError(oA("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=aA;i=sA(e),e.prng===void 0&&e.copy!==!1&&(e.state=i.state)}else i=sA(),e={iter:aA,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),nA(t,"state",wqe(null),Sqe),Wt(t,"stateLength",null),Wt(t,"byteLength",null)):($v(t,"seed",g),$v(t,"seedLength",c),nA(t,"state",h,p),$v(t,"stateLength",l),$v(t,"byteLength",m)),Wt(t,"PRNG",i.PRNG),uA&&Wt(t,uA,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 vA(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}}gA.exports=vA});var lA=s(function(u$e,dA){"use strict";var Lqe=fA();dA.exports=Lqe});var bA=s(function(o$e,qA){"use strict";var It=require("@stdlib/utils/define-nonenumerable-read-only-property"),Kv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),cA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Rqe=require("@stdlib/utils/constant-function"),Pqe=require("@stdlib/utils/noop"),Tqe=require("@stdlib/object/assign"),jqe=require("@stdlib/assert/is-number").isPrimitive,Mqe=require("@stdlib/math/base/assert/is-nan"),xqe=require("@stdlib/assert/is-plain-object"),Aqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Gqe=require("@stdlib/assert/is-positive-number").isPrimitive,Vqe=require("@stdlib/assert/has-own-property"),mA=require("@stdlib/constants/float64/max"),hA=ma().factory,pA=require("@stdlib/symbol/iterator"),eg=require("@stdlib/string/format");function yA(r,e,t){var i,n,a,u,o;if(!jqe(r)||Mqe(r))throw new TypeError(eg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Gqe(e))throw new TypeError(eg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!xqe(t))throw new TypeError(eg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Tqe({},t),Vqe(i,"iter")){if(!Aqe(i.iter))throw new TypeError(eg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=mA;a=hA(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=hA(r,e),i={iter:mA,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),cA(n,"state",Rqe(null),Pqe),It(n,"stateLength",null),It(n,"byteLength",null)):(Kv(n,"seed",l),Kv(n,"seedLength",m),cA(n,"state",d,f),Kv(n,"stateLength",h),Kv(n,"byteLength",p)),It(n,"PRNG",a.PRNG),pA&&It(n,pA,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 yA(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}}qA.exports=yA});var SA=s(function(v$e,wA){"use strict";var Fqe=bA();wA.exports=Fqe});var PA=s(function(g$e,RA){"use strict";var kt=require("@stdlib/utils/define-nonenumerable-read-only-property"),rg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),OA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Wqe=require("@stdlib/utils/constant-function"),Iqe=require("@stdlib/utils/noop"),kqe=require("@stdlib/object/assign"),zqe=require("@stdlib/assert/is-positive-number").isPrimitive,Jqe=require("@stdlib/assert/is-plain-object"),Uqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Cqe=require("@stdlib/assert/has-own-property"),EA=require("@stdlib/constants/float64/max"),_A=vn().factory,NA=require("@stdlib/symbol/iterator"),rm=require("@stdlib/string/format");function LA(r,e){var t,i,n,a,u;if(!zqe(r))throw new TypeError(rm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!Jqe(e))throw new TypeError(rm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=kqe({},e),Cqe(t,"iter")){if(!Uqe(t.iter))throw new TypeError(rm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=EA;n=_A(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=_A(r),t={iter:EA,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),OA(i,"state",Wqe(null),Iqe),kt(i,"stateLength",null),kt(i,"byteLength",null)):(rg(i,"seed",c),rg(i,"seedLength",l),OA(i,"state",p,d),rg(i,"stateLength",m),rg(i,"byteLength",h)),kt(i,"PRNG",n.PRNG),NA&&kt(i,NA,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 LA(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}}RA.exports=LA});var jA=s(function(f$e,TA){"use strict";var Bqe=PA();TA.exports=Bqe});var WA=s(function(d$e,FA){"use strict";var zt=require("@stdlib/utils/define-nonenumerable-read-only-property"),tg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),MA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Dqe=require("@stdlib/utils/constant-function"),Xqe=require("@stdlib/utils/noop"),Yqe=require("@stdlib/object/assign"),Hqe=require("@stdlib/assert/is-positive-number").isPrimitive,Zqe=require("@stdlib/assert/is-plain-object"),Qqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,$qe=require("@stdlib/assert/has-own-property"),xA=require("@stdlib/constants/float64/max"),AA=Xe().factory,GA=require("@stdlib/symbol/iterator"),tm=require("@stdlib/string/format");function VA(r,e){var t,i,n,a,u;if(!Hqe(r))throw new TypeError(tm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!Zqe(e))throw new TypeError(tm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=Yqe({},e),$qe(t,"iter")){if(!Qqe(t.iter))throw new TypeError(tm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=xA;n=AA(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=AA(r),t={iter:xA,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),MA(i,"state",Dqe(null),Xqe),zt(i,"stateLength",null),zt(i,"byteLength",null)):(tg(i,"seed",c),tg(i,"seedLength",l),MA(i,"state",p,d),tg(i,"stateLength",m),tg(i,"byteLength",h)),zt(i,"PRNG",n.PRNG),GA&&zt(i,GA,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 VA(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}}FA.exports=VA});var kA=s(function(l$e,IA){"use strict";var Kqe=WA();IA.exports=Kqe});var XA=s(function(c$e,DA){"use strict";var Jt=require("@stdlib/utils/define-nonenumerable-read-only-property"),ig=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),zA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ebe=require("@stdlib/utils/constant-function"),rbe=require("@stdlib/utils/noop"),tbe=require("@stdlib/object/assign"),ibe=require("@stdlib/assert/is-number").isPrimitive,nbe=require("@stdlib/math/base/assert/is-nan"),abe=require("@stdlib/assert/is-plain-object"),sbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ube=require("@stdlib/assert/is-positive-number").isPrimitive,obe=require("@stdlib/assert/has-own-property"),JA=require("@stdlib/constants/float64/max"),UA=gn().factory,CA=require("@stdlib/symbol/iterator"),ng=require("@stdlib/string/format");function BA(r,e,t){var i,n,a,u,o;if(!ibe(r)||nbe(r))throw new TypeError(ng("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!ube(e))throw new TypeError(ng("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!abe(t))throw new TypeError(ng("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=tbe({},t),obe(i,"iter")){if(!sbe(i.iter))throw new TypeError(ng("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=JA;a=UA(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=UA(r,e),i={iter:JA,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),zA(n,"state",ebe(null),rbe),Jt(n,"stateLength",null),Jt(n,"byteLength",null)):(ig(n,"seed",l),ig(n,"seedLength",m),zA(n,"state",d,f),ig(n,"stateLength",h),ig(n,"byteLength",p)),Jt(n,"PRNG",a.PRNG),CA&&Jt(n,CA,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return BA(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}DA.exports=BA});var HA=s(function(m$e,YA){"use strict";var vbe=XA();YA.exports=vbe});var iG=s(function(h$e,tG){"use strict";var Ut=require("@stdlib/utils/define-nonenumerable-read-only-property"),ag=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),ZA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),gbe=require("@stdlib/utils/constant-function"),fbe=require("@stdlib/utils/noop"),dbe=require("@stdlib/object/assign"),QA=require("@stdlib/assert/is-number").isPrimitive,lbe=require("@stdlib/assert/is-plain-object"),cbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,mbe=require("@stdlib/assert/has-own-property"),$A=require("@stdlib/constants/float64/max"),KA=fn().factory,eG=require("@stdlib/symbol/iterator"),bu=require("@stdlib/string/format");function rG(r,e,t){var i,n,a,u,o;if(!QA(r))throw new TypeError(bu("invalid argument. First argument must be an integer. Value: `%s`.",r));if(!QA(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(!lbe(t))throw new TypeError(bu("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=dbe({},t),mbe(i,"iter")){if(!cbe(i.iter))throw new TypeError(bu("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=$A;a=KA(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=KA(r,e),i={iter:$A,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),ZA(n,"state",gbe(null),fbe),Ut(n,"stateLength",null),Ut(n,"byteLength",null)):(ag(n,"seed",l),ag(n,"seedLength",m),ZA(n,"state",d,f),ag(n,"stateLength",h),ag(n,"byteLength",p)),Ut(n,"PRNG",a.PRNG),eG&&Ut(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 rG(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}}tG.exports=rG});var aG=s(function(p$e,nG){"use strict";var hbe=iG();nG.exports=hbe});var dG=s(function(y$e,fG){"use strict";var Ct=require("@stdlib/utils/define-nonenumerable-read-only-property"),sg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),sG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),pbe=require("@stdlib/utils/constant-function"),ybe=require("@stdlib/utils/noop"),qbe=require("@stdlib/object/assign"),bbe=require("@stdlib/assert/is-positive-number").isPrimitive,wbe=require("@stdlib/assert/is-plain-object"),Sbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Obe=require("@stdlib/assert/is-positive-integer").isPrimitive,Ebe=require("@stdlib/assert/has-own-property"),uG=require("@stdlib/constants/float64/max"),oG=ba().factory,vG=require("@stdlib/symbol/iterator"),ug=require("@stdlib/string/format");function gG(r,e,t){var i,n,a,u,o;if(!Obe(r))throw new TypeError(ug("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!bbe(e))throw new TypeError(ug("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!wbe(t))throw new TypeError(ug("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=qbe({},t),Ebe(i,"iter")){if(!Sbe(i.iter))throw new TypeError(ug("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=uG;a=oG(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=oG(r,e),i={iter:uG,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),sG(n,"state",pbe(null),ybe),Ct(n,"stateLength",null),Ct(n,"byteLength",null)):(sg(n,"seed",l),sg(n,"seedLength",m),sG(n,"state",d,f),sg(n,"stateLength",h),sg(n,"byteLength",p)),Ct(n,"PRNG",a.PRNG),vG&&Ct(n,vG,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 gG(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}}fG.exports=gG});var cG=s(function(q$e,lG){"use strict";var _be=dG();lG.exports=_be});var wG=s(function(b$e,bG){"use strict";var Bt=require("@stdlib/utils/define-nonenumerable-read-only-property"),og=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),mG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Nbe=require("@stdlib/utils/constant-function"),Lbe=require("@stdlib/utils/noop"),Rbe=require("@stdlib/object/assign"),Pbe=require("@stdlib/assert/is-positive-number").isPrimitive,Tbe=require("@stdlib/assert/is-plain-object"),jbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Mbe=require("@stdlib/assert/has-own-property"),hG=require("@stdlib/constants/float64/max"),pG=dn().factory,yG=require("@stdlib/symbol/iterator"),im=require("@stdlib/string/format");function qG(r,e){var t,i,n,a,u;if(!Pbe(r))throw new TypeError(im("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!Tbe(e))throw new TypeError(im("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=Rbe({},e),Mbe(t,"iter")){if(!jbe(t.iter))throw new TypeError(im("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=hG;n=pG(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=pG(r),t={iter:hG,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),mG(i,"state",Nbe(null),Lbe),Bt(i,"stateLength",null),Bt(i,"byteLength",null)):(og(i,"seed",c),og(i,"seedLength",l),mG(i,"state",p,d),og(i,"stateLength",m),og(i,"byteLength",h)),Bt(i,"PRNG",n.PRNG),yG&&Bt(i,yG,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 qG(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}}bG.exports=qG});var OG=s(function(w$e,SG){"use strict";var xbe=wG();SG.exports=xbe});var jG=s(function(S$e,TG){"use strict";var Dt=require("@stdlib/utils/define-nonenumerable-read-only-property"),vg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),EG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Abe=require("@stdlib/utils/constant-function"),Gbe=require("@stdlib/utils/noop"),Vbe=require("@stdlib/object/assign"),_G=require("@stdlib/assert/is-positive-number").isPrimitive,Fbe=require("@stdlib/assert/is-plain-object"),Wbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ibe=require("@stdlib/assert/has-own-property"),NG=require("@stdlib/constants/float64/max"),LG=Sa().factory,RG=require("@stdlib/symbol/iterator"),gg=require("@stdlib/string/format");function PG(r,e,t){var i,n,a,u,o;if(!_G(r))throw new TypeError(gg("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!_G(e))throw new TypeError(gg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Fbe(t))throw new TypeError(gg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Vbe({},t),Ibe(i,"iter")){if(!Wbe(i.iter))throw new TypeError(gg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=NG;a=LG(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=LG(r,e),i={iter:NG,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),EG(n,"state",Abe(null),Gbe),Dt(n,"stateLength",null),Dt(n,"byteLength",null)):(vg(n,"seed",l),vg(n,"seedLength",m),EG(n,"state",d,f),vg(n,"stateLength",h),vg(n,"byteLength",p)),Dt(n,"PRNG",a.PRNG),RG&&Dt(n,RG,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return PG(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}}TG.exports=PG});var xG=s(function(O$e,MG){"use strict";var kbe=jG();MG.exports=kbe});var zG=s(function(E$e,kG){"use strict";var Xt=require("@stdlib/utils/define-nonenumerable-read-only-property"),fg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),AG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),zbe=require("@stdlib/utils/constant-function"),Jbe=require("@stdlib/utils/noop"),Ube=require("@stdlib/object/assign"),GG=require("@stdlib/assert/is-positive-number").isPrimitive,Cbe=require("@stdlib/assert/is-plain-object"),Bbe=require("@stdlib/assert/is-number").isPrimitive,Dbe=require("@stdlib/math/base/assert/is-nan"),Xbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ybe=require("@stdlib/assert/has-own-property"),VG=require("@stdlib/constants/float64/max"),FG=Ea().factory,WG=require("@stdlib/symbol/iterator"),wu=require("@stdlib/string/format");function IG(r,e,t,i){var n,a,u,o,v;if(!GG(r))throw new TypeError(wu("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!GG(e))throw new TypeError(wu("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(!Bbe(t)||Dbe(t))throw new TypeError(wu("invalid argument. Third argument must be a number. Value: `%s`.",t));if(arguments.length>3){if(!Cbe(i))throw new TypeError(wu("invalid argument. Options argument must be an object. Value: `%s`.",i));if(n=Ube({},i),Ybe(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=VG;u=FG(r,e,t,n),n.prng===void 0&&n.copy!==!1&&(n.state=u.state)}else u=FG(r,e,t),n={iter:VG,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),AG(a,"state",zbe(null),Jbe),Xt(a,"stateLength",null),Xt(a,"byteLength",null)):(fg(a,"seed",m),fg(a,"seedLength",h),AG(a,"state",f,y),fg(a,"stateLength",p),fg(a,"byteLength",d)),Xt(a,"PRNG",u.PRNG),WG&&Xt(a,WG,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 IG(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}}kG.exports=IG});var UG=s(function(_$e,JG){"use strict";var Hbe=zG();JG.exports=Hbe});var QG=s(function(N$e,ZG){"use strict";var Yt=require("@stdlib/utils/define-nonenumerable-read-only-property"),dg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),CG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Zbe=require("@stdlib/utils/constant-function"),Qbe=require("@stdlib/utils/noop"),$be=require("@stdlib/object/assign"),BG=require("@stdlib/assert/is-positive-number").isPrimitive,Kbe=require("@stdlib/assert/is-plain-object"),ewe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,rwe=require("@stdlib/assert/has-own-property"),DG=require("@stdlib/constants/float64/max"),XG=Ce().factory,YG=require("@stdlib/symbol/iterator"),lg=require("@stdlib/string/format");function HG(r,e,t){var i,n,a,u,o;if(!BG(r))throw new TypeError(lg("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!BG(e))throw new TypeError(lg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Kbe(t))throw new TypeError(lg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=$be({},t),rwe(i,"iter")){if(!ewe(i.iter))throw new TypeError(lg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=DG;a=XG(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=XG(r,e),i={iter:DG,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),CG(n,"state",Zbe(null),Qbe),Yt(n,"stateLength",null),Yt(n,"byteLength",null)):(dg(n,"seed",l),dg(n,"seedLength",m),CG(n,"state",d,f),dg(n,"stateLength",h),dg(n,"byteLength",p)),Yt(n,"PRNG",a.PRNG),YG&&Yt(n,YG,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 HG(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}}ZG.exports=HG});var KG=s(function(L$e,$G){"use strict";var twe=QG();$G.exports=twe});var sV=s(function(R$e,aV){"use strict";var Ht=require("@stdlib/utils/define-nonenumerable-read-only-property"),cg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),eV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),iwe=require("@stdlib/utils/constant-function"),nwe=require("@stdlib/utils/noop"),awe=require("@stdlib/object/assign"),swe=require("@stdlib/assert/is-probability").isPrimitive,uwe=require("@stdlib/assert/is-plain-object"),owe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,vwe=require("@stdlib/assert/has-own-property"),rV=require("@stdlib/constants/float64/max"),tV=_a().factory,iV=require("@stdlib/symbol/iterator"),nm=require("@stdlib/string/format");function nV(r,e){var t,i,n,a,u;if(!swe(r))throw new TypeError(nm("invalid argument. First argument must be a probability. Value: `%s`.",r));if(arguments.length>1){if(!uwe(e))throw new TypeError(nm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=awe({},e),vwe(t,"iter")){if(!owe(t.iter))throw new TypeError(nm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=rV;n=tV(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=tV(r),t={iter:rV,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),eV(i,"state",iwe(null),nwe),Ht(i,"stateLength",null),Ht(i,"byteLength",null)):(cg(i,"seed",c),cg(i,"seedLength",l),eV(i,"state",p,d),cg(i,"stateLength",m),cg(i,"byteLength",h)),Ht(i,"PRNG",n.PRNG),iV&&Ht(i,iV,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 nV(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}}aV.exports=nV});var oV=s(function(P$e,uV){"use strict";var gwe=sV();uV.exports=gwe});var mV=s(function(T$e,cV){"use strict";var Zt=require("@stdlib/utils/define-nonenumerable-read-only-property"),mg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),vV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),fwe=require("@stdlib/utils/constant-function"),dwe=require("@stdlib/utils/noop"),lwe=require("@stdlib/object/assign"),cwe=require("@stdlib/assert/is-number").isPrimitive,mwe=require("@stdlib/math/base/assert/is-nan"),hwe=require("@stdlib/assert/is-plain-object"),pwe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ywe=require("@stdlib/assert/is-positive-number").isPrimitive,qwe=require("@stdlib/assert/has-own-property"),gV=require("@stdlib/constants/float64/max"),fV=Na().factory,dV=require("@stdlib/symbol/iterator"),hg=require("@stdlib/string/format");function lV(r,e,t){var i,n,a,u,o;if(!cwe(r)||mwe(r))throw new TypeError(hg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!ywe(e))throw new TypeError(hg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!hwe(t))throw new TypeError(hg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=lwe({},t),qwe(i,"iter")){if(!pwe(i.iter))throw new TypeError(hg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=gV;a=fV(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=fV(r,e),i={iter:gV,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),vV(n,"state",fwe(null),dwe),Zt(n,"stateLength",null),Zt(n,"byteLength",null)):(mg(n,"seed",l),mg(n,"seedLength",m),vV(n,"state",d,f),mg(n,"stateLength",h),mg(n,"byteLength",p)),Zt(n,"PRNG",a.PRNG),dV&&Zt(n,dV,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 lV(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}cV.exports=lV});var pV=s(function(j$e,hV){"use strict";var bwe=mV();hV.exports=bwe});var EV=s(function(M$e,OV){"use strict";var Qt=require("@stdlib/utils/define-nonenumerable-read-only-property"),pg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),yV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),wwe=require("@stdlib/utils/constant-function"),Swe=require("@stdlib/utils/noop"),Owe=require("@stdlib/object/assign"),Ewe=require("@stdlib/assert/is-plain-object"),yg=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,_we=require("@stdlib/assert/has-own-property"),qV=require("@stdlib/constants/float64/max"),bV=La().factory,wV=require("@stdlib/symbol/iterator"),qn=require("@stdlib/string/format");function SV(r,e,t,i){var n,a,u,o,v;if(!yg(r))throw new TypeError(qn("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r));if(!yg(e))throw new TypeError(qn("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",e));if(!yg(t))throw new TypeError(qn("invalid argument. Third argument must be a nonnegative integer. Value: `%s`.",t));if(t>r)throw new RangeError(qn("invalid argument. Number of draws must be less than or equal to the population size. Value: `%u`.",t));if(e>r)throw new RangeError(qn("invalid argument. Subpopulation size must be less than or equal to the population size. Value: `%u`.",e));if(arguments.length>3){if(!Ewe(i))throw new TypeError(qn("invalid argument. Options argument must be an object. Value: `%s`.",i));if(n=Owe({},i),_we(n,"iter")){if(!yg(n.iter))throw new TypeError(qn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",n.iter))}else n.iter=qV;u=bV(r,e,t,n),n.prng===void 0&&n.copy!==!1&&(n.state=u.state)}else u=bV(r,e,t),n={iter:qV,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),yV(a,"state",wwe(null),Swe),Qt(a,"stateLength",null),Qt(a,"byteLength",null)):(pg(a,"seed",m),pg(a,"seedLength",h),yV(a,"state",f,y),pg(a,"stateLength",p),pg(a,"byteLength",d)),Qt(a,"PRNG",u.PRNG),wV&&Qt(a,wV,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 SV(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}}OV.exports=SV});var NV=s(function(x$e,_V){"use strict";var Nwe=EV();_V.exports=Nwe});var AV=s(function(A$e,xV){"use strict";var $t=require("@stdlib/utils/define-nonenumerable-read-only-property"),qg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),LV=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-plain-object"),jwe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Mwe=require("@stdlib/assert/has-own-property"),RV=require("@stdlib/constants/float64/max"),PV=Q().factory,TV=require("@stdlib/symbol/iterator"),jV=require("@stdlib/string/format");function MV(r){var e,t,i,n,a;if(arguments.length>0){if(!Twe(r))throw new TypeError(jV("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=Pwe({},r),Mwe(e,"iter")){if(!jwe(e.iter))throw new TypeError(jV("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=RV;i=PV(e),e.prng===void 0&&e.copy!==!1&&(e.state=i.state)}else i=PV(),e={iter:RV,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),LV(t,"state",Lwe(null),Rwe),$t(t,"stateLength",null),$t(t,"byteLength",null)):(qg(t,"seed",g),qg(t,"seedLength",c),LV(t,"state",h,p),qg(t,"stateLength",l),qg(t,"byteLength",m)),$t(t,"PRNG",i.PRNG),TV&&$t(t,TV,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 MV(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}}xV.exports=MV});var VV=s(function(G$e,GV){"use strict";var xwe=AV();GV.exports=xwe});var CV=s(function(V$e,UV){"use strict";var Kt=require("@stdlib/utils/define-nonenumerable-read-only-property"),bg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),FV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Awe=require("@stdlib/utils/constant-function"),Gwe=require("@stdlib/utils/noop"),Vwe=require("@stdlib/object/assign"),WV=require("@stdlib/assert/is-positive-number").isPrimitive,Fwe=require("@stdlib/assert/is-plain-object"),Wwe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Iwe=require("@stdlib/assert/has-own-property"),IV=require("@stdlib/constants/float64/max"),kV=ln().factory,zV=require("@stdlib/symbol/iterator"),wg=require("@stdlib/string/format");function JV(r,e,t){var i,n,a,u,o;if(!WV(r))throw new TypeError(wg("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!WV(e))throw new TypeError(wg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Fwe(t))throw new TypeError(wg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Vwe({},t),Iwe(i,"iter")){if(!Wwe(i.iter))throw new TypeError(wg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=IV;a=kV(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=kV(r,e),i={iter:IV,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),FV(n,"state",Awe(null),Gwe),Kt(n,"stateLength",null),Kt(n,"byteLength",null)):(bg(n,"seed",l),bg(n,"seedLength",m),FV(n,"state",d,f),bg(n,"stateLength",h),bg(n,"byteLength",p)),Kt(n,"PRNG",a.PRNG),zV&&Kt(n,zV,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 JV(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}}UV.exports=JV});var DV=s(function(F$e,BV){"use strict";var kwe=CV();BV.exports=kwe});var e2=s(function(W$e,KV){"use strict";var ei=require("@stdlib/utils/define-nonenumerable-read-only-property"),Sg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),XV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),zwe=require("@stdlib/utils/constant-function"),Jwe=require("@stdlib/utils/noop"),Uwe=require("@stdlib/object/assign"),YV=require("@stdlib/assert/is-positive-number").isPrimitive,Cwe=require("@stdlib/assert/is-plain-object"),Bwe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Dwe=require("@stdlib/assert/has-own-property"),HV=require("@stdlib/constants/float64/max"),ZV=Pa().factory,QV=require("@stdlib/symbol/iterator"),Og=require("@stdlib/string/format");function $V(r,e,t){var i,n,a,u,o;if(!YV(r))throw new TypeError(Og("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!YV(e))throw new TypeError(Og("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Cwe(t))throw new TypeError(Og("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Uwe({},t),Dwe(i,"iter")){if(!Bwe(i.iter))throw new TypeError(Og("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=HV;a=ZV(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=ZV(r,e),i={iter:HV,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),XV(n,"state",zwe(null),Jwe),ei(n,"stateLength",null),ei(n,"byteLength",null)):(Sg(n,"seed",l),Sg(n,"seedLength",m),XV(n,"state",d,f),Sg(n,"stateLength",h),Sg(n,"byteLength",p)),ei(n,"PRNG",a.PRNG),QV&&ei(n,QV,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 $V(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}}KV.exports=$V});var t2=s(function(I$e,r2){"use strict";var Xwe=e2();r2.exports=Xwe});var v2=s(function(k$e,o2){"use strict";var ri=require("@stdlib/utils/define-nonenumerable-read-only-property"),Eg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),i2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ywe=require("@stdlib/utils/constant-function"),Hwe=require("@stdlib/utils/noop"),Zwe=require("@stdlib/object/assign"),Qwe=require("@stdlib/assert/is-number").isPrimitive,$we=require("@stdlib/math/base/assert/is-nan"),Kwe=require("@stdlib/assert/is-plain-object"),eSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,rSe=require("@stdlib/assert/is-positive-number").isPrimitive,tSe=require("@stdlib/assert/has-own-property"),n2=require("@stdlib/constants/float64/max"),a2=Ta().factory,s2=require("@stdlib/symbol/iterator"),_g=require("@stdlib/string/format");function u2(r,e,t){var i,n,a,u,o;if(!Qwe(r)||$we(r))throw new TypeError(_g("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!rSe(e))throw new TypeError(_g("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Kwe(t))throw new TypeError(_g("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Zwe({},t),tSe(i,"iter")){if(!eSe(i.iter))throw new TypeError(_g("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=n2;a=a2(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=a2(r,e),i={iter:n2,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),i2(n,"state",Ywe(null),Hwe),ri(n,"stateLength",null),ri(n,"byteLength",null)):(Eg(n,"seed",l),Eg(n,"seedLength",m),i2(n,"state",d,f),Eg(n,"stateLength",h),Eg(n,"byteLength",p)),ri(n,"PRNG",a.PRNG),s2&&ri(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 u2(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}}o2.exports=u2});var f2=s(function(z$e,g2){"use strict";var iSe=v2();g2.exports=iSe});var y2=s(function(J$e,p2){"use strict";var ti=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ng=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),d2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),nSe=require("@stdlib/utils/constant-function"),aSe=require("@stdlib/utils/noop"),sSe=require("@stdlib/object/assign"),uSe=require("@stdlib/assert/is-number").isPrimitive,oSe=require("@stdlib/math/base/assert/is-nan"),vSe=require("@stdlib/assert/is-plain-object"),gSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,fSe=require("@stdlib/assert/is-positive-number").isPrimitive,dSe=require("@stdlib/assert/has-own-property"),l2=require("@stdlib/constants/float64/max"),c2=ja().factory,m2=require("@stdlib/symbol/iterator"),Lg=require("@stdlib/string/format");function h2(r,e,t){var i,n,a,u,o;if(!uSe(r)||oSe(r))throw new TypeError(Lg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!fSe(e))throw new TypeError(Lg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!vSe(t))throw new TypeError(Lg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=sSe({},t),dSe(i,"iter")){if(!gSe(i.iter))throw new TypeError(Lg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=l2;a=c2(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=c2(r,e),i={iter:l2,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),d2(n,"state",nSe(null),aSe),ti(n,"stateLength",null),ti(n,"byteLength",null)):(Ng(n,"seed",l),Ng(n,"seedLength",m),d2(n,"state",d,f),Ng(n,"stateLength",h),Ng(n,"byteLength",p)),ti(n,"PRNG",a.PRNG),m2&&ti(n,m2,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 h2(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}}p2.exports=h2});var b2=s(function(U$e,q2){"use strict";var lSe=y2();q2.exports=lSe});var L2=s(function(C$e,N2){"use strict";var ii=require("@stdlib/utils/define-nonenumerable-read-only-property"),Rg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),w2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),cSe=require("@stdlib/utils/constant-function"),mSe=require("@stdlib/utils/noop"),hSe=require("@stdlib/object/assign"),pSe=require("@stdlib/assert/is-number").isPrimitive,ySe=require("@stdlib/math/base/assert/is-nan"),qSe=require("@stdlib/assert/is-plain-object"),bSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,wSe=require("@stdlib/assert/is-positive-number").isPrimitive,SSe=require("@stdlib/assert/has-own-property"),S2=require("@stdlib/constants/float64/max"),O2=Ma().factory,E2=require("@stdlib/symbol/iterator"),Pg=require("@stdlib/string/format");function _2(r,e,t){var i,n,a,u,o;if(!pSe(r)||ySe(r))throw new TypeError(Pg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!wSe(e))throw new TypeError(Pg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!qSe(t))throw new TypeError(Pg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=hSe({},t),SSe(i,"iter")){if(!bSe(i.iter))throw new TypeError(Pg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=S2;a=O2(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=O2(r,e),i={iter:S2,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),w2(n,"state",cSe(null),mSe),ii(n,"stateLength",null),ii(n,"byteLength",null)):(Rg(n,"seed",l),Rg(n,"seedLength",m),w2(n,"state",d,f),Rg(n,"stateLength",h),Rg(n,"byteLength",p)),ii(n,"PRNG",a.PRNG),E2&&ii(n,E2,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 _2(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=_2});var P2=s(function(B$e,R2){"use strict";var OSe=L2();R2.exports=OSe});var V2=s(function(D$e,G2){"use strict";var ni=require("@stdlib/utils/define-nonenumerable-read-only-property"),Tg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),T2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ESe=require("@stdlib/utils/constant-function"),_Se=require("@stdlib/utils/noop"),NSe=require("@stdlib/object/assign"),LSe=require("@stdlib/assert/is-number").isPrimitive,RSe=require("@stdlib/math/base/assert/is-nan"),PSe=require("@stdlib/assert/is-plain-object"),TSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,jSe=require("@stdlib/assert/is-positive-number").isPrimitive,MSe=require("@stdlib/assert/has-own-property"),j2=require("@stdlib/constants/float64/max"),M2=cn().factory,x2=require("@stdlib/symbol/iterator"),jg=require("@stdlib/string/format");function A2(r,e,t){var i,n,a,u,o;if(!LSe(r)||RSe(r))throw new TypeError(jg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!jSe(e))throw new TypeError(jg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!PSe(t))throw new TypeError(jg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=NSe({},t),MSe(i,"iter")){if(!TSe(i.iter))throw new TypeError(jg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=j2;a=M2(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=M2(r,e),i={iter:j2,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),T2(n,"state",ESe(null),_Se),ni(n,"stateLength",null),ni(n,"byteLength",null)):(Tg(n,"seed",l),Tg(n,"seedLength",m),T2(n,"state",d,f),Tg(n,"stateLength",h),Tg(n,"byteLength",p)),ni(n,"PRNG",a.PRNG),x2&&ni(n,x2,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}}G2.exports=A2});var W2=s(function(X$e,F2){"use strict";var xSe=V2();F2.exports=xSe});var B2=s(function(Y$e,C2){"use strict";var am=require("@stdlib/utils/define-nonenumerable-read-only-property"),Mg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),ASe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),GSe=require("@stdlib/object/assign"),VSe=require("@stdlib/assert/is-plain-object"),FSe=require("@stdlib/assert/is-boolean").isPrimitive,WSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,I2=require("@stdlib/assert/has-own-property"),k2=require("@stdlib/constants/float64/max"),z2=$().factory,J2=require("@stdlib/symbol/iterator"),sm=require("@stdlib/string/format");function U2(r){var e,t,i,n,a;if(arguments.length>0){if(!VSe(r))throw new TypeError(sm("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=GSe({},r),I2(e,"normalized")&&!FSe(e.normalized))throw new TypeError(sm("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",e.normalized));if(I2(e,"iter")){if(!WSe(e.iter))throw new TypeError(sm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=k2;i=z2(e),e.copy!==!1&&(e.state=i.state)}else i=z2(),e={iter:k2,state:i.state};return e.normalized&&(i=i.normalized),a=0,t={},am(t,"next",u),am(t,"return",o),Mg(t,"seed",g),Mg(t,"seedLength",c),ASe(t,"state",h,p),Mg(t,"stateLength",l),Mg(t,"byteLength",m),J2&&am(t,J2,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 U2(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}}C2.exports=U2});var X2=s(function(H$e,D2){"use strict";var ISe=B2();D2.exports=ISe});var eF=s(function(Z$e,K2){"use strict";var um=require("@stdlib/utils/define-nonenumerable-read-only-property"),xg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),kSe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),zSe=require("@stdlib/object/assign"),JSe=require("@stdlib/assert/is-plain-object"),USe=require("@stdlib/assert/is-boolean").isPrimitive,CSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Y2=require("@stdlib/assert/has-own-property"),H2=require("@stdlib/constants/float64/max"),Z2=ee().factory,Q2=require("@stdlib/symbol/iterator"),om=require("@stdlib/string/format");function $2(r){var e,t,i,n,a;if(arguments.length>0){if(!JSe(r))throw new TypeError(om("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=zSe({},r),Y2(e,"normalized")&&!USe(e.normalized))throw new TypeError(om("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",e.normalized));if(Y2(e,"iter")){if(!CSe(e.iter))throw new TypeError(om("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=H2;i=Z2(e),e.copy!==!1&&(e.state=i.state)}else i=Z2(),e={iter:H2,state:i.state};return e.normalized&&(i=i.normalized),a=0,t={},um(t,"next",u),um(t,"return",o),xg(t,"seed",g),xg(t,"seedLength",c),kSe(t,"state",h,p),xg(t,"stateLength",l),xg(t,"byteLength",m),Q2&&um(t,Q2,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 $2(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=$2});var tF=s(function(Q$e,rF){"use strict";var BSe=eF();rF.exports=BSe});var vF=s(function($$e,oF){"use strict";var vm=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ag=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),DSe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),XSe=require("@stdlib/object/assign"),YSe=require("@stdlib/assert/is-plain-object"),HSe=require("@stdlib/assert/is-boolean").isPrimitive,ZSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,iF=require("@stdlib/assert/has-own-property"),nF=require("@stdlib/constants/float64/max"),aF=T().factory,sF=require("@stdlib/symbol/iterator"),gm=require("@stdlib/string/format");function uF(r){var e,t,i,n,a;if(arguments.length>0){if(!YSe(r))throw new TypeError(gm("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=XSe({},r),iF(e,"normalized")&&!HSe(e.normalized))throw new TypeError(gm("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",e.normalized));if(iF(e,"iter")){if(!ZSe(e.iter))throw new TypeError(gm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=nF;i=aF(e),e.copy!==!1&&(e.state=i.state)}else i=aF(),e={iter:nF,state:i.state};return e.normalized&&(i=i.normalized),a=0,t={},vm(t,"next",u),vm(t,"return",o),Ag(t,"seed",g),Ag(t,"seedLength",c),DSe(t,"state",h,p),Ag(t,"stateLength",l),Ag(t,"byteLength",m),sF&&vm(t,sF,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 uF(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}}oF.exports=uF});var fF=s(function(K$e,gF){"use strict";var QSe=vF();gF.exports=QSe});var yF=s(function(eKe,pF){"use strict";var ai=require("@stdlib/utils/define-nonenumerable-read-only-property"),Gg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),dF=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),$Se=require("@stdlib/utils/constant-function"),KSe=require("@stdlib/utils/noop"),eOe=require("@stdlib/object/assign"),rOe=require("@stdlib/assert/is-probability").isPrimitive,tOe=require("@stdlib/assert/is-plain-object"),iOe=require("@stdlib/assert/is-positive-number").isPrimitive,nOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,aOe=require("@stdlib/assert/has-own-property"),lF=require("@stdlib/constants/float64/max"),cF=Ia().factory,mF=require("@stdlib/symbol/iterator"),Vg=require("@stdlib/string/format");function hF(r,e,t){var i,n,a,u,o;if(!iOe(r))throw new TypeError(Vg("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!rOe(e))throw new TypeError(Vg("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(arguments.length>2){if(!tOe(t))throw new TypeError(Vg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=eOe({},t),aOe(i,"iter")){if(!nOe(i.iter))throw new TypeError(Vg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=lF;a=cF(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=cF(r,e),i={iter:lF,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),dF(n,"state",$Se(null),KSe),ai(n,"stateLength",null),ai(n,"byteLength",null)):(Gg(n,"seed",l),Gg(n,"seedLength",m),dF(n,"state",d,f),Gg(n,"stateLength",h),Gg(n,"byteLength",p)),ai(n,"PRNG",a.PRNG),mF&&ai(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 hF(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}}pF.exports=hF});var bF=s(function(rKe,qF){"use strict";var sOe=yF();qF.exports=sOe});var LF=s(function(tKe,NF){"use strict";var si=require("@stdlib/utils/define-nonenumerable-read-only-property"),Fg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),wF=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),uOe=require("@stdlib/utils/constant-function"),oOe=require("@stdlib/utils/noop"),vOe=require("@stdlib/object/assign"),gOe=require("@stdlib/assert/is-number").isPrimitive,fOe=require("@stdlib/math/base/assert/is-nan"),dOe=require("@stdlib/assert/is-plain-object"),lOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,cOe=require("@stdlib/assert/is-positive-number").isPrimitive,mOe=require("@stdlib/assert/has-own-property"),SF=require("@stdlib/constants/float64/max"),OF=hn().factory,EF=require("@stdlib/symbol/iterator"),Wg=require("@stdlib/string/format");function _F(r,e,t){var i,n,a,u,o;if(!gOe(r)||fOe(r))throw new TypeError(Wg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!cOe(e))throw new TypeError(Wg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!dOe(t))throw new TypeError(Wg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=vOe({},t),mOe(i,"iter")){if(!lOe(i.iter))throw new TypeError(Wg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=SF;a=OF(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=OF(r,e),i={iter:SF,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),wF(n,"state",uOe(null),oOe),si(n,"stateLength",null),si(n,"byteLength",null)):(Fg(n,"seed",l),Fg(n,"seedLength",m),wF(n,"state",d,f),Fg(n,"stateLength",h),Fg(n,"byteLength",p)),si(n,"PRNG",a.PRNG),EF&&si(n,EF,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 _F(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}}NF.exports=_F});var PF=s(function(iKe,RF){"use strict";var hOe=LF();RF.exports=hOe});var FF=s(function(nKe,VF){"use strict";var ui=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ig=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),TF=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),pOe=require("@stdlib/utils/constant-function"),yOe=require("@stdlib/utils/noop"),qOe=require("@stdlib/object/assign"),jF=require("@stdlib/assert/is-positive-number").isPrimitive,bOe=require("@stdlib/assert/is-plain-object"),wOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,SOe=require("@stdlib/assert/has-own-property"),MF=require("@stdlib/constants/float64/max"),xF=za().factory,AF=require("@stdlib/symbol/iterator"),kg=require("@stdlib/string/format");function GF(r,e,t){var i,n,a,u,o;if(!jF(r))throw new TypeError(kg("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!jF(e))throw new TypeError(kg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!bOe(t))throw new TypeError(kg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=qOe({},t),SOe(i,"iter")){if(!wOe(i.iter))throw new TypeError(kg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=MF;a=xF(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=xF(r,e),i={iter:MF,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),TF(n,"state",pOe(null),yOe),ui(n,"stateLength",null),ui(n,"byteLength",null)):(Ig(n,"seed",l),Ig(n,"seedLength",m),TF(n,"state",d,f),Ig(n,"stateLength",h),Ig(n,"byteLength",p)),ui(n,"PRNG",a.PRNG),AF&&ui(n,AF,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 GF(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}}VF.exports=GF});var IF=s(function(aKe,WF){"use strict";var OOe=FF();WF.exports=OOe});var DF=s(function(sKe,BF){"use strict";var oi=require("@stdlib/utils/define-nonenumerable-read-only-property"),zg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),kF=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-positive-number").isPrimitive,ROe=require("@stdlib/assert/is-plain-object"),POe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,TOe=require("@stdlib/assert/has-own-property"),zF=require("@stdlib/constants/float64/max"),JF=mn().factory,UF=require("@stdlib/symbol/iterator"),fm=require("@stdlib/string/format");function CF(r,e){var t,i,n,a,u;if(!LOe(r))throw new TypeError(fm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!ROe(e))throw new TypeError(fm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=NOe({},e),TOe(t,"iter")){if(!POe(t.iter))throw new TypeError(fm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=zF;n=JF(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=JF(r),t={iter:zF,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),kF(i,"state",EOe(null),_Oe),oi(i,"stateLength",null),oi(i,"byteLength",null)):(zg(i,"seed",c),zg(i,"seedLength",l),kF(i,"state",p,d),zg(i,"stateLength",m),zg(i,"byteLength",h)),oi(i,"PRNG",n.PRNG),UF&&oi(i,UF,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 CF(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}}BF.exports=CF});var YF=s(function(uKe,XF){"use strict";var jOe=DF();XF.exports=jOe});var rW=s(function(oKe,eW){"use strict";var Jg=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ug=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),MOe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),xOe=require("@stdlib/object/assign"),AOe=require("@stdlib/assert/is-plain-object"),GOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,VOe=require("@stdlib/assert/has-own-property"),HF=require("@stdlib/constants/float64/max"),ZF=hu().factory,QF=require("@stdlib/symbol/iterator"),$F=require("@stdlib/string/format");function KF(r){var e,t,i,n,a;if(arguments.length>0){if(!AOe(r))throw new TypeError($F("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=xOe({},r),VOe(e,"iter")){if(!GOe(e.iter))throw new TypeError($F("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=HF;i=ZF(e),e.copy!==!1&&(e.state=i.state)}else i=ZF(),e={iter:HF,state:i.state};return a=0,t={},Jg(t,"next",u),Jg(t,"return",o),Ug(t,"seed",g),Ug(t,"seedLength",c),MOe(t,"state",h,p),Ug(t,"stateLength",l),Ug(t,"byteLength",m),Jg(t,"PRNG",i.PRNG),QF&&Jg(t,QF,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 KF(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}}eW.exports=KF});var iW=s(function(vKe,tW){"use strict";var FOe=rW();tW.exports=FOe});var fW=s(function(gKe,gW){"use strict";var vi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Cg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),nW=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-plain-object"),JOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,UOe=require("@stdlib/assert/has-own-property"),aW=require("@stdlib/constants/float64/max"),sW=yu().factory,uW=require("@stdlib/symbol/iterator"),oW=require("@stdlib/string/format");function vW(r){var e,t,i,n,a;if(arguments.length>0){if(!zOe(r))throw new TypeError(oW("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=kOe({},r),UOe(e,"iter")){if(!JOe(e.iter))throw new TypeError(oW("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=aW;i=sW(e),e.prng===void 0&&e.copy!==!1&&(e.state=i.state)}else i=sW(),e={iter:aW,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),nW(t,"state",WOe(null),IOe),vi(t,"stateLength",null),vi(t,"byteLength",null)):(Cg(t,"seed",g),Cg(t,"seedLength",c),nW(t,"state",h,p),Cg(t,"stateLength",l),Cg(t,"byteLength",m)),vi(t,"PRNG",i.PRNG),uW&&vi(t,uW,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 vW(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}}gW.exports=vW});var lW=s(function(fKe,dW){"use strict";var COe=fW();dW.exports=COe});var bW=s(function(dKe,qW){"use strict";var Bg=require("@stdlib/utils/define-nonenumerable-read-only-property"),Dg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),BOe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),DOe=require("@stdlib/object/assign"),XOe=require("@stdlib/assert/is-plain-object"),YOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,HOe=require("@stdlib/assert/has-own-property"),cW=require("@stdlib/constants/float64/max"),mW=Tt().factory,hW=require("@stdlib/symbol/iterator"),pW=require("@stdlib/string/format");function yW(r){var e,t,i,n,a;if(arguments.length>0){if(!XOe(r))throw new TypeError(pW("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=DOe({},r),HOe(e,"iter")){if(!YOe(e.iter))throw new TypeError(pW("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=cW;i=mW(e),e.copy!==!1&&(e.state=i.state)}else i=mW(),e={iter:cW,state:i.state};return a=0,t={},Bg(t,"next",u),Bg(t,"return",o),Dg(t,"seed",g),Dg(t,"seedLength",c),BOe(t,"state",h,p),Dg(t,"stateLength",l),Dg(t,"byteLength",m),Bg(t,"PRNG",i.PRNG),hW&&Bg(t,hW,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 yW(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}}qW.exports=yW});var SW=s(function(lKe,wW){"use strict";var ZOe=bW();wW.exports=ZOe});var PW=s(function(cKe,RW){"use strict";var gi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),OW=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),QOe=require("@stdlib/utils/constant-function"),$Oe=require("@stdlib/utils/noop"),KOe=require("@stdlib/object/assign"),eEe=require("@stdlib/assert/is-positive-number").isPrimitive,rEe=require("@stdlib/assert/is-plain-object"),tEe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,iEe=require("@stdlib/assert/has-own-property"),EW=require("@stdlib/constants/float64/max"),_W=Ja().factory,NW=require("@stdlib/symbol/iterator"),dm=require("@stdlib/string/format");function LW(r,e){var t,i,n,a,u;if(!eEe(r))throw new TypeError(dm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!rEe(e))throw new TypeError(dm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=KOe({},e),iEe(t,"iter")){if(!tEe(t.iter))throw new TypeError(dm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=EW;n=_W(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=_W(r),t={iter:EW,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),OW(i,"state",QOe(null),$Oe),gi(i,"stateLength",null),gi(i,"byteLength",null)):(Xg(i,"seed",c),Xg(i,"seedLength",l),OW(i,"state",p,d),Xg(i,"stateLength",m),Xg(i,"byteLength",h)),gi(i,"PRNG",n.PRNG),NW&&gi(i,NW,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 LW(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}}RW.exports=LW});var jW=s(function(mKe,TW){"use strict";var nEe=PW();TW.exports=nEe});var WW=s(function(hKe,FW){"use strict";var fi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Yg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),MW=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),aEe=require("@stdlib/utils/constant-function"),sEe=require("@stdlib/utils/noop"),uEe=require("@stdlib/object/assign"),oEe=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"),xW=require("@stdlib/constants/float64/max"),AW=Ba().factory,GW=require("@stdlib/symbol/iterator"),lm=require("@stdlib/string/format");function VW(r,e){var t,i,n,a,u;if(!oEe(r))throw new TypeError(lm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!vEe(e))throw new TypeError(lm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=uEe({},e),fEe(t,"iter")){if(!gEe(t.iter))throw new TypeError(lm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=xW;n=AW(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=AW(r),t={iter:xW,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),MW(i,"state",aEe(null),sEe),fi(i,"stateLength",null),fi(i,"byteLength",null)):(Yg(i,"seed",c),Yg(i,"seedLength",l),MW(i,"state",p,d),Yg(i,"stateLength",m),Yg(i,"byteLength",h)),fi(i,"PRNG",n.PRNG),GW&&fi(i,GW,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 VW(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}}FW.exports=VW});var kW=s(function(pKe,IW){"use strict";var dEe=WW();IW.exports=dEe});var XW=s(function(yKe,DW){"use strict";var di=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),zW=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),lEe=require("@stdlib/utils/constant-function"),cEe=require("@stdlib/utils/noop"),mEe=require("@stdlib/object/assign"),cm=require("@stdlib/assert/is-number").isPrimitive,mm=require("@stdlib/math/base/assert/is-nan"),hEe=require("@stdlib/assert/is-plain-object"),pEe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,yEe=require("@stdlib/assert/has-own-property"),JW=require("@stdlib/constants/float64/max"),UW=Da().factory,CW=require("@stdlib/symbol/iterator"),Ha=require("@stdlib/string/format");function BW(r,e,t,i){var n,a,u,o,v;if(!cm(r)||mm(r))throw new TypeError(Ha("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!cm(e)||mm(e))throw new TypeError(Ha("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(!cm(t)||mm(t))throw new TypeError(Ha("invalid argument. Third argument must be a number and not NaN. Value: `%s`.",t));if(!(r<=t&&t<=e))throw new RangeError(Ha("invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.","a <= c <= b",r,e,t));if(arguments.length>3){if(!hEe(i))throw new TypeError(Ha("invalid argument. Options argument must be an object. Value: `%s`.",i));if(n=mEe({},i),yEe(n,"iter")){if(!pEe(n.iter))throw new TypeError(Ha("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",n.iter))}else n.iter=JW;u=UW(r,e,t,n),n.prng===void 0&&n.copy!==!1&&(n.state=u.state)}else u=UW(r,e,t),n={iter:JW,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),zW(a,"state",lEe(null),cEe),di(a,"stateLength",null),di(a,"byteLength",null)):(Hg(a,"seed",m),Hg(a,"seedLength",h),zW(a,"state",f,y),Hg(a,"stateLength",p),Hg(a,"byteLength",d)),di(a,"PRNG",u.PRNG),CW&&di(a,CW,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 BW(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}}DW.exports=BW});var HW=s(function(qKe,YW){"use strict";var qEe=XW();YW.exports=qEe});var nI=s(function(bKe,iI){"use strict";var li=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),ZW=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),bEe=require("@stdlib/utils/constant-function"),wEe=require("@stdlib/utils/noop"),SEe=require("@stdlib/object/assign"),QW=require("@stdlib/assert/is-number").isPrimitive,$W=require("@stdlib/math/base/assert/is-nan"),OEe=require("@stdlib/assert/is-plain-object"),EEe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,_Ee=require("@stdlib/assert/has-own-property"),KW=require("@stdlib/constants/float64/max"),eI=pn().factory,rI=require("@stdlib/symbol/iterator"),Su=require("@stdlib/string/format");function tI(r,e,t){var i,n,a,u,o;if(!QW(r)||$W(r))throw new TypeError(Su("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!QW(e)||$W(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(!OEe(t))throw new TypeError(Su("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=SEe({},t),_Ee(i,"iter")){if(!EEe(i.iter))throw new TypeError(Su("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=KW;a=eI(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=eI(r,e),i={iter:KW,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),ZW(n,"state",bEe(null),wEe),li(n,"stateLength",null),li(n,"byteLength",null)):(Zg(n,"seed",l),Zg(n,"seedLength",m),ZW(n,"state",d,f),Zg(n,"stateLength",h),Zg(n,"byteLength",p)),li(n,"PRNG",a.PRNG),rI&&li(n,rI,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 tI(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}}iI.exports=tI});var sI=s(function(wKe,aI){"use strict";var NEe=nI();aI.exports=NEe});var cI=s(function(SKe,lI){"use strict";var ci=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),uI=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),LEe=require("@stdlib/utils/constant-function"),REe=require("@stdlib/utils/noop"),PEe=require("@stdlib/object/assign"),oI=require("@stdlib/assert/is-positive-number").isPrimitive,TEe=require("@stdlib/assert/is-plain-object"),jEe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,MEe=require("@stdlib/assert/has-own-property"),vI=require("@stdlib/constants/float64/max"),gI=yn().factory,fI=require("@stdlib/symbol/iterator"),$g=require("@stdlib/string/format");function dI(r,e,t){var i,n,a,u,o;if(!oI(r))throw new TypeError($g("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!oI(e))throw new TypeError($g("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!TEe(t))throw new TypeError($g("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=PEe({},t),MEe(i,"iter")){if(!jEe(i.iter))throw new TypeError($g("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=vI;a=gI(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=gI(r,e),i={iter:vI,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),uI(n,"state",LEe(null),REe),ci(n,"stateLength",null),ci(n,"byteLength",null)):(Qg(n,"seed",l),Qg(n,"seedLength",m),uI(n,"state",d,f),Qg(n,"stateLength",h),Qg(n,"byteLength",p)),ci(n,"PRNG",a.PRNG),fI&&ci(n,fI,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 dI(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}}lI.exports=dI});var hI=s(function(OKe,mI){"use strict";var xEe=cI();mI.exports=xEe});var yI=s(function(EKe,pI){"use strict";var R=require("@stdlib/utils/define-read-only-property"),N={};R(N,"arcsine",q1());R(N,"bernoulli",R1());R(N,"beta",W1());R(N,"betaprime",Y1());R(N,"binomial",iA());R(N,"boxMuller",lA());R(N,"cauchy",SA());R(N,"chi",jA());R(N,"chisquare",kA());R(N,"cosine",HA());R(N,"discreteUniform",aG());R(N,"erlang",cG());R(N,"exponential",OG());R(N,"f",xG());R(N,"frechet",UG());R(N,"gamma",KG());R(N,"geometric",oV());R(N,"gumbel",pV());R(N,"hypergeometric",NV());R(N,"improvedZiggurat",VV());R(N,"invgamma",DV());R(N,"kumaraswamy",t2());R(N,"laplace",f2());R(N,"levy",b2());R(N,"logistic",P2());R(N,"lognormal",W2());R(N,"minstd",X2());R(N,"minstdShuffle",tF());R(N,"mt19937",fF());R(N,"negativeBinomial",bF());R(N,"normal",PF());R(N,"pareto1",IF());R(N,"poisson",YF());R(N,"randi",iW());R(N,"randn",lW());R(N,"randu",SW());R(N,"rayleigh",jW());R(N,"t",kW());R(N,"triangular",HW());R(N,"uniform",sI());R(N,"weibull",hI());pI.exports=N});var bI=s(function(_Ke,qI){"use strict";var AEe=require("@stdlib/math/base/special/floor");function GEe(r,e,t){var i,n,a,u;for(a=r.length,n=new Array(e),u=0;u0;a--)u=FEe(t()*(a+1)),i=r[a],r[a]=r[u],r[u]=i;return WEe.call(r,0,e)}OI.exports=IEe});var NI=s(function(RKe,_I){"use strict";var kEe=require("@stdlib/math/base/special/floor");function zEe(r,e,t,i){var n,a,u,o,v,g,c,l,m,h;for(u=i.slice(),g=r.length,n=[],a=[],m=0;m1){if(e=arguments[0],r=arguments[1],!(hm(e)||pm(e)))throw new TypeError(ef("invalid argument. `%s` argument must be array-like. Value: `%s`.","pool",e));n=rf(t,r)}if(n)throw n;return r&&r.seed?i=xI({seed:r.seed}):i=xI(),e===void 0?a=u:(MI(e)?e=e.split(""):e=AI(e),a=o),jI(a,"seed",i.seed),jI(a,"PRNG",i),i=i.normalized,a;function u(v,g){var c,l,m,h,p,d;if(!(hm(v)||pm(v)))throw new TypeError(ef("invalid argument. First argument must be array-like. Value: `%s`.",v));if(MI(v)&&(v=v.split("")),h={},arguments.length>1&&(d=rf(h,g),d))throw d;if(h.replace===void 0?c=t.replace:c=h.replace,h.probs!==void 0&&(m=h.probs),h.size?p=h.size:t.size?p=t.size:p=v.length,c===!1&&p>v.length)throw new RangeError(ef("invalid option. `size` option must be less than or equal to the length of `x` when `replace` is `false`. Option: `%s`.",p));return m?c?YEe(v,p,i,m):XEe(v,p,i,m):c?GI(v,p,i):(l=ZEe.call(v),VI(l,p,i))}function o(v){var g,c,l,m,h,p;if(e.length===0)return null;if(l={},arguments.length&&(h=rf(l,v),h))throw h;if(l.mutate===void 0?c=t.mutate:c=l.mutate,l.replace===void 0?g=t.replace:g=l.replace,l.size?m=l.size:t.size?m=t.size:m=e.length,g===!1&&m>e.length)throw new RangeError(ef("invalid option. `size` option must be less than or equal to the population size when `replace` is `false`. Option: `%s`.",m));return g?GI(e,m,i):(p=VI(e,m,i),c&&(e=e.slice(m,e.length)),p)}}FI.exports=QEe});var II=s(function(MKe,WI){"use strict";var $Ee=ym(),KEe=$Ee();WI.exports=KEe});var JI=s(function(xKe,zI){"use strict";var e_e=require("@stdlib/utils/define-nonenumerable-read-only-property"),kI=II(),r_e=ym();e_e(kI,"factory",r_e);zI.exports=kI});var UI=s(function(AKe,t_e){t_e.exports={copy:"shallow"}});var DI=s(function(GKe,BI){"use strict";var i_e=require("@stdlib/assert/has-own-property"),n_e=require("@stdlib/assert/is-string").isPrimitive,a_e=require("@stdlib/assert/is-plain-object"),s_e=require("@stdlib/utils/index-of"),qm=require("@stdlib/string/format"),CI=["deep","shallow","none"];function u_e(r,e){if(!a_e(e))return new TypeError(qm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(i_e(e,"copy")){if(r.copy=e.copy,!n_e(r.copy))return new TypeError(qm("invalid option. `%s` option must be a string. Option: `%s`.","copy",r.copy));if(s_e(CI,r.copy)===-1)return new TypeError(qm('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"copy",CI.join('", "'),r.copy))}return null}BI.exports=u_e});var bm=s(function(VKe,QI){"use strict";var XI=require("@stdlib/utils/define-nonenumerable-read-only-property"),o_e=require("@stdlib/assert/is-array-like"),v_e=require("@stdlib/assert/is-typed-array-like"),g_e=require("@stdlib/assert/is-string").isPrimitive,YI=require("@stdlib/utils/copy"),f_e=require("@stdlib/math/base/special/floor"),HI=T().factory,d_e=require("@stdlib/string/format"),l_e=UI(),ZI=DI();function c_e(r){var e,t,i;if(e=YI(l_e),arguments.length&&(i=ZI(e,r),i))throw i;return r&&r.seed?t=HI({seed:r.seed}):t=HI(),XI(n,"seed",t.seed),XI(n,"PRNG",t),t=t.normalized,n;function n(a,u){var o,v,g,c,l,m,h,p,d,f;if(!(o_e(a)||v_e(a)))throw new TypeError(d_e("invalid argument. First argument must be array-like. Value: `%s`.",a));if(arguments.length>1&&(c={},l=ZI(c,u),l))throw l;for(g=c&&c.copy?c.copy:e.copy,o=g_e(a),o&&(a=a.split(""),g="none"),v=0,g==="shallow"?v+=1:g==="deep"&&(v+=2),p=a.length,m=YI(a,v),d=p-1;d>0;d--)f=f_e(t()*(d+1)),h=m[d],m[d]=m[f],m[f]=h;return o&&(m=a.join("")),m}}QI.exports=c_e});var KI=s(function(FKe,$I){"use strict";var m_e=bm(),h_e=m_e();$I.exports=h_e});var tk=s(function(WKe,rk){"use strict";var p_e=require("@stdlib/utils/define-nonenumerable-read-only-property"),ek=KI(),y_e=bm();p_e(ek,"factory",y_e);rk.exports=ek});var ik=s(function(IKe,q_e){q_e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var sk=s(function(kKe,ak){"use strict";var b_e=require("@stdlib/assert/is-plain-object"),He=require("@stdlib/assert/has-own-property"),w_e=require("@stdlib/assert/is-boolean").isPrimitive,S_e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,nk=require("@stdlib/assert/is-string").isPrimitive,O_e=require("@stdlib/assert/is-positive-integer").isPrimitive,E_e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,bn=require("@stdlib/string/format");function __e(r,e){return b_e(e)?He(e,"sep")&&(r.sep=e.sep,!nk(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,!w_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,!nk(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,!S_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,!E_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,!O_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))}ak.exports=__e});var ok=s(function(zKe,uk){"use strict";var N_e=require("debug"),L_e=N_e("random:streams:arcsine");uk.exports=L_e});var nf=s(function(JKe,ck){"use strict";var lk=require("readable-stream").Readable,vk=require("@stdlib/assert/is-number").isPrimitive,gk=require("@stdlib/math/base/assert/is-nan"),R_e=require("@stdlib/assert/is-error"),P_e=require("@stdlib/object/assign"),T_e=require("@stdlib/utils/inherit"),fk=require("@stdlib/utils/define-nonenumerable-property"),mi=require("@stdlib/utils/define-nonenumerable-read-only-property"),tf=require("@stdlib/utils/define-read-only-accessor"),j_e=require("@stdlib/utils/define-read-write-accessor"),M_e=nn().factory,dk=require("@stdlib/buffer/from-string"),x_e=require("@stdlib/utils/next-tick"),wm=require("@stdlib/string/format"),A_e=ik(),G_e=sk(),Za=ok();function V_e(){return this._prng.seed}function F_e(){return this._prng.seedLength}function W_e(){return this._prng.stateLength}function I_e(){return this._prng.byteLength}function k_e(){return this._prng.state}function z_e(r){this._prng.state=r}function J_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=dk(e):e=dk(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function U_e(r){var e;if(this._destroyed)return Za("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,x_e(t),this;function t(){r&&(Za("Stream was destroyed due to an error. Error: %s.",R_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(!vk(r)||gk(r))throw new TypeError(wm("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!vk(e)||gk(e))throw new TypeError(wm("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(r>=e)throw new RangeError(wm("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e));if(i=P_e({},A_e),arguments.length>2&&(n=G_e(i,t),n))throw n;return Za("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),lk.call(this,i),fk(this,"_destroyed",!1),mi(this,"_objectMode",i.objectMode),mi(this,"_sep",i.sep),mi(this,"_iter",i.iter),mi(this,"_siter",i.siter),fk(this,"_i",0),mi(this,"_prng",M_e(r,e,i)),mi(this,"PRNG",this._prng.PRNG),this}T_e(te,lk);tf(te.prototype,"seed",V_e);tf(te.prototype,"seedLength",F_e);j_e(te.prototype,"state",k_e,z_e);tf(te.prototype,"stateLength",W_e);tf(te.prototype,"byteLength",I_e);mi(te.prototype,"_read",J_e);mi(te.prototype,"destroy",U_e);ck.exports=te});var hk=s(function(UKe,mk){"use strict";var C_e=require("@stdlib/assert/is-plain-object"),B_e=require("@stdlib/string/format"),D_e=require("@stdlib/object/assign"),X_e=nf();function Y_e(r,e,t){var i;if(arguments.length>2){if(i=t,!C_e(i))throw new TypeError(B_e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=D_e({},t)}else i={};return i.objectMode=!0,new X_e(r,e,i)}mk.exports=Y_e});var Sk=s(function(CKe,wk){"use strict";var pk=require("@stdlib/assert/is-plain-object"),yk=require("@stdlib/object/assign"),qk=require("@stdlib/string/format"),bk=nf();function H_e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!pk(r))throw new TypeError(qk("invalid argument. Options argument must be an object. Value: `%s`.",r));n=yk({},r)}else if(i>2){if(!pk(t))throw new TypeError(qk("invalid argument. Options argument must be an object. Value: `%s`.",t));n=yk({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new bk(v,g,n)}function o(){return new bk(r,e,n)}}wk.exports=H_e});var _k=s(function(BKe,Ek){"use strict";var Ok=require("@stdlib/utils/define-nonenumerable-read-only-property"),Sm=nf(),Z_e=hk(),Q_e=Sk();Ok(Sm,"objectMode",Z_e);Ok(Sm,"factory",Q_e);Ek.exports=Sm});var Nk=s(function(DKe,$_e){$_e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var Pk=s(function(XKe,Rk){"use strict";var K_e=require("@stdlib/assert/is-plain-object"),Ze=require("@stdlib/assert/has-own-property"),eNe=require("@stdlib/assert/is-boolean").isPrimitive,rNe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,Lk=require("@stdlib/assert/is-string").isPrimitive,tNe=require("@stdlib/assert/is-positive-integer").isPrimitive,iNe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,wn=require("@stdlib/string/format");function nNe(r,e){return K_e(e)?Ze(e,"sep")&&(r.sep=e.sep,!Lk(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,!eNe(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,!Lk(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,!rNe(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,!iNe(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,!tNe(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))}Rk.exports=nNe});var jk=s(function(YKe,Tk){"use strict";var aNe=require("debug"),sNe=aNe("random:streams:bernoulli");Tk.exports=sNe});var sf=s(function(HKe,Gk){"use strict";var Ak=require("readable-stream").Readable,uNe=require("@stdlib/assert/is-probability").isPrimitive,oNe=require("@stdlib/assert/is-error"),vNe=require("@stdlib/object/assign"),gNe=require("@stdlib/utils/inherit"),Mk=require("@stdlib/utils/define-nonenumerable-property"),hi=require("@stdlib/utils/define-nonenumerable-read-only-property"),af=require("@stdlib/utils/define-read-only-accessor"),fNe=require("@stdlib/utils/define-read-write-accessor"),dNe=an().factory,xk=require("@stdlib/buffer/from-string"),lNe=require("@stdlib/utils/next-tick"),cNe=require("@stdlib/string/format"),mNe=Nk(),hNe=Pk(),Qa=jk();function pNe(){return this._prng.seed}function yNe(){return this._prng.seedLength}function qNe(){return this._prng.stateLength}function bNe(){return this._prng.byteLength}function wNe(){return this._prng.state}function SNe(r){this._prng.state=r}function ONe(){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=xk(e):e=xk(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function ENe(r){var e;if(this._destroyed)return Qa("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,lNe(t),this;function t(){r&&(Qa("Stream was destroyed due to an error. Error: %s.",oNe(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(!uNe(r))throw new TypeError(cNe("invalid argument. First argument must be a probability. Value: `%s`.",r));if(t=vNe({},mNe),arguments.length>1&&(i=hNe(t,e),i))throw i;return Qa("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),Ak.call(this,t),Mk(this,"_destroyed",!1),hi(this,"_objectMode",t.objectMode),hi(this,"_sep",t.sep),hi(this,"_iter",t.iter),hi(this,"_siter",t.siter),Mk(this,"_i",0),hi(this,"_prng",dNe(r,t)),hi(this,"PRNG",this._prng.PRNG),this}gNe(ie,Ak);af(ie.prototype,"seed",pNe);af(ie.prototype,"seedLength",yNe);fNe(ie.prototype,"state",wNe,SNe);af(ie.prototype,"stateLength",qNe);af(ie.prototype,"byteLength",bNe);hi(ie.prototype,"_read",ONe);hi(ie.prototype,"destroy",ENe);Gk.exports=ie});var Fk=s(function(ZKe,Vk){"use strict";var _Ne=require("@stdlib/assert/is-plain-object"),NNe=require("@stdlib/string/format"),LNe=require("@stdlib/object/assign"),RNe=sf();function PNe(r,e){var t;if(arguments.length>1){if(t=e,!_Ne(t))throw new TypeError(NNe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=LNe({},e)}else t={};return t.objectMode=!0,new RNe(r,t)}Vk.exports=PNe});var Uk=s(function(QKe,Jk){"use strict";var Wk=require("@stdlib/assert/is-plain-object"),TNe=require("@stdlib/assert/is-probability").isPrimitive,Ik=require("@stdlib/string/format"),kk=require("@stdlib/object/assign"),zk=sf();function jNe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!Wk(e))throw new TypeError(Ik("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=kk({},e)}else if(t===1)if(TNe(r))n=u,i={};else{if(!Wk(r))throw new TypeError(Ik("invalid argument. Options argument must be an object. Value: `%s`.",r));i=kk({},r),n=a}else i={},n=a;return n;function a(o){return new zk(o,i)}function u(){return new zk(r,i)}}Jk.exports=jNe});var Dk=s(function($Ke,Bk){"use strict";var Ck=require("@stdlib/utils/define-nonenumerable-read-only-property"),Om=sf(),MNe=Fk(),xNe=Uk();Ck(Om,"objectMode",MNe);Ck(Om,"factory",xNe);Bk.exports=Om});var Xk=s(function(KKe,ANe){ANe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var Zk=s(function(eer,Hk){"use strict";var GNe=require("@stdlib/assert/is-plain-object"),Qe=require("@stdlib/assert/has-own-property"),VNe=require("@stdlib/assert/is-boolean").isPrimitive,FNe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,Yk=require("@stdlib/assert/is-string").isPrimitive,WNe=require("@stdlib/assert/is-positive-integer").isPrimitive,INe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Sn=require("@stdlib/string/format");function kNe(r,e){return GNe(e)?Qe(e,"sep")&&(r.sep=e.sep,!Yk(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,!VNe(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,!Yk(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,!FNe(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,!INe(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,!WNe(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))}Hk.exports=kNe});var $k=s(function(rer,Qk){"use strict";var zNe=require("debug"),JNe=zNe("random:streams:beta");Qk.exports=JNe});var of=s(function(ter,nz){"use strict";var iz=require("readable-stream").Readable,Kk=require("@stdlib/assert/is-positive-number").isPrimitive,UNe=require("@stdlib/assert/is-error"),CNe=require("@stdlib/object/assign"),BNe=require("@stdlib/utils/inherit"),ez=require("@stdlib/utils/define-nonenumerable-property"),pi=require("@stdlib/utils/define-nonenumerable-read-only-property"),uf=require("@stdlib/utils/define-read-only-accessor"),DNe=require("@stdlib/utils/define-read-write-accessor"),XNe=un().factory,rz=require("@stdlib/buffer/from-string"),YNe=require("@stdlib/utils/next-tick"),tz=require("@stdlib/string/format"),HNe=Xk(),ZNe=Zk(),$a=$k();function QNe(){return this._prng.seed}function $Ne(){return this._prng.seedLength}function KNe(){return this._prng.stateLength}function eLe(){return this._prng.byteLength}function rLe(){return this._prng.state}function tLe(r){this._prng.state=r}function iLe(){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=rz(e):e=rz(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function nLe(r){var e;if(this._destroyed)return $a("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,YNe(t),this;function t(){r&&($a("Stream was destroyed due to an error. Error: %s.",UNe(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(!Kk(r))throw new TypeError(tz("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!Kk(e))throw new TypeError(tz("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=CNe({},HNe),arguments.length>2&&(n=ZNe(i,t),n))throw n;return $a("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),iz.call(this,i),ez(this,"_destroyed",!1),pi(this,"_objectMode",i.objectMode),pi(this,"_sep",i.sep),pi(this,"_iter",i.iter),pi(this,"_siter",i.siter),ez(this,"_i",0),pi(this,"_prng",XNe(r,e,i)),pi(this,"PRNG",this._prng.PRNG),this}BNe(ne,iz);uf(ne.prototype,"seed",QNe);uf(ne.prototype,"seedLength",$Ne);DNe(ne.prototype,"state",rLe,tLe);uf(ne.prototype,"stateLength",KNe);uf(ne.prototype,"byteLength",eLe);pi(ne.prototype,"_read",iLe);pi(ne.prototype,"destroy",nLe);nz.exports=ne});var sz=s(function(ier,az){"use strict";var aLe=require("@stdlib/assert/is-plain-object"),sLe=require("@stdlib/string/format"),uLe=require("@stdlib/object/assign"),oLe=of();function vLe(r,e,t){var i;if(arguments.length>2){if(i=t,!aLe(i))throw new TypeError(sLe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=uLe({},t)}else i={};return i.objectMode=!0,new oLe(r,e,i)}az.exports=vLe});var dz=s(function(ner,fz){"use strict";var uz=require("@stdlib/assert/is-plain-object"),oz=require("@stdlib/object/assign"),vz=require("@stdlib/string/format"),gz=of();function gLe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!uz(r))throw new TypeError(vz("invalid argument. Options argument must be an object. Value: `%s`.",r));n=oz({},r)}else if(i>2){if(!uz(t))throw new TypeError(vz("invalid argument. Options argument must be an object. Value: `%s`.",t));n=oz({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new gz(v,g,n)}function o(){return new gz(r,e,n)}}fz.exports=gLe});var mz=s(function(aer,cz){"use strict";var lz=require("@stdlib/utils/define-nonenumerable-read-only-property"),Em=of(),fLe=sz(),dLe=dz();lz(Em,"objectMode",fLe);lz(Em,"factory",dLe);cz.exports=Em});var hz=s(function(ser,lLe){lLe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var qz=s(function(uer,yz){"use strict";var cLe=require("@stdlib/assert/is-plain-object"),$e=require("@stdlib/assert/has-own-property"),mLe=require("@stdlib/assert/is-boolean").isPrimitive,hLe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,pz=require("@stdlib/assert/is-string").isPrimitive,pLe=require("@stdlib/assert/is-positive-integer").isPrimitive,yLe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,On=require("@stdlib/string/format");function qLe(r,e){return cLe(e)?$e(e,"sep")&&(r.sep=e.sep,!pz(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,!mLe(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,!pz(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,!hLe(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,!yLe(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,!pLe(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))}yz.exports=qLe});var wz=s(function(oer,bz){"use strict";var bLe=require("debug"),wLe=bLe("random:streams:betaprime");bz.exports=wLe});var gf=s(function(ver,Lz){"use strict";var Nz=require("readable-stream").Readable,Sz=require("@stdlib/assert/is-positive-number").isPrimitive,SLe=require("@stdlib/assert/is-error"),OLe=require("@stdlib/object/assign"),ELe=require("@stdlib/utils/inherit"),Oz=require("@stdlib/utils/define-nonenumerable-property"),yi=require("@stdlib/utils/define-nonenumerable-read-only-property"),vf=require("@stdlib/utils/define-read-only-accessor"),_Le=require("@stdlib/utils/define-read-write-accessor"),NLe=on().factory,Ez=require("@stdlib/buffer/from-string"),LLe=require("@stdlib/utils/next-tick"),_z=require("@stdlib/string/format"),RLe=hz(),PLe=qz(),Ka=wz();function TLe(){return this._prng.seed}function jLe(){return this._prng.seedLength}function MLe(){return this._prng.stateLength}function xLe(){return this._prng.byteLength}function ALe(){return this._prng.state}function GLe(r){this._prng.state=r}function VLe(){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=Ez(e):e=Ez(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function FLe(r){var e;if(this._destroyed)return 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.",SLe(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(!Sz(r))throw new TypeError(_z("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!Sz(e))throw new TypeError(_z("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=OLe({},RLe),arguments.length>2&&(n=PLe(i,t),n))throw n;return Ka("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),Nz.call(this,i),Oz(this,"_destroyed",!1),yi(this,"_objectMode",i.objectMode),yi(this,"_sep",i.sep),yi(this,"_iter",i.iter),yi(this,"_siter",i.siter),Oz(this,"_i",0),yi(this,"_prng",NLe(r,e,i)),yi(this,"PRNG",this._prng.PRNG),this}ELe(ae,Nz);vf(ae.prototype,"seed",TLe);vf(ae.prototype,"seedLength",jLe);_Le(ae.prototype,"state",ALe,GLe);vf(ae.prototype,"stateLength",MLe);vf(ae.prototype,"byteLength",xLe);yi(ae.prototype,"_read",VLe);yi(ae.prototype,"destroy",FLe);Lz.exports=ae});var Pz=s(function(ger,Rz){"use strict";var WLe=require("@stdlib/assert/is-plain-object"),ILe=require("@stdlib/string/format"),kLe=require("@stdlib/object/assign"),zLe=gf();function JLe(r,e,t){var i;if(arguments.length>2){if(i=t,!WLe(i))throw new TypeError(ILe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=kLe({},t)}else i={};return i.objectMode=!0,new zLe(r,e,i)}Rz.exports=JLe});var Gz=s(function(fer,Az){"use strict";var Tz=require("@stdlib/assert/is-plain-object"),jz=require("@stdlib/object/assign"),Mz=require("@stdlib/string/format"),xz=gf();function ULe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!Tz(r))throw new TypeError(Mz("invalid argument. Options argument must be an object. Value: `%s`.",r));n=jz({},r)}else if(i>2){if(!Tz(t))throw new TypeError(Mz("invalid argument. Options argument must be an object. Value: `%s`.",t));n=jz({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new xz(v,g,n)}function o(){return new xz(r,e,n)}}Az.exports=ULe});var Wz=s(function(der,Fz){"use strict";var Vz=require("@stdlib/utils/define-nonenumerable-read-only-property"),_m=gf(),CLe=Pz(),BLe=Gz();Vz(_m,"objectMode",CLe);Vz(_m,"factory",BLe);Fz.exports=_m});var Iz=s(function(ler,DLe){DLe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var Jz=s(function(cer,zz){"use strict";var XLe=require("@stdlib/assert/is-plain-object"),Ke=require("@stdlib/assert/has-own-property"),YLe=require("@stdlib/assert/is-boolean").isPrimitive,HLe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,kz=require("@stdlib/assert/is-string").isPrimitive,ZLe=require("@stdlib/assert/is-positive-integer").isPrimitive,QLe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,En=require("@stdlib/string/format");function $Le(r,e){return XLe(e)?Ke(e,"sep")&&(r.sep=e.sep,!kz(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,!YLe(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,!kz(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,!HLe(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,!QLe(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,!ZLe(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))}zz.exports=$Le});var Cz=s(function(mer,Uz){"use strict";var KLe=require("debug"),eRe=KLe("random:streams:binomial");Uz.exports=eRe});var df=s(function(her,Hz){"use strict";var Yz=require("readable-stream").Readable,rRe=require("@stdlib/assert/is-positive-integer").isPrimitive,tRe=require("@stdlib/assert/is-probability").isPrimitive,iRe=require("@stdlib/assert/is-error"),nRe=require("@stdlib/object/assign"),aRe=require("@stdlib/utils/inherit"),Bz=require("@stdlib/utils/define-nonenumerable-property"),qi=require("@stdlib/utils/define-nonenumerable-read-only-property"),ff=require("@stdlib/utils/define-read-only-accessor"),sRe=require("@stdlib/utils/define-read-write-accessor"),uRe=la().factory,Dz=require("@stdlib/buffer/from-string"),oRe=require("@stdlib/utils/next-tick"),Xz=require("@stdlib/string/format"),vRe=Iz(),gRe=Jz(),es=Cz();function fRe(){return this._prng.seed}function dRe(){return this._prng.seedLength}function lRe(){return this._prng.stateLength}function cRe(){return this._prng.byteLength}function mRe(){return this._prng.state}function hRe(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 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=Dz(e):e=Dz(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function yRe(r){var e;if(this._destroyed)return es("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,oRe(t),this;function t(){r&&(es("Stream was destroyed due to an error. Error: %s.",iRe(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(!rRe(r))throw new TypeError(Xz("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!tRe(e))throw new TypeError(Xz("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(i=nRe({},vRe),arguments.length>2&&(n=gRe(i,t),n))throw n;return es("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),Yz.call(this,i),Bz(this,"_destroyed",!1),qi(this,"_objectMode",i.objectMode),qi(this,"_sep",i.sep),qi(this,"_iter",i.iter),qi(this,"_siter",i.siter),Bz(this,"_i",0),qi(this,"_prng",uRe(r,e,i)),qi(this,"PRNG",this._prng.PRNG),this}aRe(se,Yz);ff(se.prototype,"seed",fRe);ff(se.prototype,"seedLength",dRe);sRe(se.prototype,"state",mRe,hRe);ff(se.prototype,"stateLength",lRe);ff(se.prototype,"byteLength",cRe);qi(se.prototype,"_read",pRe);qi(se.prototype,"destroy",yRe);Hz.exports=se});var Qz=s(function(per,Zz){"use strict";var qRe=require("@stdlib/assert/is-plain-object"),bRe=require("@stdlib/object/assign"),wRe=require("@stdlib/string/format"),SRe=df();function ORe(r,e,t){var i;if(arguments.length>2){if(i=t,!qRe(i))throw new TypeError(wRe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=bRe({},t)}else i={};return i.objectMode=!0,new SRe(r,e,i)}Zz.exports=ORe});var i3=s(function(yer,t3){"use strict";var $z=require("@stdlib/assert/is-plain-object"),Kz=require("@stdlib/object/assign"),e3=require("@stdlib/string/format"),r3=df();function ERe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!$z(r))throw new TypeError(e3("invalid argument. Options argument must be an object. Value: `%s`.",r));n=Kz({},r)}else if(i>2){if(!$z(t))throw new TypeError(e3("invalid argument. Options argument must be an object. Value: `%s`.",t));n=Kz({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new r3(v,g,n)}function o(){return new r3(r,e,n)}}t3.exports=ERe});var s3=s(function(qer,a3){"use strict";var n3=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nm=df(),_Re=Qz(),NRe=i3();n3(Nm,"objectMode",_Re);n3(Nm,"factory",NRe);a3.exports=Nm});var u3=s(function(ber,LRe){LRe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var g3=s(function(wer,v3){"use strict";var RRe=require("@stdlib/assert/is-plain-object"),er=require("@stdlib/assert/has-own-property"),PRe=require("@stdlib/assert/is-boolean").isPrimitive,TRe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,o3=require("@stdlib/assert/is-string").isPrimitive,jRe=require("@stdlib/assert/is-positive-integer").isPrimitive,MRe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,_n=require("@stdlib/string/format");function xRe(r,e){return RRe(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,!PRe(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,!TRe(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,!MRe(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,!jRe(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))}v3.exports=xRe});var d3=s(function(Ser,f3){"use strict";var ARe=require("debug"),GRe=ARe("random:streams:box-muller");f3.exports=GRe});var cf=s(function(Oer,h3){"use strict";var m3=require("readable-stream").Readable,VRe=require("@stdlib/assert/is-error"),FRe=require("@stdlib/object/assign"),WRe=require("@stdlib/utils/inherit"),l3=require("@stdlib/utils/define-nonenumerable-property"),bi=require("@stdlib/utils/define-nonenumerable-read-only-property"),lf=require("@stdlib/utils/define-read-only-accessor"),IRe=require("@stdlib/utils/define-read-write-accessor"),kRe=Xa().factory,c3=require("@stdlib/buffer/from-string"),zRe=require("@stdlib/utils/next-tick"),JRe=u3(),URe=g3(),rs=d3();function CRe(){return this._prng.seed}function BRe(){return this._prng.seedLength}function DRe(){return this._prng.stateLength}function XRe(){return this._prng.byteLength}function YRe(){return this._prng.state}function HRe(r){this._prng.state=r}function ZRe(){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=c3(e):e=c3(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function QRe(r){var e;if(this._destroyed)return rs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,zRe(t),this;function t(){r&&(rs("Stream was destroyed due to an error. Error: %s.",VRe(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=FRe({},JRe),arguments.length>0&&(t=URe(e,r),t))throw t;return rs("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),m3.call(this,e),l3(this,"_destroyed",!1),bi(this,"_objectMode",e.objectMode),bi(this,"_sep",e.sep),bi(this,"_iter",e.iter),bi(this,"_siter",e.siter),l3(this,"_i",0),bi(this,"_prng",kRe(e)),bi(this,"PRNG",this._prng.PRNG),this}WRe(ue,m3);lf(ue.prototype,"seed",CRe);lf(ue.prototype,"seedLength",BRe);IRe(ue.prototype,"state",YRe,HRe);lf(ue.prototype,"stateLength",DRe);lf(ue.prototype,"byteLength",XRe);bi(ue.prototype,"_read",ZRe);bi(ue.prototype,"destroy",QRe);h3.exports=ue});var y3=s(function(Eer,p3){"use strict";var $Re=require("@stdlib/assert/is-plain-object"),KRe=require("@stdlib/object/assign"),ePe=require("@stdlib/string/format"),rPe=cf();function tPe(r){var e;if(arguments.length>0){if(e=r,!$Re(e))throw new TypeError(ePe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=KRe({},r)}else e={};return e.objectMode=!0,new rPe(e)}p3.exports=tPe});var b3=s(function(_er,q3){"use strict";var iPe=require("@stdlib/assert/is-plain-object"),nPe=require("@stdlib/object/assign"),aPe=require("@stdlib/string/format"),sPe=cf();function uPe(r){var e;if(arguments.length>0){if(!iPe(r))throw new TypeError(aPe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=nPe({},r)}else e={};return t;function t(){return new sPe(e)}}q3.exports=uPe});var O3=s(function(Ner,S3){"use strict";var w3=require("@stdlib/utils/define-nonenumerable-read-only-property"),Lm=cf(),oPe=y3(),vPe=b3();w3(Lm,"objectMode",oPe);w3(Lm,"factory",vPe);S3.exports=Lm});var E3=s(function(Ler,gPe){gPe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var L3=s(function(Rer,N3){"use strict";var fPe=require("@stdlib/assert/is-plain-object"),rr=require("@stdlib/assert/has-own-property"),dPe=require("@stdlib/assert/is-boolean").isPrimitive,lPe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,_3=require("@stdlib/assert/is-string").isPrimitive,cPe=require("@stdlib/assert/is-positive-integer").isPrimitive,mPe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Nn=require("@stdlib/string/format");function hPe(r,e){return fPe(e)?rr(e,"sep")&&(r.sep=e.sep,!_3(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,!dPe(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,!_3(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,!lPe(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,!mPe(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,!cPe(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))}N3.exports=hPe});var P3=s(function(Per,R3){"use strict";var pPe=require("debug"),yPe=pPe("random:streams:cauchy");R3.exports=yPe});var hf=s(function(Ter,A3){"use strict";var x3=require("readable-stream").Readable,qPe=require("@stdlib/assert/is-positive-number").isPrimitive,bPe=require("@stdlib/assert/is-number").isPrimitive,wPe=require("@stdlib/math/base/assert/is-nan"),SPe=require("@stdlib/assert/is-error"),OPe=require("@stdlib/object/assign"),EPe=require("@stdlib/utils/inherit"),T3=require("@stdlib/utils/define-nonenumerable-property"),wi=require("@stdlib/utils/define-nonenumerable-read-only-property"),mf=require("@stdlib/utils/define-read-only-accessor"),_Pe=require("@stdlib/utils/define-read-write-accessor"),NPe=ma().factory,j3=require("@stdlib/buffer/from-string"),LPe=require("@stdlib/utils/next-tick"),M3=require("@stdlib/string/format"),RPe=E3(),PPe=L3(),ts=P3();function TPe(){return this._prng.seed}function jPe(){return this._prng.seedLength}function MPe(){return this._prng.stateLength}function xPe(){return this._prng.byteLength}function APe(){return this._prng.state}function GPe(r){this._prng.state=r}function VPe(){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=j3(e):e=j3(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function FPe(r){var e;if(this._destroyed)return ts("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,LPe(t),this;function t(){r&&(ts("Stream was destroyed due to an error. Error: %s.",SPe(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(!bPe(r)||wPe(r))throw new TypeError(M3("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!qPe(e))throw new TypeError(M3("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=OPe({},RPe),arguments.length>2&&(n=PPe(i,t),n))throw n;return ts("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),x3.call(this,i),T3(this,"_destroyed",!1),wi(this,"_objectMode",i.objectMode),wi(this,"_sep",i.sep),wi(this,"_iter",i.iter),wi(this,"_siter",i.siter),T3(this,"_i",0),wi(this,"_prng",NPe(r,e,i)),wi(this,"PRNG",this._prng.PRNG),this}EPe(oe,x3);mf(oe.prototype,"seed",TPe);mf(oe.prototype,"seedLength",jPe);_Pe(oe.prototype,"state",APe,GPe);mf(oe.prototype,"stateLength",MPe);mf(oe.prototype,"byteLength",xPe);wi(oe.prototype,"_read",VPe);wi(oe.prototype,"destroy",FPe);A3.exports=oe});var V3=s(function(jer,G3){"use strict";var WPe=require("@stdlib/assert/is-plain-object"),IPe=require("@stdlib/object/assign"),kPe=require("@stdlib/string/format"),zPe=hf();function JPe(r,e,t){var i;if(arguments.length>2){if(i=t,!WPe(i))throw new TypeError(kPe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=IPe({},t)}else i={};return i.objectMode=!0,new zPe(r,e,i)}G3.exports=JPe});var J3=s(function(Mer,z3){"use strict";var F3=require("@stdlib/assert/is-plain-object"),W3=require("@stdlib/object/assign"),I3=require("@stdlib/string/format"),k3=hf();function UPe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!F3(r))throw new TypeError(I3("invalid argument. Options argument must be an object. Value: `%s`.",r));n=W3({},r)}else if(i>2){if(!F3(t))throw new TypeError(I3("invalid argument. Options argument must be an object. Value: `%s`.",t));n=W3({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new k3(v,g,n)}function o(){return new k3(r,e,n)}}z3.exports=UPe});var B3=s(function(xer,C3){"use strict";var U3=require("@stdlib/utils/define-nonenumerable-read-only-property"),Rm=hf(),CPe=V3(),BPe=J3();U3(Rm,"objectMode",CPe);U3(Rm,"factory",BPe);C3.exports=Rm});var D3=s(function(Aer,DPe){DPe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var H3=s(function(Ger,Y3){"use strict";var XPe=require("@stdlib/assert/is-plain-object"),tr=require("@stdlib/assert/has-own-property"),YPe=require("@stdlib/assert/is-boolean").isPrimitive,HPe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,X3=require("@stdlib/assert/is-string").isPrimitive,ZPe=require("@stdlib/assert/is-positive-integer").isPrimitive,QPe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ln=require("@stdlib/string/format");function $Pe(r,e){return XPe(e)?tr(e,"sep")&&(r.sep=e.sep,!X3(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,!YPe(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,!X3(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,!HPe(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,!QPe(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,!ZPe(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))}Y3.exports=$Pe});var Q3=s(function(Ver,Z3){"use strict";var KPe=require("debug"),eTe=KPe("random:streams:chi");Z3.exports=eTe});var yf=s(function(Fer,rJ){"use strict";var eJ=require("readable-stream").Readable,rTe=require("@stdlib/assert/is-positive-number").isPrimitive,tTe=require("@stdlib/assert/is-error"),iTe=require("@stdlib/object/assign"),nTe=require("@stdlib/utils/inherit"),$3=require("@stdlib/utils/define-nonenumerable-property"),Si=require("@stdlib/utils/define-nonenumerable-read-only-property"),pf=require("@stdlib/utils/define-read-only-accessor"),aTe=require("@stdlib/utils/define-read-write-accessor"),sTe=vn().factory,K3=require("@stdlib/buffer/from-string"),uTe=require("@stdlib/utils/next-tick"),oTe=require("@stdlib/string/format"),vTe=D3(),gTe=H3(),is=Q3();function fTe(){return this._prng.seed}function dTe(){return this._prng.seedLength}function lTe(){return this._prng.stateLength}function cTe(){return this._prng.byteLength}function mTe(){return this._prng.state}function hTe(r){this._prng.state=r}function pTe(){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=K3(e):e=K3(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function yTe(r){var e;if(this._destroyed)return is("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,uTe(t),this;function t(){r&&(is("Stream was destroyed due to an error. Error: %s.",tTe(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(!rTe(r))throw new TypeError(oTe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=iTe({},vTe),arguments.length>1&&(i=gTe(t,e),i))throw i;return is("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),eJ.call(this,t),$3(this,"_destroyed",!1),Si(this,"_objectMode",t.objectMode),Si(this,"_sep",t.sep),Si(this,"_iter",t.iter),Si(this,"_siter",t.siter),$3(this,"_i",0),Si(this,"_prng",sTe(r,t)),Si(this,"PRNG",this._prng.PRNG),this}nTe(ve,eJ);pf(ve.prototype,"seed",fTe);pf(ve.prototype,"seedLength",dTe);aTe(ve.prototype,"state",mTe,hTe);pf(ve.prototype,"stateLength",lTe);pf(ve.prototype,"byteLength",cTe);Si(ve.prototype,"_read",pTe);Si(ve.prototype,"destroy",yTe);rJ.exports=ve});var iJ=s(function(Wer,tJ){"use strict";var qTe=require("@stdlib/assert/is-plain-object"),bTe=require("@stdlib/object/assign"),wTe=require("@stdlib/string/format"),STe=yf();function OTe(r,e){var t;if(arguments.length>1){if(t=e,!qTe(t))throw new TypeError(wTe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=bTe({},e)}else t={};return t.objectMode=!0,new STe(r,t)}tJ.exports=OTe});var vJ=s(function(Ier,oJ){"use strict";var nJ=require("@stdlib/assert/is-plain-object"),ETe=require("@stdlib/assert/is-positive-number").isPrimitive,aJ=require("@stdlib/object/assign"),sJ=require("@stdlib/string/format"),uJ=yf();function _Te(r,e){var t,i,n;if(t=arguments.length,t>1){if(!nJ(e))throw new TypeError(sJ("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=aJ({},e)}else if(t===1)if(ETe(r))n=u,i={};else{if(!nJ(r))throw new TypeError(sJ("invalid argument. Options argument must be an object. Value: `%s`.",r));i=aJ({},r),n=a}else i={},n=a;return n;function a(o){return new uJ(o,i)}function u(){return new uJ(r,i)}}oJ.exports=_Te});var dJ=s(function(ker,fJ){"use strict";var gJ=require("@stdlib/utils/define-nonenumerable-read-only-property"),Pm=yf(),NTe=iJ(),LTe=vJ();gJ(Pm,"objectMode",NTe);gJ(Pm,"factory",LTe);fJ.exports=Pm});var lJ=s(function(zer,RTe){RTe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var hJ=s(function(Jer,mJ){"use strict";var PTe=require("@stdlib/assert/is-plain-object"),ir=require("@stdlib/assert/has-own-property"),TTe=require("@stdlib/assert/is-boolean").isPrimitive,jTe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,cJ=require("@stdlib/assert/is-string").isPrimitive,MTe=require("@stdlib/assert/is-positive-integer").isPrimitive,xTe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Rn=require("@stdlib/string/format");function ATe(r,e){return PTe(e)?ir(e,"sep")&&(r.sep=e.sep,!cJ(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,!TTe(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,!cJ(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,!jTe(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,!xTe(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,!MTe(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))}mJ.exports=ATe});var yJ=s(function(Uer,pJ){"use strict";var GTe=require("debug"),VTe=GTe("random:streams:chisquare");pJ.exports=VTe});var bf=s(function(Cer,SJ){"use strict";var wJ=require("readable-stream").Readable,FTe=require("@stdlib/assert/is-positive-number").isPrimitive,WTe=require("@stdlib/assert/is-error"),ITe=require("@stdlib/object/assign"),kTe=require("@stdlib/utils/inherit"),qJ=require("@stdlib/utils/define-nonenumerable-property"),Oi=require("@stdlib/utils/define-nonenumerable-read-only-property"),qf=require("@stdlib/utils/define-read-only-accessor"),zTe=require("@stdlib/utils/define-read-write-accessor"),JTe=Xe().factory,bJ=require("@stdlib/buffer/from-string"),UTe=require("@stdlib/utils/next-tick"),CTe=require("@stdlib/string/format"),BTe=lJ(),DTe=hJ(),ns=yJ();function XTe(){return this._prng.seed}function YTe(){return this._prng.seedLength}function HTe(){return this._prng.stateLength}function ZTe(){return this._prng.byteLength}function QTe(){return this._prng.state}function $Te(r){this._prng.state=r}function KTe(){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=bJ(e):e=bJ(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function eje(r){var e;if(this._destroyed)return ns("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,UTe(t),this;function t(){r&&(ns("Stream was destroyed due to an error. Error: %s.",WTe(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(!FTe(r))throw new TypeError(CTe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=ITe({},BTe),arguments.length>1&&(i=DTe(t,e),i))throw i;return ns("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),wJ.call(this,t),qJ(this,"_destroyed",!1),Oi(this,"_objectMode",t.objectMode),Oi(this,"_sep",t.sep),Oi(this,"_iter",t.iter),Oi(this,"_siter",t.siter),qJ(this,"_i",0),Oi(this,"_prng",JTe(r,t)),Oi(this,"PRNG",this._prng.PRNG),this}kTe(ge,wJ);qf(ge.prototype,"seed",XTe);qf(ge.prototype,"seedLength",YTe);zTe(ge.prototype,"state",QTe,$Te);qf(ge.prototype,"stateLength",HTe);qf(ge.prototype,"byteLength",ZTe);Oi(ge.prototype,"_read",KTe);Oi(ge.prototype,"destroy",eje);SJ.exports=ge});var EJ=s(function(Ber,OJ){"use strict";var rje=require("@stdlib/assert/is-plain-object"),tje=require("@stdlib/object/assign"),ije=require("@stdlib/string/format"),nje=bf();function aje(r,e){var t;if(arguments.length>1){if(t=e,!rje(t))throw new TypeError(ije("invalid argument. Options argument must be an object. Value: `%s`.",t));t=tje({},t)}else t={};return t.objectMode=!0,new nje(r,t)}OJ.exports=aje});var TJ=s(function(Der,PJ){"use strict";var sje=require("@stdlib/assert/is-positive-number").isPrimitive,_J=require("@stdlib/assert/is-plain-object"),NJ=require("@stdlib/object/assign"),LJ=require("@stdlib/string/format"),RJ=bf();function uje(r,e){var t,i,n;if(t=arguments.length,t>1){if(!_J(e))throw new TypeError(LJ("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=NJ({},e)}else if(t===1)if(sje(r))n=u,i={};else{if(!_J(r))throw new TypeError(LJ("invalid argument. Options argument must be an object. Value: `%s`.",r));i=NJ({},r),n=a}else i={},n=a;return n;function a(o){return new RJ(o,i)}function u(){return new RJ(r,i)}}PJ.exports=uje});var xJ=s(function(Xer,MJ){"use strict";var jJ=require("@stdlib/utils/define-nonenumerable-read-only-property"),Tm=bf(),oje=EJ(),vje=TJ();jJ(Tm,"objectMode",oje);jJ(Tm,"factory",vje);MJ.exports=Tm});var AJ=s(function(Yer,gje){gje.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var FJ=s(function(Her,VJ){"use strict";var fje=require("@stdlib/assert/is-plain-object"),nr=require("@stdlib/assert/has-own-property"),dje=require("@stdlib/assert/is-boolean").isPrimitive,lje=require("@stdlib/assert/is-nonnegative-number").isPrimitive,GJ=require("@stdlib/assert/is-string").isPrimitive,cje=require("@stdlib/assert/is-positive-integer").isPrimitive,mje=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Pn=require("@stdlib/string/format");function hje(r,e){return fje(e)?nr(e,"sep")&&(r.sep=e.sep,!GJ(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,!dje(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,!GJ(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,!lje(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,!mje(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,!cje(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))}VJ.exports=hje});var IJ=s(function(Zer,WJ){"use strict";var pje=require("debug"),yje=pje("random:streams:cosine");WJ.exports=yje});var Sf=s(function(Qer,CJ){"use strict";var UJ=require("readable-stream").Readable,qje=require("@stdlib/assert/is-positive-number").isPrimitive,bje=require("@stdlib/assert/is-number").isPrimitive,wje=require("@stdlib/math/base/assert/is-nan"),Sje=require("@stdlib/assert/is-error"),Oje=require("@stdlib/object/assign"),Eje=require("@stdlib/utils/inherit"),kJ=require("@stdlib/utils/define-nonenumerable-property"),Ei=require("@stdlib/utils/define-nonenumerable-read-only-property"),wf=require("@stdlib/utils/define-read-only-accessor"),_je=require("@stdlib/utils/define-read-write-accessor"),Nje=gn().factory,zJ=require("@stdlib/buffer/from-string"),Lje=require("@stdlib/utils/next-tick"),JJ=require("@stdlib/string/format"),Rje=AJ(),Pje=FJ(),as=IJ();function Tje(){return this._prng.seed}function jje(){return this._prng.seedLength}function Mje(){return this._prng.stateLength}function xje(){return this._prng.byteLength}function Aje(){return this._prng.state}function Gje(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 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=zJ(e):e=zJ(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Fje(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.",Sje(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(!bje(r)||wje(r))throw new TypeError(JJ("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!qje(e))throw new TypeError(JJ("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=Oje({},Rje),arguments.length>2&&(n=Pje(i,t),n))throw n;return as("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),UJ.call(this,i),kJ(this,"_destroyed",!1),Ei(this,"_objectMode",i.objectMode),Ei(this,"_sep",i.sep),Ei(this,"_iter",i.iter),Ei(this,"_siter",i.siter),kJ(this,"_i",0),Ei(this,"_prng",Nje(r,e,i)),Ei(this,"PRNG",this._prng.PRNG),this}Eje(fe,UJ);wf(fe.prototype,"seed",Tje);wf(fe.prototype,"seedLength",jje);_je(fe.prototype,"state",Aje,Gje);wf(fe.prototype,"stateLength",Mje);wf(fe.prototype,"byteLength",xje);Ei(fe.prototype,"_read",Vje);Ei(fe.prototype,"destroy",Fje);CJ.exports=fe});var DJ=s(function($er,BJ){"use strict";var Wje=require("@stdlib/assert/is-plain-object"),Ije=require("@stdlib/object/assign"),kje=require("@stdlib/string/format"),zje=Sf();function Jje(r,e,t){var i;if(arguments.length>2){if(i=t,!Wje(i))throw new TypeError(kje("invalid argument. Options argument must be an object. Value: `%s`.",i));i=Ije({},t)}else i={};return i.objectMode=!0,new zje(r,e,i)}BJ.exports=Jje});var $J=s(function(Ker,QJ){"use strict";var XJ=require("@stdlib/assert/is-plain-object"),YJ=require("@stdlib/object/assign"),HJ=require("@stdlib/string/format"),ZJ=Sf();function Uje(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!XJ(r))throw new TypeError(HJ("invalid argument. Options argument must be an object. Value: `%s`.",r));n=YJ({},r)}else if(i>2){if(!XJ(t))throw new TypeError(HJ("invalid argument. Options argument must be an object. Value: `%s`.",t));n=YJ({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new ZJ(v,g,n)}function o(){return new ZJ(r,e,n)}}QJ.exports=Uje});var rU=s(function(err,eU){"use strict";var KJ=require("@stdlib/utils/define-nonenumerable-read-only-property"),jm=Sf(),Cje=DJ(),Bje=$J();KJ(jm,"objectMode",Cje);KJ(jm,"factory",Bje);eU.exports=jm});var tU=s(function(rrr,Dje){Dje.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var aU=s(function(trr,nU){"use strict";var Xje=require("@stdlib/assert/is-plain-object"),ar=require("@stdlib/assert/has-own-property"),Yje=require("@stdlib/assert/is-boolean").isPrimitive,Hje=require("@stdlib/assert/is-nonnegative-number").isPrimitive,iU=require("@stdlib/assert/is-string").isPrimitive,Zje=require("@stdlib/assert/is-positive-integer").isPrimitive,Qje=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Tn=require("@stdlib/string/format");function $je(r,e){return Xje(e)?ar(e,"sep")&&(r.sep=e.sep,!iU(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,!Yje(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,!iU(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,!Hje(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,!Qje(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,!Zje(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))}nU.exports=$je});var uU=s(function(irr,sU){"use strict";var Kje=require("debug"),e0e=Kje("random:streams:discrete-uniform");sU.exports=e0e});var Ef=s(function(nrr,dU){"use strict";var fU=require("readable-stream").Readable,oU=require("@stdlib/assert/is-integer").isPrimitive,r0e=require("@stdlib/assert/is-error"),t0e=require("@stdlib/object/assign"),i0e=require("@stdlib/utils/inherit"),vU=require("@stdlib/utils/define-nonenumerable-property"),_i=require("@stdlib/utils/define-nonenumerable-read-only-property"),Of=require("@stdlib/utils/define-read-only-accessor"),n0e=require("@stdlib/utils/define-read-write-accessor"),a0e=fn().factory,gU=require("@stdlib/buffer/from-string"),s0e=require("@stdlib/utils/next-tick"),Mm=require("@stdlib/string/format"),u0e=tU(),o0e=aU(),ss=uU();function v0e(){return this._prng.seed}function g0e(){return this._prng.seedLength}function f0e(){return this._prng.stateLength}function d0e(){return this._prng.byteLength}function l0e(){return this._prng.state}function c0e(r){this._prng.state=r}function m0e(){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=gU(e):e=gU(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function h0e(r){var e;if(this._destroyed)return ss("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,s0e(t),this;function t(){r&&(ss("Stream was destroyed due to an error. Error: %s.",r0e(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(!oU(r))throw new TypeError(Mm("invalid argument. First argument must be an integer. Value: `%s`.",r));if(!oU(e))throw new TypeError(Mm("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(r>e)throw new RangeError(Mm("invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d, %d]`.",r,e));if(i=t0e({},u0e),arguments.length>2&&(n=o0e(i,t),n))throw n;return ss("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),fU.call(this,i),vU(this,"_destroyed",!1),_i(this,"_objectMode",i.objectMode),_i(this,"_sep",i.sep),_i(this,"_iter",i.iter),_i(this,"_siter",i.siter),vU(this,"_i",0),_i(this,"_prng",a0e(r,e,i)),_i(this,"PRNG",this._prng.PRNG),this}i0e(de,fU);Of(de.prototype,"seed",v0e);Of(de.prototype,"seedLength",g0e);n0e(de.prototype,"state",l0e,c0e);Of(de.prototype,"stateLength",f0e);Of(de.prototype,"byteLength",d0e);_i(de.prototype,"_read",m0e);_i(de.prototype,"destroy",h0e);dU.exports=de});var cU=s(function(arr,lU){"use strict";var p0e=require("@stdlib/assert/is-plain-object"),y0e=require("@stdlib/object/assign"),q0e=require("@stdlib/string/format"),b0e=Ef();function w0e(r,e,t){var i;if(arguments.length>2){if(i=t,!p0e(i))throw new TypeError(q0e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=y0e({},t)}else i={};return i.objectMode=!0,new b0e(r,e,i)}lU.exports=w0e});var bU=s(function(srr,qU){"use strict";var mU=require("@stdlib/assert/is-plain-object"),hU=require("@stdlib/object/assign"),pU=require("@stdlib/string/format"),yU=Ef();function S0e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!mU(r))throw new TypeError(pU("invalid argument. Options argument must be an object. Value: `%s`.",r));n=hU({},r)}else if(i>2){if(!mU(t))throw new TypeError(pU("invalid argument. Options argument must be an object. Value: `%s`.",t));n=hU({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new yU(v,g,n)}function o(){return new yU(r,e,n)}}qU.exports=S0e});var OU=s(function(urr,SU){"use strict";var wU=require("@stdlib/utils/define-nonenumerable-read-only-property"),xm=Ef(),O0e=cU(),E0e=bU();wU(xm,"objectMode",O0e);wU(xm,"factory",E0e);SU.exports=xm});var EU=s(function(orr,_0e){_0e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var LU=s(function(vrr,NU){"use strict";var N0e=require("@stdlib/assert/is-plain-object"),sr=require("@stdlib/assert/has-own-property"),L0e=require("@stdlib/assert/is-boolean").isPrimitive,R0e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,_U=require("@stdlib/assert/is-string").isPrimitive,P0e=require("@stdlib/assert/is-positive-integer").isPrimitive,T0e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,jn=require("@stdlib/string/format");function j0e(r,e){return N0e(e)?sr(e,"sep")&&(r.sep=e.sep,!_U(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,!L0e(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,!_U(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,!R0e(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,!T0e(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,!P0e(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))}NU.exports=j0e});var PU=s(function(grr,RU){"use strict";var M0e=require("debug"),x0e=M0e("random:streams:erlang");RU.exports=x0e});var Nf=s(function(frr,AU){"use strict";var xU=require("readable-stream").Readable,A0e=require("@stdlib/assert/is-positive-integer").isPrimitive,G0e=require("@stdlib/assert/is-positive-number").isPrimitive,V0e=require("@stdlib/assert/is-error"),F0e=require("@stdlib/object/assign"),W0e=require("@stdlib/utils/inherit"),TU=require("@stdlib/utils/define-nonenumerable-property"),Ni=require("@stdlib/utils/define-nonenumerable-read-only-property"),_f=require("@stdlib/utils/define-read-only-accessor"),I0e=require("@stdlib/utils/define-read-write-accessor"),k0e=ba().factory,jU=require("@stdlib/buffer/from-string"),z0e=require("@stdlib/utils/next-tick"),MU=require("@stdlib/string/format"),J0e=EU(),U0e=LU(),us=PU();function C0e(){return this._prng.seed}function B0e(){return this._prng.seedLength}function D0e(){return this._prng.stateLength}function X0e(){return this._prng.byteLength}function Y0e(){return this._prng.state}function H0e(r){this._prng.state=r}function Z0e(){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=jU(e):e=jU(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Q0e(r){var e;if(this._destroyed)return us("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,z0e(t),this;function t(){r&&(us("Stream was destroyed due to an error. Error: %s.",V0e(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(!A0e(r))throw new TypeError(MU("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!G0e(e))throw new TypeError(MU("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=F0e({},J0e),arguments.length>2&&(n=U0e(i,t),n))throw n;return us("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),xU.call(this,i),TU(this,"_destroyed",!1),Ni(this,"_objectMode",i.objectMode),Ni(this,"_sep",i.sep),Ni(this,"_iter",i.iter),Ni(this,"_siter",i.siter),TU(this,"_i",0),Ni(this,"_prng",k0e(r,e,i)),Ni(this,"PRNG",this._prng.PRNG),this}W0e(le,xU);_f(le.prototype,"seed",C0e);_f(le.prototype,"seedLength",B0e);I0e(le.prototype,"state",Y0e,H0e);_f(le.prototype,"stateLength",D0e);_f(le.prototype,"byteLength",X0e);Ni(le.prototype,"_read",Z0e);Ni(le.prototype,"destroy",Q0e);AU.exports=le});var VU=s(function(drr,GU){"use strict";var $0e=require("@stdlib/assert/is-plain-object"),K0e=require("@stdlib/object/assign"),eMe=require("@stdlib/string/format"),rMe=Nf();function tMe(r,e,t){var i;if(arguments.length>2){if(i=t,!$0e(i))throw new TypeError(eMe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=K0e({},t)}else i={};return i.objectMode=!0,new rMe(r,e,i)}GU.exports=tMe});var JU=s(function(lrr,zU){"use strict";var FU=require("@stdlib/assert/is-plain-object"),WU=require("@stdlib/object/assign"),IU=require("@stdlib/string/format"),kU=Nf();function iMe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!FU(r))throw new TypeError(IU("invalid argument. Options argument must be an object. Value: `%s`.",r));n=WU({},r)}else if(i>2){if(!FU(t))throw new TypeError(IU("invalid argument. Options argument must be an object. Value: `%s`.",t));n=WU({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new kU(v,g,n)}function o(){return new kU(r,e,n)}}zU.exports=iMe});var BU=s(function(crr,CU){"use strict";var UU=require("@stdlib/utils/define-nonenumerable-read-only-property"),Am=Nf(),nMe=VU(),aMe=JU();UU(Am,"objectMode",nMe);UU(Am,"factory",aMe);CU.exports=Am});var DU=s(function(mrr,sMe){sMe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var HU=s(function(hrr,YU){"use strict";var uMe=require("@stdlib/assert/is-plain-object"),ur=require("@stdlib/assert/has-own-property"),oMe=require("@stdlib/assert/is-boolean").isPrimitive,vMe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,XU=require("@stdlib/assert/is-string").isPrimitive,gMe=require("@stdlib/assert/is-positive-integer").isPrimitive,fMe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Mn=require("@stdlib/string/format");function dMe(r,e){return uMe(e)?ur(e,"sep")&&(r.sep=e.sep,!XU(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,!oMe(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,!XU(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,!vMe(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,!fMe(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,!gMe(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))}YU.exports=dMe});var QU=s(function(prr,ZU){"use strict";var lMe=require("debug"),cMe=lMe("random:streams:exponential");ZU.exports=cMe});var Rf=s(function(yrr,rC){"use strict";var eC=require("readable-stream").Readable,mMe=require("@stdlib/assert/is-positive-number").isPrimitive,hMe=require("@stdlib/assert/is-error"),pMe=require("@stdlib/object/assign"),yMe=require("@stdlib/utils/inherit"),$U=require("@stdlib/utils/define-nonenumerable-property"),Li=require("@stdlib/utils/define-nonenumerable-read-only-property"),Lf=require("@stdlib/utils/define-read-only-accessor"),qMe=require("@stdlib/utils/define-read-write-accessor"),bMe=dn().factory,KU=require("@stdlib/buffer/from-string"),wMe=require("@stdlib/utils/next-tick"),SMe=require("@stdlib/string/format"),OMe=DU(),EMe=HU(),os=QU();function _Me(){return this._prng.seed}function NMe(){return this._prng.seedLength}function LMe(){return this._prng.stateLength}function RMe(){return this._prng.byteLength}function PMe(){return this._prng.state}function TMe(r){this._prng.state=r}function jMe(){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=KU(e):e=KU(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function MMe(r){var e;if(this._destroyed)return os("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,wMe(t),this;function t(){r&&(os("Stream was destroyed due to an error. Error: %s.",hMe(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(!mMe(r))throw new TypeError(SMe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=pMe({},OMe),arguments.length>1&&(i=EMe(t,e),i))throw i;return os("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),eC.call(this,t),$U(this,"_destroyed",!1),Li(this,"_objectMode",t.objectMode),Li(this,"_sep",t.sep),Li(this,"_iter",t.iter),Li(this,"_siter",t.siter),$U(this,"_i",0),Li(this,"_prng",bMe(r,t)),Li(this,"PRNG",this._prng.PRNG),this}yMe(ce,eC);Lf(ce.prototype,"seed",_Me);Lf(ce.prototype,"seedLength",NMe);qMe(ce.prototype,"state",PMe,TMe);Lf(ce.prototype,"stateLength",LMe);Lf(ce.prototype,"byteLength",RMe);Li(ce.prototype,"_read",jMe);Li(ce.prototype,"destroy",MMe);rC.exports=ce});var iC=s(function(qrr,tC){"use strict";var xMe=require("@stdlib/assert/is-plain-object"),AMe=require("@stdlib/object/assign"),GMe=require("@stdlib/string/format"),VMe=Rf();function FMe(r,e){var t;if(arguments.length>1){if(t=e,!xMe(t))throw new TypeError(GMe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=AMe({},e)}else t={};return t.objectMode=!0,new VMe(r,t)}tC.exports=FMe});var vC=s(function(brr,oC){"use strict";var WMe=require("@stdlib/assert/is-positive-number").isPrimitive,nC=require("@stdlib/assert/is-plain-object"),aC=require("@stdlib/object/assign"),sC=require("@stdlib/string/format"),uC=Rf();function IMe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!nC(e))throw new TypeError(sC("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=aC({},e)}else if(t===1)if(WMe(r))n=u,i={};else{if(!nC(r))throw new TypeError(sC("invalid argument. Options argument must be an object. Value: `%s`.",r));i=aC({},r),n=a}else i={},n=a;return n;function a(o){return new uC(o,i)}function u(){return new uC(r,i)}}oC.exports=IMe});var dC=s(function(wrr,fC){"use strict";var gC=require("@stdlib/utils/define-nonenumerable-read-only-property"),Gm=Rf(),kMe=iC(),zMe=vC();gC(Gm,"objectMode",kMe);gC(Gm,"factory",zMe);fC.exports=Gm});var lC=s(function(Srr,JMe){JMe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var hC=s(function(Orr,mC){"use strict";var UMe=require("@stdlib/assert/is-plain-object"),or=require("@stdlib/assert/has-own-property"),CMe=require("@stdlib/assert/is-boolean").isPrimitive,BMe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,cC=require("@stdlib/assert/is-string").isPrimitive,DMe=require("@stdlib/assert/is-positive-integer").isPrimitive,XMe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,xn=require("@stdlib/string/format");function YMe(r,e){return UMe(e)?or(e,"sep")&&(r.sep=e.sep,!cC(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,!CMe(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,!cC(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,!BMe(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,!XMe(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,!DMe(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))}mC.exports=YMe});var yC=s(function(Err,pC){"use strict";var HMe=require("debug"),ZMe=HMe("random:streams:f");pC.exports=ZMe});var Tf=s(function(_rr,EC){"use strict";var OC=require("readable-stream").Readable,qC=require("@stdlib/assert/is-positive-number").isPrimitive,QMe=require("@stdlib/assert/is-error"),$Me=require("@stdlib/object/assign"),KMe=require("@stdlib/utils/inherit"),bC=require("@stdlib/utils/define-nonenumerable-property"),Ri=require("@stdlib/utils/define-nonenumerable-read-only-property"),Pf=require("@stdlib/utils/define-read-only-accessor"),exe=require("@stdlib/utils/define-read-write-accessor"),rxe=Sa().factory,wC=require("@stdlib/buffer/from-string"),txe=require("@stdlib/utils/next-tick"),SC=require("@stdlib/string/format"),ixe=lC(),nxe=hC(),vs=yC();function axe(){return this._prng.seed}function sxe(){return this._prng.seedLength}function uxe(){return this._prng.stateLength}function oxe(){return this._prng.byteLength}function vxe(){return this._prng.state}function gxe(r){this._prng.state=r}function fxe(){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=wC(e):e=wC(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function dxe(r){var e;if(this._destroyed)return vs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,txe(t),this;function t(){r&&(vs("Stream was destroyed due to an error. Error: %s.",QMe(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(!qC(r))throw new TypeError(SC("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!qC(e))throw new TypeError(SC("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=$Me({},ixe),arguments.length>2&&(n=nxe(i,t),n))throw n;return vs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),OC.call(this,i),bC(this,"_destroyed",!1),Ri(this,"_objectMode",i.objectMode),Ri(this,"_sep",i.sep),Ri(this,"_iter",i.iter),Ri(this,"_siter",i.siter),bC(this,"_i",0),Ri(this,"_prng",rxe(r,e,i)),Ri(this,"PRNG",this._prng.PRNG),this}KMe(me,OC);Pf(me.prototype,"seed",axe);Pf(me.prototype,"seedLength",sxe);exe(me.prototype,"state",vxe,gxe);Pf(me.prototype,"stateLength",uxe);Pf(me.prototype,"byteLength",oxe);Ri(me.prototype,"_read",fxe);Ri(me.prototype,"destroy",dxe);EC.exports=me});var NC=s(function(Nrr,_C){"use strict";var lxe=require("@stdlib/assert/is-plain-object"),cxe=require("@stdlib/object/assign"),mxe=require("@stdlib/string/format"),hxe=Tf();function pxe(r,e,t){var i;if(arguments.length>2){if(i=t,!lxe(i))throw new TypeError(mxe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=cxe({},t)}else i={};return i.objectMode=!0,new hxe(r,e,i)}_C.exports=pxe});var MC=s(function(Lrr,jC){"use strict";var LC=require("@stdlib/assert/is-plain-object"),RC=require("@stdlib/object/assign"),PC=require("@stdlib/string/format"),TC=Tf();function yxe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!LC(r))throw new TypeError(PC("invalid argument. Options argument must be an object. Value: `%s`.",r));n=RC({},r)}else if(i>2){if(!LC(t))throw new TypeError(PC("invalid argument. Options argument must be an object. Value: `%s`.",t));n=RC({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new TC(v,g,n)}function o(){return new TC(r,e,n)}}jC.exports=yxe});var GC=s(function(Rrr,AC){"use strict";var xC=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vm=Tf(),qxe=NC(),bxe=MC();xC(Vm,"objectMode",qxe);xC(Vm,"factory",bxe);AC.exports=Vm});var VC=s(function(Prr,wxe){wxe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var IC=s(function(Trr,WC){"use strict";var Sxe=require("@stdlib/assert/is-plain-object"),vr=require("@stdlib/assert/has-own-property"),Oxe=require("@stdlib/assert/is-boolean").isPrimitive,Exe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,FC=require("@stdlib/assert/is-string").isPrimitive,_xe=require("@stdlib/assert/is-positive-integer").isPrimitive,Nxe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,An=require("@stdlib/string/format");function Lxe(r,e){return Sxe(e)?vr(e,"sep")&&(r.sep=e.sep,!FC(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,!Oxe(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,!FC(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,!Exe(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,!Nxe(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,!_xe(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))}WC.exports=Lxe});var zC=s(function(jrr,kC){"use strict";var Rxe=require("debug"),Pxe=Rxe("random:streams:frechet");kC.exports=Pxe});var Mf=s(function(Mrr,DC){"use strict";var BC=require("readable-stream").Readable,JC=require("@stdlib/assert/is-positive-number"),Txe=require("@stdlib/assert/is-number").isPrimitive,jxe=require("@stdlib/math/base/assert/is-nan"),Mxe=require("@stdlib/assert/is-error"),xxe=require("@stdlib/object/assign"),Axe=require("@stdlib/utils/inherit"),UC=require("@stdlib/utils/define-nonenumerable-property"),Pi=require("@stdlib/utils/define-nonenumerable-read-only-property"),jf=require("@stdlib/utils/define-read-only-accessor"),Gxe=require("@stdlib/utils/define-read-write-accessor"),Vxe=Ea().factory,CC=require("@stdlib/buffer/from-string"),Fxe=require("@stdlib/utils/next-tick"),Fm=require("@stdlib/string/format"),Wxe=VC(),Ixe=IC(),gs=zC();function kxe(){return this._prng.seed}function zxe(){return this._prng.seedLength}function Jxe(){return this._prng.stateLength}function Uxe(){return this._prng.byteLength}function Cxe(){return this._prng.state}function Bxe(r){this._prng.state=r}function Dxe(){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=CC(e):e=CC(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,Fxe(t),this;function t(){r&&(gs("Stream was destroyed due to an error. Error: %s.",Mxe(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(!JC(r))throw new TypeError(Fm("invalid argument. First argument must be a positive number and not NaN. Value: `%s`.",r));if(!JC(e))throw new TypeError(Fm("invalid argument. Second argument must be a positive number and not NaN. Value: `%s`.",e));if(!Txe(t)||jxe(t))throw new TypeError(Fm("invalid argument. Third argument must be a number. Value: `%s`.",t));if(n=xxe({},Wxe),arguments.length>3&&(a=Ixe(n,i),a))throw a;return gs("Creating a readable stream configured with the following options: %s.",JSON.stringify(n)),BC.call(this,n),UC(this,"_destroyed",!1),Pi(this,"_objectMode",n.objectMode),Pi(this,"_sep",n.sep),Pi(this,"_iter",n.iter),Pi(this,"_siter",n.siter),UC(this,"_i",0),Pi(this,"_prng",Vxe(r,e,t,n)),Pi(this,"PRNG",this._prng.PRNG),this}Axe(he,BC);jf(he.prototype,"seed",kxe);jf(he.prototype,"seedLength",zxe);Gxe(he.prototype,"state",Cxe,Bxe);jf(he.prototype,"stateLength",Jxe);jf(he.prototype,"byteLength",Uxe);Pi(he.prototype,"_read",Dxe);Pi(he.prototype,"destroy",Xxe);DC.exports=he});var YC=s(function(xrr,XC){"use strict";var Yxe=require("@stdlib/assert/is-plain-object"),Hxe=require("@stdlib/object/assign"),Zxe=require("@stdlib/string/format"),Qxe=Mf();function $xe(r,e,t,i){var n;if(arguments.length>3){if(n=i,!Yxe(n))throw new TypeError(Zxe("invalid argument. Options argument must be an object. Value: `%s`.",n));n=Hxe({},i)}else n={};return n.objectMode=!0,new Qxe(r,e,t,n)}XC.exports=$xe});var eB=s(function(Arr,KC){"use strict";var HC=require("@stdlib/assert/is-plain-object"),ZC=require("@stdlib/object/assign"),QC=require("@stdlib/string/format"),$C=Mf();function Kxe(r,e,t,i){var n,a,u;if(n=arguments.length,n===1){if(!HC(r))throw new TypeError(QC("invalid argument. Options argument must be an object. Value: `%s`.",r));a=ZC({},r)}else if(n>3){if(!HC(i))throw new TypeError(QC("invalid argument. Options argument must be an object. Value: `%s`.",i));a=ZC({},i)}else a={};return n<3?u=o:u=v,u;function o(g,c,l){return new $C(g,c,l,a)}function v(){return new $C(r,e,t,a)}}KC.exports=Kxe});var iB=s(function(Grr,tB){"use strict";var rB=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wm=Mf(),e1e=YC(),r1e=eB();rB(Wm,"objectMode",e1e);rB(Wm,"factory",r1e);tB.exports=Wm});var nB=s(function(Vrr,t1e){t1e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var uB=s(function(Frr,sB){"use strict";var i1e=require("@stdlib/assert/is-plain-object"),gr=require("@stdlib/assert/has-own-property"),n1e=require("@stdlib/assert/is-boolean").isPrimitive,a1e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,aB=require("@stdlib/assert/is-string").isPrimitive,s1e=require("@stdlib/assert/is-positive-integer").isPrimitive,u1e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Gn=require("@stdlib/string/format");function o1e(r,e){return i1e(e)?gr(e,"sep")&&(r.sep=e.sep,!aB(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,!n1e(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,!aB(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,!a1e(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,!u1e(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,!s1e(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))}sB.exports=o1e});var vB=s(function(Wrr,oB){"use strict";var v1e=require("debug"),g1e=v1e("random:streams:gamma");oB.exports=g1e});var Af=s(function(Irr,mB){"use strict";var cB=require("readable-stream").Readable,gB=require("@stdlib/assert/is-positive-number").isPrimitive,f1e=require("@stdlib/assert/is-error"),d1e=require("@stdlib/object/assign"),l1e=require("@stdlib/utils/inherit"),fB=require("@stdlib/utils/define-nonenumerable-property"),Ti=require("@stdlib/utils/define-nonenumerable-read-only-property"),xf=require("@stdlib/utils/define-read-only-accessor"),c1e=require("@stdlib/utils/define-read-write-accessor"),m1e=Ce().factory,dB=require("@stdlib/buffer/from-string"),h1e=require("@stdlib/utils/next-tick"),lB=require("@stdlib/string/format"),p1e=nB(),y1e=uB(),fs=vB();function q1e(){return this._prng.seed}function b1e(){return this._prng.seedLength}function w1e(){return this._prng.stateLength}function S1e(){return this._prng.byteLength}function O1e(){return this._prng.state}function E1e(r){this._prng.state=r}function _1e(){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=dB(e):e=dB(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function N1e(r){var e;if(this._destroyed)return fs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,h1e(t),this;function t(){r&&(fs("Stream was destroyed due to an error. Error: %s.",f1e(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(!gB(r))throw new TypeError(lB("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!gB(e))throw new TypeError(lB("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=d1e({},p1e),arguments.length>2&&(n=y1e(i,t),n))throw n;return fs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),cB.call(this,i),fB(this,"_destroyed",!1),Ti(this,"_objectMode",i.objectMode),Ti(this,"_sep",i.sep),Ti(this,"_iter",i.iter),Ti(this,"_siter",i.siter),fB(this,"_i",0),Ti(this,"_prng",m1e(r,e,i)),Ti(this,"PRNG",this._prng.PRNG),this}l1e(pe,cB);xf(pe.prototype,"seed",q1e);xf(pe.prototype,"seedLength",b1e);c1e(pe.prototype,"state",O1e,E1e);xf(pe.prototype,"stateLength",w1e);xf(pe.prototype,"byteLength",S1e);Ti(pe.prototype,"_read",_1e);Ti(pe.prototype,"destroy",N1e);mB.exports=pe});var pB=s(function(krr,hB){"use strict";var L1e=require("@stdlib/assert/is-plain-object"),R1e=require("@stdlib/object/assign"),P1e=require("@stdlib/string/format"),T1e=Af();function j1e(r,e,t){var i;if(arguments.length>2){if(i=t,!L1e(i))throw new TypeError(P1e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=R1e({},t)}else i={};return i.objectMode=!0,new T1e(r,e,i)}hB.exports=j1e});var OB=s(function(zrr,SB){"use strict";var yB=require("@stdlib/assert/is-plain-object"),qB=require("@stdlib/object/assign"),bB=require("@stdlib/string/format"),wB=Af();function M1e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!yB(r))throw new TypeError(bB("invalid argument. Options argument must be an object. Value: `%s`.",r));n=qB({},r)}else if(i>2){if(!yB(t))throw new TypeError(bB("invalid argument. Options argument must be an object. Value: `%s`.",t));n=qB({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new wB(v,g,n)}function o(){return new wB(r,e,n)}}SB.exports=M1e});var NB=s(function(Jrr,_B){"use strict";var EB=require("@stdlib/utils/define-nonenumerable-read-only-property"),Im=Af(),x1e=pB(),A1e=OB();EB(Im,"objectMode",x1e);EB(Im,"factory",A1e);_B.exports=Im});var LB=s(function(Urr,G1e){G1e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var TB=s(function(Crr,PB){"use strict";var V1e=require("@stdlib/assert/is-plain-object"),fr=require("@stdlib/assert/has-own-property"),F1e=require("@stdlib/assert/is-boolean").isPrimitive,W1e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,RB=require("@stdlib/assert/is-string").isPrimitive,I1e=require("@stdlib/assert/is-positive-integer").isPrimitive,k1e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Vn=require("@stdlib/string/format");function z1e(r,e){return V1e(e)?fr(e,"sep")&&(r.sep=e.sep,!RB(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,!F1e(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,!RB(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,!W1e(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,!k1e(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,!I1e(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))}PB.exports=z1e});var MB=s(function(Brr,jB){"use strict";var J1e=require("debug"),U1e=J1e("random:streams:geometric");jB.exports=U1e});var Vf=s(function(Drr,VB){"use strict";var GB=require("readable-stream").Readable,C1e=require("@stdlib/assert/is-probability").isPrimitive,B1e=require("@stdlib/assert/is-error"),D1e=require("@stdlib/object/assign"),X1e=require("@stdlib/utils/inherit"),xB=require("@stdlib/utils/define-nonenumerable-property"),ji=require("@stdlib/utils/define-nonenumerable-read-only-property"),Gf=require("@stdlib/utils/define-read-only-accessor"),Y1e=require("@stdlib/utils/define-read-write-accessor"),H1e=_a().factory,AB=require("@stdlib/buffer/from-string"),Z1e=require("@stdlib/utils/next-tick"),Q1e=require("@stdlib/string/format"),$1e=LB(),K1e=TB(),ds=MB();function eAe(){return this._prng.seed}function rAe(){return this._prng.seedLength}function tAe(){return this._prng.stateLength}function iAe(){return this._prng.byteLength}function nAe(){return this._prng.state}function aAe(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 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=AB(e):e=AB(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function uAe(r){var e;if(this._destroyed)return ds("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,Z1e(t),this;function t(){r&&(ds("Stream was destroyed due to an error. Error: %s.",B1e(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(!C1e(r))throw new TypeError(Q1e("invalid argument. First argument must be a probability. Value: `%s`.",r));if(t=D1e({},$1e),arguments.length>1&&(i=K1e(t,e),i))throw i;return ds("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),GB.call(this,t),xB(this,"_destroyed",!1),ji(this,"_objectMode",t.objectMode),ji(this,"_sep",t.sep),ji(this,"_iter",t.iter),ji(this,"_siter",t.siter),xB(this,"_i",0),ji(this,"_prng",H1e(r,t)),ji(this,"PRNG",this._prng.PRNG),this}X1e(ye,GB);Gf(ye.prototype,"seed",eAe);Gf(ye.prototype,"seedLength",rAe);Y1e(ye.prototype,"state",nAe,aAe);Gf(ye.prototype,"stateLength",tAe);Gf(ye.prototype,"byteLength",iAe);ji(ye.prototype,"_read",sAe);ji(ye.prototype,"destroy",uAe);VB.exports=ye});var WB=s(function(Xrr,FB){"use strict";var oAe=require("@stdlib/assert/is-plain-object"),vAe=require("@stdlib/object/assign"),gAe=require("@stdlib/string/format"),fAe=Vf();function dAe(r,e){var t;if(arguments.length>1){if(t=e,!oAe(t))throw new TypeError(gAe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=vAe({},e)}else t={};return t.objectMode=!0,new fAe(r,t)}FB.exports=dAe});var CB=s(function(Yrr,UB){"use strict";var lAe=require("@stdlib/assert/is-probability").isPrimitive,IB=require("@stdlib/assert/is-plain-object"),kB=require("@stdlib/object/assign"),zB=require("@stdlib/string/format"),JB=Vf();function cAe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!IB(e))throw new TypeError(zB("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=kB({},e)}else if(t===1)if(lAe(r))n=u,i={};else{if(!IB(r))throw new TypeError(zB("invalid argument. Options argument must be an object. Value: `%s`.",r));i=kB({},r),n=a}else i={},n=a;return n;function a(o){return new JB(o,i)}function u(){return new JB(r,i)}}UB.exports=cAe});var XB=s(function(Hrr,DB){"use strict";var BB=require("@stdlib/utils/define-nonenumerable-read-only-property"),km=Vf(),mAe=WB(),hAe=CB();BB(km,"objectMode",mAe);BB(km,"factory",hAe);DB.exports=km});var YB=s(function(Zrr,pAe){pAe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var QB=s(function(Qrr,ZB){"use strict";var yAe=require("@stdlib/assert/is-plain-object"),dr=require("@stdlib/assert/has-own-property"),qAe=require("@stdlib/assert/is-boolean").isPrimitive,bAe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,HB=require("@stdlib/assert/is-string").isPrimitive,wAe=require("@stdlib/assert/is-positive-integer").isPrimitive,SAe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Fn=require("@stdlib/string/format");function OAe(r,e){return yAe(e)?dr(e,"sep")&&(r.sep=e.sep,!HB(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,!qAe(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,!HB(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,!bAe(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,!SAe(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,!wAe(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))}ZB.exports=OAe});var KB=s(function($rr,$B){"use strict";var EAe=require("debug"),_Ae=EAe("random:streams:gumbel");$B.exports=_Ae});var Wf=s(function(Krr,n9){"use strict";var i9=require("readable-stream").Readable,NAe=require("@stdlib/assert/is-positive-number").isPrimitive,LAe=require("@stdlib/assert/is-number").isPrimitive,RAe=require("@stdlib/math/base/assert/is-nan"),PAe=require("@stdlib/assert/is-error"),TAe=require("@stdlib/object/assign"),jAe=require("@stdlib/utils/inherit"),e9=require("@stdlib/utils/define-nonenumerable-property"),Mi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ff=require("@stdlib/utils/define-read-only-accessor"),MAe=require("@stdlib/utils/define-read-write-accessor"),xAe=Na().factory,r9=require("@stdlib/buffer/from-string"),AAe=require("@stdlib/utils/next-tick"),t9=require("@stdlib/string/format"),GAe=YB(),VAe=QB(),ls=KB();function FAe(){return this._prng.seed}function WAe(){return this._prng.seedLength}function IAe(){return this._prng.stateLength}function kAe(){return this._prng.byteLength}function zAe(){return this._prng.state}function JAe(r){this._prng.state=r}function UAe(){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=r9(e):e=r9(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function CAe(r){var e;if(this._destroyed)return ls("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,AAe(t),this;function t(){r&&(ls("Stream was destroyed due to an error. Error: %s.",PAe(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)||RAe(r))throw new TypeError(t9("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!NAe(e))throw new TypeError(t9("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=TAe({},GAe),arguments.length>2&&(n=VAe(i,t),n))throw n;return ls("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),i9.call(this,i),e9(this,"_destroyed",!1),Mi(this,"_objectMode",i.objectMode),Mi(this,"_sep",i.sep),Mi(this,"_iter",i.iter),Mi(this,"_siter",i.siter),e9(this,"_i",0),Mi(this,"_prng",xAe(r,e,i)),Mi(this,"PRNG",this._prng.PRNG),this}jAe(qe,i9);Ff(qe.prototype,"seed",FAe);Ff(qe.prototype,"seedLength",WAe);MAe(qe.prototype,"state",zAe,JAe);Ff(qe.prototype,"stateLength",IAe);Ff(qe.prototype,"byteLength",kAe);Mi(qe.prototype,"_read",UAe);Mi(qe.prototype,"destroy",CAe);n9.exports=qe});var s9=s(function(etr,a9){"use strict";var BAe=require("@stdlib/assert/is-plain-object"),DAe=require("@stdlib/object/assign"),XAe=require("@stdlib/string/format"),YAe=Wf();function HAe(r,e,t){var i;if(arguments.length>2){if(i=t,!BAe(i))throw new TypeError(XAe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=DAe({},t)}else i={};return i.objectMode=!0,new YAe(r,e,i)}a9.exports=HAe});var d9=s(function(rtr,f9){"use strict";var u9=require("@stdlib/assert/is-plain-object"),o9=require("@stdlib/object/assign"),v9=require("@stdlib/string/format"),g9=Wf();function ZAe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!u9(r))throw new TypeError(v9("invalid argument. Options argument must be an object. Value: `%s`.",r));n=o9({},r)}else if(i>2){if(!u9(t))throw new TypeError(v9("invalid argument. Options argument must be an object. Value: `%s`.",t));n=o9({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new g9(v,g,n)}function o(){return new g9(r,e,n)}}f9.exports=ZAe});var m9=s(function(ttr,c9){"use strict";var l9=require("@stdlib/utils/define-nonenumerable-read-only-property"),zm=Wf(),QAe=s9(),$Ae=d9();l9(zm,"objectMode",QAe);l9(zm,"factory",$Ae);c9.exports=zm});var h9=s(function(itr,KAe){KAe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var q9=s(function(ntr,y9){"use strict";var eGe=require("@stdlib/assert/is-plain-object"),lr=require("@stdlib/assert/has-own-property"),rGe=require("@stdlib/assert/is-boolean").isPrimitive,tGe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,p9=require("@stdlib/assert/is-string").isPrimitive,iGe=require("@stdlib/assert/is-positive-integer").isPrimitive,nGe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Wn=require("@stdlib/string/format");function aGe(r,e){return eGe(e)?lr(e,"sep")&&(r.sep=e.sep,!p9(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,!rGe(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,!p9(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,!tGe(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,!nGe(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,!iGe(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))}y9.exports=aGe});var w9=s(function(atr,b9){"use strict";var sGe=require("debug"),uGe=sGe("random:streams:hypergeometric");b9.exports=uGe});var kf=s(function(str,_9){"use strict";var E9=require("readable-stream").Readable,Jm=require("@stdlib/assert/is-nonnegative-integer"),oGe=require("@stdlib/assert/is-error"),vGe=require("@stdlib/object/assign"),gGe=require("@stdlib/utils/inherit"),S9=require("@stdlib/utils/define-nonenumerable-property"),xi=require("@stdlib/utils/define-nonenumerable-read-only-property"),If=require("@stdlib/utils/define-read-only-accessor"),fGe=require("@stdlib/utils/define-read-write-accessor"),dGe=La().factory,O9=require("@stdlib/buffer/from-string"),lGe=require("@stdlib/utils/next-tick"),Um=require("@stdlib/string/format"),cGe=h9(),mGe=q9(),cs=w9();function hGe(){return this._prng.seed}function pGe(){return this._prng.seedLength}function yGe(){return this._prng.stateLength}function qGe(){return this._prng.byteLength}function bGe(){return this._prng.state}function wGe(r){this._prng.state=r}function SGe(){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=O9(e):e=O9(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function OGe(r){var e;if(this._destroyed)return cs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,lGe(t),this;function t(){r&&(cs("Stream was destroyed due to an error. Error: %s.",oGe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),cs("Closing the stream..."),e.emit("close")}}function be(r,e,t,i){var n,a;if(!(this instanceof be))return arguments.length>3?new be(r,e,t,i):new be(r,e,t);if(!Jm(r))throw new TypeError(Um("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r));if(!Jm(e))throw new TypeError(Um("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",e));if(!Jm(t))throw new TypeError(Um("invalid argument. Third argument must be a nonnegative integer. Value: `%s`.",t));if(t>r)throw new RangeError("invalid argument. Third argument must be less than or equal to the first argument.");if(e>r)throw new RangeError("invalid argument. Second argument must be less than or equal to the first argument.");if(n=vGe({},cGe),arguments.length>3&&(a=mGe(n,i),a))throw a;return cs("Creating a readable stream configured with the following options: %s.",JSON.stringify(n)),E9.call(this,n),S9(this,"_destroyed",!1),xi(this,"_objectMode",n.objectMode),xi(this,"_sep",n.sep),xi(this,"_iter",n.iter),xi(this,"_siter",n.siter),S9(this,"_i",0),xi(this,"_prng",dGe(r,e,t,n)),xi(this,"PRNG",this._prng.PRNG),this}gGe(be,E9);If(be.prototype,"seed",hGe);If(be.prototype,"seedLength",pGe);fGe(be.prototype,"state",bGe,wGe);If(be.prototype,"stateLength",yGe);If(be.prototype,"byteLength",qGe);xi(be.prototype,"_read",SGe);xi(be.prototype,"destroy",OGe);_9.exports=be});var L9=s(function(utr,N9){"use strict";var EGe=require("@stdlib/assert/is-plain-object"),_Ge=require("@stdlib/object/assign"),NGe=require("@stdlib/string/format"),LGe=kf();function RGe(r,e,t,i){var n;if(arguments.length>3){if(n=i,!EGe(n))throw new TypeError(NGe("invalid argument. Options argument must be an object. Value: `%s`.",n));n=_Ge({},i)}else n={};return n.objectMode=!0,new LGe(r,e,t,n)}N9.exports=RGe});var x9=s(function(otr,M9){"use strict";var R9=require("@stdlib/assert/is-plain-object"),P9=require("@stdlib/object/assign"),T9=require("@stdlib/string/format"),j9=kf();function PGe(r,e,t,i){var n,a,u;if(n=arguments.length,n===1){if(!R9(r))throw new TypeError(T9("invalid argument. Options argument must be an object. Value: `%s`.",r));a=P9({},r)}else if(n>3){if(!R9(i))throw new TypeError(T9("invalid argument. Options argument must be an object. Value: `%s`.",i));a=P9({},i)}else a={};return n<3?u=o:u=v,u;function o(g,c,l){return new j9(g,c,l,a)}function v(){return new j9(r,e,t,a)}}M9.exports=PGe});var V9=s(function(vtr,G9){"use strict";var A9=require("@stdlib/utils/define-nonenumerable-read-only-property"),Cm=kf(),TGe=L9(),jGe=x9();A9(Cm,"objectMode",TGe);A9(Cm,"factory",jGe);G9.exports=Cm});var F9=s(function(gtr,MGe){MGe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var k9=s(function(ftr,I9){"use strict";var xGe=require("@stdlib/assert/is-plain-object"),cr=require("@stdlib/assert/has-own-property"),AGe=require("@stdlib/assert/is-boolean").isPrimitive,GGe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,W9=require("@stdlib/assert/is-string").isPrimitive,VGe=require("@stdlib/assert/is-positive-integer").isPrimitive,FGe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,In=require("@stdlib/string/format");function WGe(r,e){return xGe(e)?cr(e,"sep")&&(r.sep=e.sep,!W9(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,!AGe(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,!W9(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,!GGe(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,!FGe(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,!VGe(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))}I9.exports=WGe});var J9=s(function(dtr,z9){"use strict";var IGe=require("debug"),kGe=IGe("random:streams:improved-ziggurat");z9.exports=kGe});var Jf=s(function(ltr,D9){"use strict";var B9=require("readable-stream").Readable,zGe=require("@stdlib/assert/is-error"),JGe=require("@stdlib/object/assign"),UGe=require("@stdlib/utils/inherit"),U9=require("@stdlib/utils/define-nonenumerable-property"),Ai=require("@stdlib/utils/define-nonenumerable-read-only-property"),zf=require("@stdlib/utils/define-read-only-accessor"),CGe=require("@stdlib/utils/define-read-write-accessor"),BGe=Q().factory,C9=require("@stdlib/buffer/from-string"),DGe=require("@stdlib/utils/next-tick"),XGe=F9(),YGe=k9(),ms=J9();function HGe(){return this._prng.seed}function ZGe(){return this._prng.seedLength}function QGe(){return this._prng.stateLength}function $Ge(){return this._prng.byteLength}function KGe(){return this._prng.state}function eVe(r){this._prng.state=r}function rVe(){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=C9(e):e=C9(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function tVe(r){var e;if(this._destroyed)return ms("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,DGe(t),this;function t(){r&&(ms("Stream was destroyed due to an error. Error: %s.",zGe(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=JGe({},XGe),arguments.length>0&&(t=YGe(e,r),t))throw t;return ms("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),B9.call(this,e),U9(this,"_destroyed",!1),Ai(this,"_objectMode",e.objectMode),Ai(this,"_sep",e.sep),Ai(this,"_iter",e.iter),Ai(this,"_siter",e.siter),U9(this,"_i",0),Ai(this,"_prng",BGe(e)),Ai(this,"PRNG",this._prng.PRNG),this}UGe(we,B9);zf(we.prototype,"seed",HGe);zf(we.prototype,"seedLength",ZGe);CGe(we.prototype,"state",KGe,eVe);zf(we.prototype,"stateLength",QGe);zf(we.prototype,"byteLength",$Ge);Ai(we.prototype,"_read",rVe);Ai(we.prototype,"destroy",tVe);D9.exports=we});var Y9=s(function(ctr,X9){"use strict";var iVe=require("@stdlib/assert/is-plain-object"),nVe=require("@stdlib/object/assign"),aVe=require("@stdlib/string/format"),sVe=Jf();function uVe(r){var e;if(arguments.length>0){if(e=r,!iVe(e))throw new TypeError(aVe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=nVe({},r)}else e={};return e.objectMode=!0,new sVe(e)}X9.exports=uVe});var Z9=s(function(mtr,H9){"use strict";var oVe=require("@stdlib/assert/is-plain-object"),vVe=require("@stdlib/object/assign"),gVe=require("@stdlib/string/format"),fVe=Jf();function dVe(r){var e;if(arguments.length>0){if(!oVe(r))throw new TypeError(gVe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=vVe({},r)}else e={};return t;function t(){return new fVe(e)}}H9.exports=dVe});var K9=s(function(htr,$9){"use strict";var Q9=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bm=Jf(),lVe=Y9(),cVe=Z9();Q9(Bm,"objectMode",lVe);Q9(Bm,"factory",cVe);$9.exports=Bm});var eD=s(function(ptr,mVe){mVe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var iD=s(function(ytr,tD){"use strict";var hVe=require("@stdlib/assert/is-plain-object"),mr=require("@stdlib/assert/has-own-property"),pVe=require("@stdlib/assert/is-boolean").isPrimitive,yVe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,rD=require("@stdlib/assert/is-string").isPrimitive,qVe=require("@stdlib/assert/is-positive-integer").isPrimitive,bVe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,kn=require("@stdlib/string/format");function wVe(r,e){return hVe(e)?mr(e,"sep")&&(r.sep=e.sep,!rD(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,!pVe(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,!rD(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,!yVe(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,!bVe(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,!qVe(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))}tD.exports=wVe});var aD=s(function(qtr,nD){"use strict";var SVe=require("debug"),OVe=SVe("random:streams:invgamma");nD.exports=OVe});var Cf=s(function(btr,fD){"use strict";var gD=require("readable-stream").Readable,sD=require("@stdlib/assert/is-positive-number").isPrimitive,EVe=require("@stdlib/assert/is-error"),_Ve=require("@stdlib/object/assign"),NVe=require("@stdlib/utils/inherit"),uD=require("@stdlib/utils/define-nonenumerable-property"),Gi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Uf=require("@stdlib/utils/define-read-only-accessor"),LVe=require("@stdlib/utils/define-read-write-accessor"),RVe=ln().factory,oD=require("@stdlib/buffer/from-string"),PVe=require("@stdlib/utils/next-tick"),vD=require("@stdlib/string/format"),TVe=eD(),jVe=iD(),hs=aD();function MVe(){return this._prng.seed}function xVe(){return this._prng.seedLength}function AVe(){return this._prng.stateLength}function GVe(){return this._prng.byteLength}function VVe(){return this._prng.state}function FVe(r){this._prng.state=r}function WVe(){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=oD(e):e=oD(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function IVe(r){var e;if(this._destroyed)return hs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,PVe(t),this;function t(){r&&(hs("Stream was destroyed due to an error. Error: %s.",EVe(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(!sD(r))throw new TypeError(vD("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!sD(e))throw new TypeError(vD("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=_Ve({},TVe),arguments.length>2&&(n=jVe(i,t),n))throw n;return hs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),gD.call(this,i),uD(this,"_destroyed",!1),Gi(this,"_objectMode",i.objectMode),Gi(this,"_sep",i.sep),Gi(this,"_iter",i.iter),Gi(this,"_siter",i.siter),uD(this,"_i",0),Gi(this,"_prng",RVe(r,e,i)),Gi(this,"PRNG",this._prng.PRNG),this}NVe(Se,gD);Uf(Se.prototype,"seed",MVe);Uf(Se.prototype,"seedLength",xVe);LVe(Se.prototype,"state",VVe,FVe);Uf(Se.prototype,"stateLength",AVe);Uf(Se.prototype,"byteLength",GVe);Gi(Se.prototype,"_read",WVe);Gi(Se.prototype,"destroy",IVe);fD.exports=Se});var lD=s(function(wtr,dD){"use strict";var kVe=require("@stdlib/assert/is-plain-object"),zVe=require("@stdlib/object/assign"),JVe=require("@stdlib/string/format"),UVe=Cf();function CVe(r,e,t){var i;if(arguments.length>2){if(i=t,!kVe(i))throw new TypeError(JVe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=zVe({},t)}else i={};return i.objectMode=!0,new UVe(r,e,i)}dD.exports=CVe});var qD=s(function(Str,yD){"use strict";var cD=require("@stdlib/assert/is-plain-object"),mD=require("@stdlib/object/assign"),hD=require("@stdlib/string/format"),pD=Cf();function BVe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!cD(r))throw new TypeError(hD("invalid argument. Options argument must be an object. Value: `%s`.",r));n=mD({},r)}else if(i>2){if(!cD(t))throw new TypeError(hD("invalid argument. Options argument must be an object. Value: `%s`.",t));n=mD({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new pD(v,g,n)}function o(){return new pD(r,e,n)}}yD.exports=BVe});var SD=s(function(Otr,wD){"use strict";var bD=require("@stdlib/utils/define-nonenumerable-read-only-property"),Dm=Cf(),DVe=lD(),XVe=qD();bD(Dm,"objectMode",DVe);bD(Dm,"factory",XVe);wD.exports=Dm});var OD=s(function(Etr,YVe){YVe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var ND=s(function(_tr,_D){"use strict";var HVe=require("@stdlib/assert/is-plain-object"),hr=require("@stdlib/assert/has-own-property"),ZVe=require("@stdlib/assert/is-boolean").isPrimitive,QVe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,ED=require("@stdlib/assert/is-string").isPrimitive,$Ve=require("@stdlib/assert/is-positive-integer").isPrimitive,KVe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,zn=require("@stdlib/string/format");function e2e(r,e){return HVe(e)?hr(e,"sep")&&(r.sep=e.sep,!ED(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,!ZVe(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,!ED(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,!QVe(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,!KVe(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,!$Ve(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))}_D.exports=e2e});var RD=s(function(Ntr,LD){"use strict";var r2e=require("debug"),t2e=r2e("random:streams:kumaraswamy");LD.exports=t2e});var Df=s(function(Ltr,AD){"use strict";var xD=require("readable-stream").Readable,PD=require("@stdlib/assert/is-positive-number").isPrimitive,i2e=require("@stdlib/assert/is-error"),n2e=require("@stdlib/object/assign"),a2e=require("@stdlib/utils/inherit"),TD=require("@stdlib/utils/define-nonenumerable-property"),Vi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bf=require("@stdlib/utils/define-read-only-accessor"),s2e=require("@stdlib/utils/define-read-write-accessor"),u2e=Pa().factory,jD=require("@stdlib/buffer/from-string"),o2e=require("@stdlib/utils/next-tick"),MD=require("@stdlib/string/format"),v2e=OD(),g2e=ND(),ps=RD();function f2e(){return this._prng.seed}function d2e(){return this._prng.seedLength}function l2e(){return this._prng.stateLength}function c2e(){return this._prng.byteLength}function m2e(){return this._prng.state}function h2e(r){this._prng.state=r}function p2e(){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=jD(e):e=jD(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function y2e(r){var e;if(this._destroyed)return ps("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,o2e(t),this;function t(){r&&(ps("Stream was destroyed due to an error. Error: %s.",i2e(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(!PD(r))throw new TypeError(MD("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!PD(e))throw new TypeError(MD("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=n2e({},v2e),arguments.length>2&&(n=g2e(i,t),n))throw n;return ps("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),xD.call(this,i),TD(this,"_destroyed",!1),Vi(this,"_objectMode",i.objectMode),Vi(this,"_sep",i.sep),Vi(this,"_iter",i.iter),Vi(this,"_siter",i.siter),TD(this,"_i",0),Vi(this,"_prng",u2e(r,e,i)),Vi(this,"PRNG",this._prng.PRNG),this}a2e(Oe,xD);Bf(Oe.prototype,"seed",f2e);Bf(Oe.prototype,"seedLength",d2e);s2e(Oe.prototype,"state",m2e,h2e);Bf(Oe.prototype,"stateLength",l2e);Bf(Oe.prototype,"byteLength",c2e);Vi(Oe.prototype,"_read",p2e);Vi(Oe.prototype,"destroy",y2e);AD.exports=Oe});var VD=s(function(Rtr,GD){"use strict";var q2e=require("@stdlib/assert/is-plain-object"),b2e=require("@stdlib/object/assign"),w2e=require("@stdlib/string/format"),S2e=Df();function O2e(r,e,t){var i;if(arguments.length>2){if(i=t,!q2e(i))throw new TypeError(w2e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=b2e({},t)}else i={};return i.objectMode=!0,new S2e(r,e,i)}GD.exports=O2e});var JD=s(function(Ptr,zD){"use strict";var FD=require("@stdlib/assert/is-plain-object"),WD=require("@stdlib/object/assign"),ID=require("@stdlib/string/format"),kD=Df();function E2e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!FD(r))throw new TypeError(ID("invalid argument. Options argument must be an object. Value: `%s`.",r));n=WD({},r)}else if(i>2){if(!FD(t))throw new TypeError(ID("invalid argument. Options argument must be an object. Value: `%s`.",t));n=WD({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new kD(v,g,n)}function o(){return new kD(r,e,n)}}zD.exports=E2e});var BD=s(function(Ttr,CD){"use strict";var UD=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xm=Df(),_2e=VD(),N2e=JD();UD(Xm,"objectMode",_2e);UD(Xm,"factory",N2e);CD.exports=Xm});var DD=s(function(jtr,L2e){L2e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var HD=s(function(Mtr,YD){"use strict";var R2e=require("@stdlib/assert/is-plain-object"),pr=require("@stdlib/assert/has-own-property"),P2e=require("@stdlib/assert/is-boolean").isPrimitive,T2e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,XD=require("@stdlib/assert/is-string").isPrimitive,j2e=require("@stdlib/assert/is-positive-integer").isPrimitive,M2e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Jn=require("@stdlib/string/format");function x2e(r,e){return R2e(e)?pr(e,"sep")&&(r.sep=e.sep,!XD(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,!P2e(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,!XD(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,!T2e(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,!M2e(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,!j2e(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))}YD.exports=x2e});var QD=s(function(xtr,ZD){"use strict";var A2e=require("debug"),G2e=A2e("random:streams:laplace");ZD.exports=G2e});var Yf=s(function(Atr,t8){"use strict";var r8=require("readable-stream").Readable,V2e=require("@stdlib/assert/is-positive-number").isPrimitive,F2e=require("@stdlib/assert/is-number").isPrimitive,W2e=require("@stdlib/math/base/assert/is-nan"),I2e=require("@stdlib/assert/is-error"),k2e=require("@stdlib/object/assign"),z2e=require("@stdlib/utils/inherit"),$D=require("@stdlib/utils/define-nonenumerable-property"),Fi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xf=require("@stdlib/utils/define-read-only-accessor"),J2e=require("@stdlib/utils/define-read-write-accessor"),U2e=Ta().factory,KD=require("@stdlib/buffer/from-string"),e8=require("@stdlib/string/format"),C2e=require("@stdlib/utils/next-tick"),B2e=DD(),D2e=HD(),ys=QD();function X2e(){return this._prng.seed}function Y2e(){return this._prng.seedLength}function H2e(){return this._prng.stateLength}function Z2e(){return this._prng.byteLength}function Q2e(){return this._prng.state}function $2e(r){this._prng.state=r}function K2e(){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=KD(e):e=KD(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function eFe(r){var e;if(this._destroyed)return ys("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,C2e(t),this;function t(){r&&(ys("Stream was destroyed due to an error. Error: %s.",I2e(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(!F2e(r)||W2e(r))throw new TypeError(e8("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!V2e(e))throw new TypeError(e8("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=k2e({},B2e),arguments.length>2&&(n=D2e(i,t),n))throw n;return ys("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),r8.call(this,i),$D(this,"_destroyed",!1),Fi(this,"_objectMode",i.objectMode),Fi(this,"_sep",i.sep),Fi(this,"_iter",i.iter),Fi(this,"_siter",i.siter),$D(this,"_i",0),Fi(this,"_prng",U2e(r,e,i)),Fi(this,"PRNG",this._prng.PRNG),this}z2e(Ee,r8);Xf(Ee.prototype,"seed",X2e);Xf(Ee.prototype,"seedLength",Y2e);J2e(Ee.prototype,"state",Q2e,$2e);Xf(Ee.prototype,"stateLength",H2e);Xf(Ee.prototype,"byteLength",Z2e);Fi(Ee.prototype,"_read",K2e);Fi(Ee.prototype,"destroy",eFe);t8.exports=Ee});var n8=s(function(Gtr,i8){"use strict";var rFe=require("@stdlib/assert/is-plain-object"),tFe=require("@stdlib/object/assign"),iFe=require("@stdlib/string/format"),nFe=Yf();function aFe(r,e,t){var i;if(arguments.length>2){if(i=t,!rFe(i))throw new TypeError(iFe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=tFe({},t)}else i={};return i.objectMode=!0,new nFe(r,e,i)}i8.exports=aFe});var g8=s(function(Vtr,v8){"use strict";var a8=require("@stdlib/assert/is-plain-object"),s8=require("@stdlib/object/assign"),u8=require("@stdlib/string/format"),o8=Yf();function sFe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!a8(r))throw new TypeError(u8("invalid argument. Options argument must be an object. Value: `%s`.",r));n=s8({},r)}else if(i>2){if(!a8(t))throw new TypeError(u8("invalid argument. Options argument must be an object. Value: `%s`.",t));n=s8({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new o8(v,g,n)}function o(){return new o8(r,e,n)}}v8.exports=sFe});var l8=s(function(Ftr,d8){"use strict";var f8=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ym=Yf(),uFe=n8(),oFe=g8();f8(Ym,"objectMode",uFe);f8(Ym,"factory",oFe);d8.exports=Ym});var c8=s(function(Wtr,vFe){vFe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var p8=s(function(Itr,h8){"use strict";var gFe=require("@stdlib/assert/is-plain-object"),yr=require("@stdlib/assert/has-own-property"),fFe=require("@stdlib/assert/is-boolean").isPrimitive,dFe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,m8=require("@stdlib/assert/is-string").isPrimitive,lFe=require("@stdlib/assert/is-positive-integer").isPrimitive,cFe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Un=require("@stdlib/string/format");function mFe(r,e){return gFe(e)?yr(e,"sep")&&(r.sep=e.sep,!m8(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,!fFe(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,!m8(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,!dFe(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,!cFe(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,!lFe(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))}h8.exports=mFe});var q8=s(function(ktr,y8){"use strict";var hFe=require("debug"),pFe=hFe("random:streams:levy");y8.exports=pFe});var Zf=s(function(ztr,E8){"use strict";var O8=require("readable-stream").Readable,yFe=require("@stdlib/assert/is-positive-number").isPrimitive,qFe=require("@stdlib/assert/is-number").isPrimitive,bFe=require("@stdlib/math/base/assert/is-nan"),wFe=require("@stdlib/assert/is-error"),SFe=require("@stdlib/object/assign"),OFe=require("@stdlib/utils/inherit"),b8=require("@stdlib/utils/define-nonenumerable-property"),Wi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hf=require("@stdlib/utils/define-read-only-accessor"),EFe=require("@stdlib/utils/define-read-write-accessor"),_Fe=ja().factory,w8=require("@stdlib/buffer/from-string"),NFe=require("@stdlib/utils/next-tick"),S8=require("@stdlib/string/format"),LFe=c8(),RFe=p8(),qs=q8();function PFe(){return this._prng.seed}function TFe(){return this._prng.seedLength}function jFe(){return this._prng.stateLength}function MFe(){return this._prng.byteLength}function xFe(){return this._prng.state}function AFe(r){this._prng.state=r}function GFe(){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=w8(e):e=w8(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function VFe(r){var e;if(this._destroyed)return qs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,NFe(t),this;function t(){r&&(qs("Stream was destroyed due to an error. Error: %s.",wFe(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(!qFe(r)||bFe(r))throw new TypeError(S8("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!yFe(e))throw new TypeError(S8("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=SFe({},LFe),arguments.length>2&&(n=RFe(i,t),n))throw n;return qs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),O8.call(this,i),b8(this,"_destroyed",!1),Wi(this,"_objectMode",i.objectMode),Wi(this,"_sep",i.sep),Wi(this,"_iter",i.iter),Wi(this,"_siter",i.siter),b8(this,"_i",0),Wi(this,"_prng",_Fe(r,e,i)),Wi(this,"PRNG",this._prng.PRNG),this}OFe(_e,O8);Hf(_e.prototype,"seed",PFe);Hf(_e.prototype,"seedLength",TFe);EFe(_e.prototype,"state",xFe,AFe);Hf(_e.prototype,"stateLength",jFe);Hf(_e.prototype,"byteLength",MFe);Wi(_e.prototype,"_read",GFe);Wi(_e.prototype,"destroy",VFe);E8.exports=_e});var N8=s(function(Jtr,_8){"use strict";var FFe=require("@stdlib/assert/is-plain-object"),WFe=require("@stdlib/object/assign"),IFe=require("@stdlib/string/format"),kFe=Zf();function zFe(r,e,t){var i;if(arguments.length>2){if(i=t,!FFe(i))throw new TypeError(IFe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=WFe({},t)}else i={};return i.objectMode=!0,new kFe(r,e,i)}_8.exports=zFe});var M8=s(function(Utr,j8){"use strict";var L8=require("@stdlib/assert/is-plain-object"),R8=require("@stdlib/object/assign"),P8=require("@stdlib/string/format"),T8=Zf();function JFe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!L8(r))throw new TypeError(P8("invalid argument. Options argument must be an object. Value: `%s`.",r));n=R8({},r)}else if(i>2){if(!L8(t))throw new TypeError(P8("invalid argument. Options argument must be an object. Value: `%s`.",t));n=R8({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new T8(v,g,n)}function o(){return new T8(r,e,n)}}j8.exports=JFe});var G8=s(function(Ctr,A8){"use strict";var x8=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hm=Zf(),UFe=N8(),CFe=M8();x8(Hm,"objectMode",UFe);x8(Hm,"factory",CFe);A8.exports=Hm});var V8=s(function(Btr,BFe){BFe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var I8=s(function(Dtr,W8){"use strict";var DFe=require("@stdlib/assert/is-plain-object"),qr=require("@stdlib/assert/has-own-property"),XFe=require("@stdlib/assert/is-boolean").isPrimitive,YFe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,F8=require("@stdlib/assert/is-string").isPrimitive,HFe=require("@stdlib/assert/is-positive-integer").isPrimitive,ZFe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Cn=require("@stdlib/string/format");function QFe(r,e){return DFe(e)?qr(e,"sep")&&(r.sep=e.sep,!F8(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,!XFe(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,!F8(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,!YFe(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,!ZFe(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,!HFe(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))}W8.exports=QFe});var z8=s(function(Xtr,k8){"use strict";var $Fe=require("debug"),KFe=$Fe("random:streams:logistic");k8.exports=KFe});var $f=s(function(Ytr,D8){"use strict";var B8=require("readable-stream").Readable,eWe=require("@stdlib/assert/is-positive-number").isPrimitive,rWe=require("@stdlib/assert/is-number").isPrimitive,tWe=require("@stdlib/math/base/assert/is-nan"),iWe=require("@stdlib/assert/is-error"),nWe=require("@stdlib/object/assign"),aWe=require("@stdlib/utils/inherit"),J8=require("@stdlib/utils/define-nonenumerable-property"),Ii=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qf=require("@stdlib/utils/define-read-only-accessor"),sWe=require("@stdlib/utils/define-read-write-accessor"),uWe=Ma().factory,U8=require("@stdlib/buffer/from-string"),oWe=require("@stdlib/utils/next-tick"),C8=require("@stdlib/string/format"),vWe=V8(),gWe=I8(),bs=z8();function fWe(){return this._prng.seed}function dWe(){return this._prng.seedLength}function lWe(){return this._prng.stateLength}function cWe(){return this._prng.byteLength}function mWe(){return this._prng.state}function hWe(r){this._prng.state=r}function pWe(){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=U8(e):e=U8(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function yWe(r){var e;if(this._destroyed)return bs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,oWe(t),this;function t(){r&&(bs("Stream was destroyed due to an error. Error: %s.",iWe(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(!rWe(r)||tWe(r))throw new TypeError(C8("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!eWe(e))throw new TypeError(C8("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=nWe({},vWe),arguments.length>2&&(n=gWe(i,t),n))throw n;return bs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),B8.call(this,i),J8(this,"_destroyed",!1),Ii(this,"_objectMode",i.objectMode),Ii(this,"_sep",i.sep),Ii(this,"_iter",i.iter),Ii(this,"_siter",i.siter),J8(this,"_i",0),Ii(this,"_prng",uWe(r,e,i)),Ii(this,"PRNG",this._prng.PRNG),this}aWe(Ne,B8);Qf(Ne.prototype,"seed",fWe);Qf(Ne.prototype,"seedLength",dWe);sWe(Ne.prototype,"state",mWe,hWe);Qf(Ne.prototype,"stateLength",lWe);Qf(Ne.prototype,"byteLength",cWe);Ii(Ne.prototype,"_read",pWe);Ii(Ne.prototype,"destroy",yWe);D8.exports=Ne});var Y8=s(function(Htr,X8){"use strict";var qWe=require("@stdlib/assert/is-plain-object"),bWe=require("@stdlib/object/assign"),wWe=require("@stdlib/string/format"),SWe=$f();function OWe(r,e,t){var i;if(arguments.length>2){if(i=t,!qWe(i))throw new TypeError(wWe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=bWe({},t)}else i={};return i.objectMode=!0,new SWe(r,e,i)}X8.exports=OWe});var eX=s(function(Ztr,K8){"use strict";var H8=require("@stdlib/assert/is-plain-object"),Z8=require("@stdlib/object/assign"),Q8=require("@stdlib/string/format"),$8=$f();function EWe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!H8(r))throw new TypeError(Q8("invalid argument. Options argument must be an object. Value: `%s`.",r));n=Z8({},r)}else if(i>2){if(!H8(t))throw new TypeError(Q8("invalid argument. Options argument must be an object. Value: `%s`.",t));n=Z8({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new $8(v,g,n)}function o(){return new $8(r,e,n)}}K8.exports=EWe});var iX=s(function(Qtr,tX){"use strict";var rX=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zm=$f(),_We=Y8(),NWe=eX();rX(Zm,"objectMode",_We);rX(Zm,"factory",NWe);tX.exports=Zm});var nX=s(function($tr,LWe){LWe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var uX=s(function(Ktr,sX){"use strict";var RWe=require("@stdlib/assert/is-plain-object"),br=require("@stdlib/assert/has-own-property"),PWe=require("@stdlib/assert/is-boolean").isPrimitive,TWe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,aX=require("@stdlib/assert/is-string").isPrimitive,jWe=require("@stdlib/assert/is-positive-integer").isPrimitive,MWe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Bn=require("@stdlib/string/format");function xWe(r,e){return RWe(e)?br(e,"sep")&&(r.sep=e.sep,!aX(r.sep))?new TypeError(Bn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):br(e,"objectMode")&&(r.objectMode=e.objectMode,!PWe(r.objectMode))?new TypeError(Bn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):br(e,"encoding")&&(r.encoding=e.encoding,!aX(r.encoding)&&r.encoding!==null)?new TypeError(Bn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):br(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!TWe(r.highWaterMark))?new TypeError(Bn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):br(e,"iter")&&(r.iter=e.iter,!MWe(r.iter))?new TypeError(Bn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):br(e,"siter")&&(r.siter=e.siter,!jWe(r.siter))?new TypeError(Bn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(br(e,"prng")&&(r.prng=e.prng),br(e,"seed")&&(r.seed=e.seed),br(e,"state")&&(r.state=e.state),br(e,"copy")&&(r.copy=e.copy),null):new TypeError(Bn("invalid argument. Options argument must be an object. Value: `%s`.",e))}sX.exports=xWe});var vX=s(function(eir,oX){"use strict";var AWe=require("debug"),GWe=AWe("random:streams:lognormal");oX.exports=GWe});var ed=s(function(rir,cX){"use strict";var lX=require("readable-stream").Readable,VWe=require("@stdlib/assert/is-positive-number").isPrimitive,FWe=require("@stdlib/assert/is-number").isPrimitive,WWe=require("@stdlib/math/base/assert/is-nan"),IWe=require("@stdlib/assert/is-error"),kWe=require("@stdlib/object/assign"),zWe=require("@stdlib/utils/inherit"),gX=require("@stdlib/utils/define-nonenumerable-property"),ki=require("@stdlib/utils/define-nonenumerable-read-only-property"),Kf=require("@stdlib/utils/define-read-only-accessor"),JWe=require("@stdlib/utils/define-read-write-accessor"),UWe=cn().factory,fX=require("@stdlib/buffer/from-string"),CWe=require("@stdlib/utils/next-tick"),dX=require("@stdlib/string/format"),BWe=nX(),DWe=uX(),ws=vX();function XWe(){return this._prng.seed}function YWe(){return this._prng.seedLength}function HWe(){return this._prng.stateLength}function ZWe(){return this._prng.byteLength}function QWe(){return this._prng.state}function $We(r){this._prng.state=r}function KWe(){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=fX(e):e=fX(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function eIe(r){var e;if(this._destroyed)return ws("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,CWe(t),this;function t(){r&&(ws("Stream was destroyed due to an error. Error: %s.",IWe(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(!FWe(r)||WWe(r))throw new TypeError(dX("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!VWe(e))throw new TypeError(dX("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=kWe({},BWe),arguments.length>2&&(n=DWe(i,t),n))throw n;return ws("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),lX.call(this,i),gX(this,"_destroyed",!1),ki(this,"_objectMode",i.objectMode),ki(this,"_sep",i.sep),ki(this,"_iter",i.iter),ki(this,"_siter",i.siter),gX(this,"_i",0),ki(this,"_prng",UWe(r,e,i)),ki(this,"PRNG",this._prng.PRNG),this}zWe(Le,lX);Kf(Le.prototype,"seed",XWe);Kf(Le.prototype,"seedLength",YWe);JWe(Le.prototype,"state",QWe,$We);Kf(Le.prototype,"stateLength",HWe);Kf(Le.prototype,"byteLength",ZWe);ki(Le.prototype,"_read",KWe);ki(Le.prototype,"destroy",eIe);cX.exports=Le});var hX=s(function(tir,mX){"use strict";var rIe=require("@stdlib/assert/is-plain-object"),tIe=require("@stdlib/object/assign"),iIe=require("@stdlib/string/format"),nIe=ed();function aIe(r,e,t){var i;if(arguments.length>2){if(i=t,!rIe(i))throw new TypeError(iIe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=tIe({},t)}else i={};return i.objectMode=!0,new nIe(r,e,i)}mX.exports=aIe});var SX=s(function(iir,wX){"use strict";var pX=require("@stdlib/assert/is-plain-object"),yX=require("@stdlib/object/assign"),qX=require("@stdlib/string/format"),bX=ed();function sIe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!pX(r))throw new TypeError(qX("invalid argument. Options argument must be an object. Value: `%s`.",r));n=yX({},r)}else if(i>2){if(!pX(t))throw new TypeError(qX("invalid argument. Options argument must be an object. Value: `%s`.",t));n=yX({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new bX(v,g,n)}function o(){return new bX(r,e,n)}}wX.exports=sIe});var _X=s(function(nir,EX){"use strict";var OX=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qm=ed(),uIe=hX(),oIe=SX();OX(Qm,"objectMode",uIe);OX(Qm,"factory",oIe);EX.exports=Qm});var NX=s(function(air,vIe){vIe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,normalized:!1}});var TX=s(function(sir,PX){"use strict";var gIe=require("@stdlib/assert/is-plain-object"),wr=require("@stdlib/assert/has-own-property"),LX=require("@stdlib/assert/is-boolean").isPrimitive,fIe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,RX=require("@stdlib/assert/is-string").isPrimitive,dIe=require("@stdlib/assert/is-positive-integer").isPrimitive,lIe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,zi=require("@stdlib/string/format");function cIe(r,e){return gIe(e)?wr(e,"sep")&&(r.sep=e.sep,!RX(r.sep))?new TypeError(zi("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):wr(e,"objectMode")&&(r.objectMode=e.objectMode,!LX(r.objectMode))?new TypeError(zi("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):wr(e,"encoding")&&(r.encoding=e.encoding,!RX(r.encoding)&&r.encoding!==null)?new TypeError(zi("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):wr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!fIe(r.highWaterMark))?new TypeError(zi("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):wr(e,"iter")&&(r.iter=e.iter,!lIe(r.iter))?new TypeError(zi("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):wr(e,"siter")&&(r.siter=e.siter,!dIe(r.siter))?new TypeError(zi("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):wr(e,"normalized")&&(r.normalized=e.normalized,!LX(r.normalized))?new TypeError(zi("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",r.normalized)):(wr(e,"seed")&&(r.seed=e.seed),wr(e,"state")&&(r.state=e.state),wr(e,"copy")&&(r.copy=e.copy),null):new TypeError(zi("invalid argument. Options argument must be an object. Value: `%s`.",e))}PX.exports=cIe});var MX=s(function(uir,jX){"use strict";var mIe=require("debug"),hIe=mIe("random:streams:minstd");jX.exports=hIe});var td=s(function(oir,VX){"use strict";var GX=require("readable-stream").Readable,pIe=require("@stdlib/assert/is-error"),yIe=require("@stdlib/object/assign"),qIe=require("@stdlib/utils/inherit"),xX=require("@stdlib/utils/define-nonenumerable-property"),Dn=require("@stdlib/utils/define-nonenumerable-read-only-property"),rd=require("@stdlib/utils/define-read-only-accessor"),bIe=require("@stdlib/utils/define-read-write-accessor"),wIe=$().factory,AX=require("@stdlib/buffer/from-string"),SIe=require("@stdlib/utils/next-tick"),OIe=NX(),EIe=TX(),Ss=MX();function _Ie(){return this._prng.seed}function NIe(){return this._prng.seedLength}function LIe(){return this._prng.stateLength}function RIe(){return this._prng.byteLength}function PIe(){return this._prng.state}function TIe(r){this._prng.state=r}function jIe(){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=AX(e):e=AX(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function MIe(r){var e;if(this._destroyed)return Ss("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,SIe(t),this;function t(){r&&(Ss("Stream was destroyed due to an error. Error: %s.",pIe(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=yIe({},OIe),arguments.length>0&&(i=EIe(t,r),i))throw i;return Ss("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),GX.call(this,t),xX(this,"_destroyed",!1),Dn(this,"_objectMode",t.objectMode),Dn(this,"_sep",t.sep),Dn(this,"_iter",t.iter),Dn(this,"_siter",t.siter),xX(this,"_i",0),e=wIe(t),t.normalized&&(e=e.normalized),Dn(this,"_prng",e),this}qIe(Re,GX);rd(Re.prototype,"seed",_Ie);rd(Re.prototype,"seedLength",NIe);bIe(Re.prototype,"state",PIe,TIe);rd(Re.prototype,"stateLength",LIe);rd(Re.prototype,"byteLength",RIe);Dn(Re.prototype,"_read",jIe);Dn(Re.prototype,"destroy",MIe);VX.exports=Re});var WX=s(function(vir,FX){"use strict";var xIe=require("@stdlib/assert/is-plain-object"),AIe=require("@stdlib/object/assign"),GIe=require("@stdlib/string/format"),VIe=td();function FIe(r){var e;if(arguments.length>0){if(e=r,!xIe(e))throw new TypeError(GIe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=AIe({},r)}else e={};return e.objectMode=!0,new VIe(e)}FX.exports=FIe});var kX=s(function(gir,IX){"use strict";var WIe=require("@stdlib/assert/is-plain-object"),IIe=require("@stdlib/object/assign"),kIe=require("@stdlib/string/format"),zIe=td();function JIe(r){var e;if(arguments.length>0){if(!WIe(r))throw new TypeError(kIe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=IIe({},r)}else e={};return t;function t(){return new zIe(e)}}IX.exports=JIe});var UX=s(function(fir,JX){"use strict";var zX=require("@stdlib/utils/define-nonenumerable-read-only-property"),$m=td(),UIe=WX(),CIe=kX();zX($m,"objectMode",UIe);zX($m,"factory",CIe);JX.exports=$m});var CX=s(function(dir,BIe){BIe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,normalized:!1}});var YX=s(function(lir,XX){"use strict";var DIe=require("@stdlib/assert/is-plain-object"),Sr=require("@stdlib/assert/has-own-property"),BX=require("@stdlib/assert/is-boolean").isPrimitive,XIe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,DX=require("@stdlib/assert/is-string").isPrimitive,YIe=require("@stdlib/assert/is-positive-integer").isPrimitive,HIe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ji=require("@stdlib/string/format");function ZIe(r,e){return DIe(e)?Sr(e,"sep")&&(r.sep=e.sep,!DX(r.sep))?new TypeError(Ji("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Sr(e,"objectMode")&&(r.objectMode=e.objectMode,!BX(r.objectMode))?new TypeError(Ji("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Sr(e,"encoding")&&(r.encoding=e.encoding,!DX(r.encoding)&&r.encoding!==null)?new TypeError(Ji("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Sr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!XIe(r.highWaterMark))?new TypeError(Ji("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Sr(e,"iter")&&(r.iter=e.iter,!HIe(r.iter))?new TypeError(Ji("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Sr(e,"siter")&&(r.siter=e.siter,!YIe(r.siter))?new TypeError(Ji("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):Sr(e,"normalized")&&(r.normalized=e.normalized,!BX(r.normalized))?new TypeError(Ji("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",r.normalized)):(Sr(e,"seed")&&(r.seed=e.seed),Sr(e,"state")&&(r.state=e.state),Sr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Ji("invalid argument. Options argument must be an object. Value: `%s`.",e))}XX.exports=ZIe});var ZX=s(function(cir,HX){"use strict";var QIe=require("debug"),$Ie=QIe("random:streams:minstd-shuffle");HX.exports=$Ie});var nd=s(function(mir,e7){"use strict";var KX=require("readable-stream").Readable,KIe=require("@stdlib/assert/is-error"),eke=require("@stdlib/object/assign"),rke=require("@stdlib/utils/inherit"),QX=require("@stdlib/utils/define-nonenumerable-property"),Xn=require("@stdlib/utils/define-nonenumerable-read-only-property"),id=require("@stdlib/utils/define-read-only-accessor"),tke=require("@stdlib/utils/define-read-write-accessor"),ike=ee().factory,$X=require("@stdlib/buffer/from-string"),nke=require("@stdlib/utils/next-tick"),ake=CX(),ske=YX(),Os=ZX();function uke(){return this._prng.seed}function oke(){return this._prng.seedLength}function vke(){return this._prng.stateLength}function gke(){return this._prng.byteLength}function fke(){return this._prng.state}function dke(r){this._prng.state=r}function lke(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return 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=$X(e):e=$X(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function cke(r){var e;if(this._destroyed)return Os("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,nke(t),this;function t(){r&&(Os("Stream was destroyed due to an error. Error: %s.",KIe(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=eke({},ake),arguments.length>0&&(i=ske(t,r),i))throw i;return Os("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),KX.call(this,t),QX(this,"_destroyed",!1),Xn(this,"_objectMode",t.objectMode),Xn(this,"_sep",t.sep),Xn(this,"_iter",t.iter),Xn(this,"_siter",t.siter),QX(this,"_i",0),e=ike(t),t.normalized&&(e=e.normalized),Xn(this,"_prng",e),this}rke(Pe,KX);id(Pe.prototype,"seed",uke);id(Pe.prototype,"seedLength",oke);tke(Pe.prototype,"state",fke,dke);id(Pe.prototype,"stateLength",vke);id(Pe.prototype,"byteLength",gke);Xn(Pe.prototype,"_read",lke);Xn(Pe.prototype,"destroy",cke);e7.exports=Pe});var t7=s(function(hir,r7){"use strict";var mke=require("@stdlib/assert/is-plain-object"),hke=require("@stdlib/object/assign"),pke=require("@stdlib/string/format"),yke=nd();function qke(r){var e;if(arguments.length>0){if(e=r,!mke(e))throw new TypeError(pke("invalid argument. Options argument must be an object. Value: `%s`.",e));e=hke({},r)}else e={};return e.objectMode=!0,new yke(e)}r7.exports=qke});var n7=s(function(pir,i7){"use strict";var bke=require("@stdlib/assert/is-plain-object"),wke=require("@stdlib/object/assign"),Ske=require("@stdlib/string/format"),Oke=nd();function Eke(r){var e;if(arguments.length>0){if(!bke(r))throw new TypeError(Ske("invalid argument. Options argument must be an object. Value: `%s`.",r));e=wke({},r)}else e={};return t;function t(){return new Oke(e)}}i7.exports=Eke});var u7=s(function(yir,s7){"use strict";var a7=require("@stdlib/utils/define-nonenumerable-read-only-property"),Km=nd(),_ke=t7(),Nke=n7();a7(Km,"objectMode",_ke);a7(Km,"factory",Nke);s7.exports=Km});var o7=s(function(qir,Lke){Lke.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,normalized:!1}});var d7=s(function(bir,f7){"use strict";var Rke=require("@stdlib/assert/is-plain-object"),Or=require("@stdlib/assert/has-own-property"),v7=require("@stdlib/assert/is-boolean").isPrimitive,Pke=require("@stdlib/assert/is-nonnegative-number").isPrimitive,g7=require("@stdlib/assert/is-string").isPrimitive,Tke=require("@stdlib/assert/is-positive-integer").isPrimitive,jke=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ui=require("@stdlib/string/format");function Mke(r,e){return Rke(e)?Or(e,"sep")&&(r.sep=e.sep,!g7(r.sep))?new TypeError(Ui("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Or(e,"objectMode")&&(r.objectMode=e.objectMode,!v7(r.objectMode))?new TypeError(Ui("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Or(e,"encoding")&&(r.encoding=e.encoding,!g7(r.encoding)&&r.encoding!==null)?new TypeError(Ui("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Or(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!Pke(r.highWaterMark))?new TypeError(Ui("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Or(e,"iter")&&(r.iter=e.iter,!jke(r.iter))?new TypeError(Ui("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Or(e,"siter")&&(r.siter=e.siter,!Tke(r.siter))?new TypeError(Ui("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):Or(e,"normalized")&&(r.normalized=e.normalized,!v7(r.normalized))?new TypeError(Ui("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",r.normalized)):(Or(e,"seed")&&(r.seed=e.seed),Or(e,"state")&&(r.state=e.state),Or(e,"copy")&&(r.copy=e.copy),null):new TypeError(Ui("invalid argument. Options argument must be an object. Value: `%s`.",e))}f7.exports=Mke});var c7=s(function(wir,l7){"use strict";var xke=require("debug"),Ake=xke("random:streams:mt19937");l7.exports=Ake});var sd=s(function(Sir,y7){"use strict";var p7=require("readable-stream").Readable,Gke=require("@stdlib/assert/is-error"),Vke=require("@stdlib/object/assign"),Fke=require("@stdlib/utils/inherit"),m7=require("@stdlib/utils/define-nonenumerable-property"),Yn=require("@stdlib/utils/define-nonenumerable-read-only-property"),ad=require("@stdlib/utils/define-read-only-accessor"),Wke=require("@stdlib/utils/define-read-write-accessor"),Ike=T().factory,h7=require("@stdlib/buffer/from-string"),kke=require("@stdlib/utils/next-tick"),zke=o7(),Jke=d7(),Es=c7();function Uke(){return this._prng.seed}function Cke(){return this._prng.seedLength}function Bke(){return this._prng.stateLength}function Dke(){return this._prng.byteLength}function Xke(){return this._prng.state}function Yke(r){this._prng.state=r}function Hke(){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=h7(e):e=h7(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Zke(r){var e;if(this._destroyed)return Es("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,kke(t),this;function t(){r&&(Es("Stream was destroyed due to an error. Error: %s.",Gke(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=Vke({},zke),arguments.length>0&&(i=Jke(t,r),i))throw i;return Es("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),p7.call(this,t),m7(this,"_destroyed",!1),Yn(this,"_objectMode",t.objectMode),Yn(this,"_sep",t.sep),Yn(this,"_iter",t.iter),Yn(this,"_siter",t.siter),m7(this,"_i",0),e=Ike(t),t.normalized&&(e=e.normalized),Yn(this,"_prng",e),this}Fke(Te,p7);ad(Te.prototype,"seed",Uke);ad(Te.prototype,"seedLength",Cke);Wke(Te.prototype,"state",Xke,Yke);ad(Te.prototype,"stateLength",Bke);ad(Te.prototype,"byteLength",Dke);Yn(Te.prototype,"_read",Hke);Yn(Te.prototype,"destroy",Zke);y7.exports=Te});var b7=s(function(Oir,q7){"use strict";var Qke=require("@stdlib/assert/is-plain-object"),$ke=require("@stdlib/object/assign"),Kke=require("@stdlib/string/format"),eze=sd();function rze(r){var e;if(arguments.length>0){if(e=r,!Qke(e))throw new TypeError(Kke("invalid argument. Options argument must be an object. Value: `%s`.",e));e=$ke({},r)}else e={};return e.objectMode=!0,new eze(e)}q7.exports=rze});var S7=s(function(Eir,w7){"use strict";var tze=require("@stdlib/assert/is-plain-object"),ize=require("@stdlib/object/assign"),nze=require("@stdlib/string/format"),aze=sd();function sze(r){var e;if(arguments.length>0){if(!tze(r))throw new TypeError(nze("invalid argument. Options argument must be an object. Value: `%s`.",r));e=ize({},r)}else e={};return t;function t(){return new aze(e)}}w7.exports=sze});var _7=s(function(_ir,E7){"use strict";var O7=require("@stdlib/utils/define-nonenumerable-read-only-property"),eh=sd(),uze=b7(),oze=S7();O7(eh,"objectMode",uze);O7(eh,"factory",oze);E7.exports=eh});var N7=s(function(Nir,vze){vze.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var P7=s(function(Lir,R7){"use strict";var gze=require("@stdlib/assert/is-plain-object"),Er=require("@stdlib/assert/has-own-property"),fze=require("@stdlib/assert/is-boolean").isPrimitive,dze=require("@stdlib/assert/is-nonnegative-number").isPrimitive,L7=require("@stdlib/assert/is-string").isPrimitive,lze=require("@stdlib/assert/is-positive-integer").isPrimitive,cze=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Hn=require("@stdlib/string/format");function mze(r,e){return gze(e)?Er(e,"sep")&&(r.sep=e.sep,!L7(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,!fze(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,!L7(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,!dze(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,!cze(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,!lze(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))}R7.exports=mze});var j7=s(function(Rir,T7){"use strict";var hze=require("debug"),pze=hze("random:streams:negative-binomial");T7.exports=pze});var od=s(function(Pir,V7){"use strict";var G7=require("readable-stream").Readable,yze=require("@stdlib/assert/is-positive-number").isPrimitive,qze=require("@stdlib/assert/is-probability").isPrimitive,bze=require("@stdlib/assert/is-error"),wze=require("@stdlib/object/assign"),Sze=require("@stdlib/utils/inherit"),M7=require("@stdlib/utils/define-nonenumerable-property"),Ci=require("@stdlib/utils/define-nonenumerable-read-only-property"),ud=require("@stdlib/utils/define-read-only-accessor"),Oze=require("@stdlib/utils/define-read-write-accessor"),Eze=Ia().factory,x7=require("@stdlib/buffer/from-string"),_ze=require("@stdlib/utils/next-tick"),A7=require("@stdlib/string/format"),Nze=N7(),Lze=P7(),_s=j7();function Rze(){return this._prng.seed}function Pze(){return this._prng.seedLength}function Tze(){return this._prng.stateLength}function jze(){return this._prng.byteLength}function Mze(){return this._prng.state}function xze(r){this._prng.state=r}function Aze(){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=x7(e):e=x7(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Gze(r){var e;if(this._destroyed)return _s("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,_ze(t),this;function t(){r&&(_s("Stream was destroyed due to an error. Error: %s.",bze(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(!yze(r))throw new TypeError(A7("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!qze(e))throw new TypeError(A7("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(i=wze({},Nze),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)),G7.call(this,i),M7(this,"_destroyed",!1),Ci(this,"_objectMode",i.objectMode),Ci(this,"_sep",i.sep),Ci(this,"_iter",i.iter),Ci(this,"_siter",i.siter),M7(this,"_i",0),Ci(this,"_prng",Eze(r,e,i)),Ci(this,"PRNG",this._prng.PRNG),this}Sze(je,G7);ud(je.prototype,"seed",Rze);ud(je.prototype,"seedLength",Pze);Oze(je.prototype,"state",Mze,xze);ud(je.prototype,"stateLength",Tze);ud(je.prototype,"byteLength",jze);Ci(je.prototype,"_read",Aze);Ci(je.prototype,"destroy",Gze);V7.exports=je});var W7=s(function(Tir,F7){"use strict";var Vze=require("@stdlib/assert/is-plain-object"),Fze=require("@stdlib/object/assign"),Wze=require("@stdlib/string/format"),Ize=od();function kze(r,e,t){var i;if(arguments.length>2){if(i=t,!Vze(i))throw new TypeError(Wze("invalid argument. Options argument must be an object. Value: `%s`.",i));i=Fze({},t)}else i={};return i.objectMode=!0,new Ize(r,e,i)}F7.exports=kze});var C7=s(function(jir,U7){"use strict";var I7=require("@stdlib/assert/is-plain-object"),k7=require("@stdlib/object/assign"),z7=require("@stdlib/string/format"),J7=od();function zze(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!I7(r))throw new TypeError(z7("invalid argument. Options argument must be an object. Value: `%s`.",r));n=k7({},r)}else if(i>2){if(!I7(t))throw new TypeError(z7("invalid argument. Options argument must be an object. Value: `%s`.",t));n=k7({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new J7(v,g,n)}function o(){return new J7(r,e,n)}}U7.exports=zze});var X7=s(function(Mir,D7){"use strict";var B7=require("@stdlib/utils/define-nonenumerable-read-only-property"),rh=od(),Jze=W7(),Uze=C7();B7(rh,"objectMode",Jze);B7(rh,"factory",Uze);D7.exports=rh});var Y7=s(function(xir,Cze){Cze.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var Q7=s(function(Air,Z7){"use strict";var Bze=require("@stdlib/assert/is-plain-object"),_r=require("@stdlib/assert/has-own-property"),Dze=require("@stdlib/assert/is-boolean").isPrimitive,Xze=require("@stdlib/assert/is-nonnegative-number").isPrimitive,H7=require("@stdlib/assert/is-string").isPrimitive,Yze=require("@stdlib/assert/is-positive-integer").isPrimitive,Hze=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Zn=require("@stdlib/string/format");function Zze(r,e){return Bze(e)?_r(e,"sep")&&(r.sep=e.sep,!H7(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,!Dze(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,!H7(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,!Xze(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,!Hze(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,!Yze(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))}Z7.exports=Zze});var K7=s(function(Gir,$7){"use strict";var Qze=require("debug"),$ze=Qze("random:streams:normal");$7.exports=$ze});var gd=s(function(Vir,n5){"use strict";var i5=require("readable-stream").Readable,Kze=require("@stdlib/assert/is-positive-number").isPrimitive,e3e=require("@stdlib/assert/is-number").isPrimitive,r3e=require("@stdlib/math/base/assert/is-nan"),t3e=require("@stdlib/assert/is-error"),i3e=require("@stdlib/object/assign"),n3e=require("@stdlib/utils/inherit"),e5=require("@stdlib/utils/define-nonenumerable-property"),Bi=require("@stdlib/utils/define-nonenumerable-read-only-property"),vd=require("@stdlib/utils/define-read-only-accessor"),a3e=require("@stdlib/utils/define-read-write-accessor"),s3e=hn().factory,r5=require("@stdlib/buffer/from-string"),u3e=require("@stdlib/utils/next-tick"),t5=require("@stdlib/string/format"),o3e=Y7(),v3e=Q7(),Ns=K7();function g3e(){return this._prng.seed}function f3e(){return this._prng.seedLength}function d3e(){return this._prng.stateLength}function l3e(){return this._prng.byteLength}function c3e(){return this._prng.state}function m3e(r){this._prng.state=r}function h3e(){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=r5(e):e=r5(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 Ns("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,u3e(t),this;function t(){r&&(Ns("Stream was destroyed due to an error. Error: %s.",t3e(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(!e3e(r)||r3e(r))throw new TypeError(t5("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Kze(e))throw new TypeError(t5("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=i3e({},o3e),arguments.length>2&&(n=v3e(i,t),n))throw n;return Ns("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),i5.call(this,i),e5(this,"_destroyed",!1),Bi(this,"_objectMode",i.objectMode),Bi(this,"_sep",i.sep),Bi(this,"_iter",i.iter),Bi(this,"_siter",i.siter),e5(this,"_i",0),Bi(this,"_prng",s3e(r,e,i)),Bi(this,"PRNG",this._prng.PRNG),this}n3e(Me,i5);vd(Me.prototype,"seed",g3e);vd(Me.prototype,"seedLength",f3e);a3e(Me.prototype,"state",c3e,m3e);vd(Me.prototype,"stateLength",d3e);vd(Me.prototype,"byteLength",l3e);Bi(Me.prototype,"_read",h3e);Bi(Me.prototype,"destroy",p3e);n5.exports=Me});var s5=s(function(Fir,a5){"use strict";var y3e=require("@stdlib/assert/is-plain-object"),q3e=require("@stdlib/object/assign"),b3e=require("@stdlib/string/format"),w3e=gd();function S3e(r,e,t){var i;if(arguments.length>2){if(i=t,!y3e(i))throw new TypeError(b3e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=q3e({},t)}else i={};return i.objectMode=!0,new w3e(r,e,i)}a5.exports=S3e});var d5=s(function(Wir,f5){"use strict";var u5=require("@stdlib/assert/is-plain-object"),o5=require("@stdlib/object/assign"),v5=require("@stdlib/string/format"),g5=gd();function O3e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!u5(r))throw new TypeError(v5("invalid argument. Options argument must be an object. Value: `%s`.",r));n=o5({},r)}else if(i>2){if(!u5(t))throw new TypeError(v5("invalid argument. Options argument must be an object. Value: `%s`.",t));n=o5({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new g5(v,g,n)}function o(){return new g5(r,e,n)}}f5.exports=O3e});var m5=s(function(Iir,c5){"use strict";var l5=require("@stdlib/utils/define-nonenumerable-read-only-property"),th=gd(),E3e=s5(),_3e=d5();l5(th,"objectMode",E3e);l5(th,"factory",_3e);c5.exports=th});var h5=s(function(kir,N3e){N3e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var q5=s(function(zir,y5){"use strict";var L3e=require("@stdlib/assert/is-plain-object"),Nr=require("@stdlib/assert/has-own-property"),R3e=require("@stdlib/assert/is-boolean").isPrimitive,P3e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,p5=require("@stdlib/assert/is-string").isPrimitive,T3e=require("@stdlib/assert/is-positive-integer").isPrimitive,j3e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Qn=require("@stdlib/string/format");function M3e(r,e){return L3e(e)?Nr(e,"sep")&&(r.sep=e.sep,!p5(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,!R3e(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,!p5(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,!P3e(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,!j3e(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,!T3e(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))}y5.exports=M3e});var w5=s(function(Jir,b5){"use strict";var x3e=require("debug"),A3e=x3e("random:streams:pareto1");b5.exports=A3e});var dd=s(function(Uir,L5){"use strict";var N5=require("readable-stream").Readable,S5=require("@stdlib/assert/is-positive-number").isPrimitive,G3e=require("@stdlib/assert/is-error"),V3e=require("@stdlib/object/assign"),F3e=require("@stdlib/utils/inherit"),O5=require("@stdlib/utils/define-nonenumerable-property"),Di=require("@stdlib/utils/define-nonenumerable-read-only-property"),fd=require("@stdlib/utils/define-read-only-accessor"),W3e=require("@stdlib/utils/define-read-write-accessor"),I3e=za().factory,E5=require("@stdlib/buffer/from-string"),k3e=require("@stdlib/utils/next-tick"),_5=require("@stdlib/string/format"),z3e=h5(),J3e=q5(),Ls=w5();function U3e(){return this._prng.seed}function C3e(){return this._prng.seedLength}function B3e(){return this._prng.stateLength}function D3e(){return this._prng.byteLength}function X3e(){return this._prng.state}function Y3e(r){this._prng.state=r}function H3e(){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=E5(e):e=E5(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Z3e(r){var e;if(this._destroyed)return Ls("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,k3e(t),this;function t(){r&&(Ls("Stream was destroyed due to an error. Error: %s.",G3e(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(!S5(r))throw new TypeError(_5("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!S5(e))throw new TypeError(_5("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=V3e({},z3e),arguments.length>2&&(n=J3e(i,t),n))throw n;return Ls("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),N5.call(this,i),O5(this,"_destroyed",!1),Di(this,"_objectMode",i.objectMode),Di(this,"_sep",i.sep),Di(this,"_iter",i.iter),Di(this,"_siter",i.siter),O5(this,"_i",0),Di(this,"_prng",I3e(r,e,i)),Di(this,"PRNG",this._prng.PRNG),this}F3e(xe,N5);fd(xe.prototype,"seed",U3e);fd(xe.prototype,"seedLength",C3e);W3e(xe.prototype,"state",X3e,Y3e);fd(xe.prototype,"stateLength",B3e);fd(xe.prototype,"byteLength",D3e);Di(xe.prototype,"_read",H3e);Di(xe.prototype,"destroy",Z3e);L5.exports=xe});var P5=s(function(Cir,R5){"use strict";var Q3e=require("@stdlib/assert/is-plain-object"),$3e=require("@stdlib/object/assign"),K3e=require("@stdlib/string/format"),eJe=dd();function rJe(r,e,t){var i;if(arguments.length>2){if(i=t,!Q3e(i))throw new TypeError(K3e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=$3e({},t)}else i={};return i.objectMode=!0,new eJe(r,e,i)}R5.exports=rJe});var G5=s(function(Bir,A5){"use strict";var T5=require("@stdlib/assert/is-plain-object"),j5=require("@stdlib/object/assign"),M5=require("@stdlib/string/format"),x5=dd();function tJe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!T5(r))throw new TypeError(M5("invalid argument. Options argument must be an object. Value: `%s`.",r));n=j5({},r)}else if(i>2){if(!T5(t))throw new TypeError(M5("invalid argument. Options argument must be an object. Value: `%s`.",t));n=j5({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new x5(v,g,n)}function o(){return new x5(r,e,n)}}A5.exports=tJe});var W5=s(function(Dir,F5){"use strict";var V5=require("@stdlib/utils/define-nonenumerable-read-only-property"),ih=dd(),iJe=P5(),nJe=G5();V5(ih,"objectMode",iJe);V5(ih,"factory",nJe);F5.exports=ih});var I5=s(function(Xir,aJe){aJe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var J5=s(function(Yir,z5){"use strict";var sJe=require("@stdlib/assert/is-plain-object"),Lr=require("@stdlib/assert/has-own-property"),uJe=require("@stdlib/assert/is-boolean").isPrimitive,oJe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,k5=require("@stdlib/assert/is-string").isPrimitive,vJe=require("@stdlib/assert/is-positive-integer").isPrimitive,gJe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,$n=require("@stdlib/string/format");function fJe(r,e){return sJe(e)?Lr(e,"sep")&&(r.sep=e.sep,!k5(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,!uJe(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,!k5(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,!oJe(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,!gJe(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,!vJe(r.siter))?new TypeError($n("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($n("invalid argument. Options argument must be an object. Value: `%s`.",e))}z5.exports=fJe});var C5=s(function(Hir,U5){"use strict";var dJe=require("debug"),lJe=dJe("random:streams:poisson");U5.exports=lJe});var cd=s(function(Zir,Y5){"use strict";var X5=require("readable-stream").Readable,cJe=require("@stdlib/assert/is-positive-number").isPrimitive,mJe=require("@stdlib/assert/is-error"),hJe=require("@stdlib/object/assign"),pJe=require("@stdlib/utils/inherit"),B5=require("@stdlib/utils/define-nonenumerable-property"),Xi=require("@stdlib/utils/define-nonenumerable-read-only-property"),ld=require("@stdlib/utils/define-read-only-accessor"),yJe=require("@stdlib/utils/define-read-write-accessor"),qJe=mn().factory,D5=require("@stdlib/buffer/from-string"),bJe=require("@stdlib/string/format"),wJe=require("@stdlib/utils/next-tick"),SJe=I5(),OJe=J5(),Rs=C5();function EJe(){return this._prng.seed}function _Je(){return this._prng.seedLength}function NJe(){return this._prng.stateLength}function LJe(){return this._prng.byteLength}function RJe(){return this._prng.state}function PJe(r){this._prng.state=r}function TJe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return 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=D5(e):e=D5(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function jJe(r){var e;if(this._destroyed)return Rs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,wJe(t),this;function t(){r&&(Rs("Stream was destroyed due to an error. Error: %s.",mJe(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(!cJe(r))throw new TypeError(bJe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=hJe({},SJe),arguments.length>1&&(i=OJe(t,e),i))throw i;return Rs("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),X5.call(this,t),B5(this,"_destroyed",!1),Xi(this,"_objectMode",t.objectMode),Xi(this,"_sep",t.sep),Xi(this,"_iter",t.iter),Xi(this,"_siter",t.siter),B5(this,"_i",0),Xi(this,"_prng",qJe(r,t)),Xi(this,"PRNG",this._prng.PRNG),this}pJe(Ae,X5);ld(Ae.prototype,"seed",EJe);ld(Ae.prototype,"seedLength",_Je);yJe(Ae.prototype,"state",RJe,PJe);ld(Ae.prototype,"stateLength",NJe);ld(Ae.prototype,"byteLength",LJe);Xi(Ae.prototype,"_read",TJe);Xi(Ae.prototype,"destroy",jJe);Y5.exports=Ae});var Z5=s(function(Qir,H5){"use strict";var MJe=require("@stdlib/assert/is-plain-object"),xJe=require("@stdlib/object/assign"),AJe=require("@stdlib/string/format"),GJe=cd();function VJe(r,e){var t;if(arguments.length>1){if(t=e,!MJe(t))throw new TypeError(AJe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=xJe({},e)}else t={};return t.objectMode=!0,new GJe(r,t)}H5.exports=VJe});var tY=s(function($ir,rY){"use strict";var FJe=require("@stdlib/assert/is-positive-number").isPrimitive,Q5=require("@stdlib/assert/is-plain-object"),$5=require("@stdlib/object/assign"),K5=require("@stdlib/string/format"),eY=cd();function WJe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!Q5(e))throw new TypeError(K5("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=$5({},e)}else if(t===1)if(FJe(r))n=u,i={};else{if(!Q5(r))throw new TypeError(K5("invalid argument. Options argument must be an object. Value: `%s`.",r));i=$5({},r),n=a}else i={},n=a;return n;function a(o){return new eY(o,i)}function u(){return new eY(r,i)}}rY.exports=WJe});var aY=s(function(Kir,nY){"use strict";var iY=require("@stdlib/utils/define-nonenumerable-read-only-property"),nh=cd(),IJe=Z5(),kJe=tY();iY(nh,"objectMode",IJe);iY(nh,"factory",kJe);nY.exports=nh});var sY=s(function(enr,zJe){zJe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,name:"mt19937"}});var vY=s(function(rnr,oY){"use strict";var JJe=require("@stdlib/assert/is-plain-object"),Rr=require("@stdlib/assert/has-own-property"),UJe=require("@stdlib/assert/is-boolean").isPrimitive,CJe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,uY=require("@stdlib/assert/is-string").isPrimitive,BJe=require("@stdlib/assert/is-positive-integer").isPrimitive,DJe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Kn=require("@stdlib/string/format");function XJe(r,e){return JJe(e)?Rr(e,"sep")&&(r.sep=e.sep,!uY(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,!UJe(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,!uY(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,!CJe(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,!DJe(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,!BJe(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))}oY.exports=XJe});var fY=s(function(tnr,gY){"use strict";var YJe=require("debug"),HJe=YJe("random:streams:randi");gY.exports=HJe});var hd=s(function(inr,mY){"use strict";var cY=require("readable-stream").Readable,ZJe=require("@stdlib/assert/is-error"),QJe=require("@stdlib/object/assign"),$Je=require("@stdlib/utils/inherit"),dY=require("@stdlib/utils/define-nonenumerable-property"),Yi=require("@stdlib/utils/define-nonenumerable-read-only-property"),md=require("@stdlib/utils/define-read-only-accessor"),KJe=require("@stdlib/utils/define-read-write-accessor"),eUe=hu().factory,lY=require("@stdlib/buffer/from-string"),rUe=require("@stdlib/utils/next-tick"),tUe=sY(),iUe=vY(),Ps=fY();function nUe(){return this._prng.seed}function aUe(){return this._prng.seedLength}function sUe(){return this._prng.stateLength}function uUe(){return this._prng.byteLength}function oUe(){return this._prng.state}function vUe(r){this._prng.state=r}function gUe(){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=lY(e):e=lY(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function fUe(r){var e;if(this._destroyed)return Ps("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,rUe(t),this;function t(){r&&(Ps("Stream was destroyed due to an error. Error: %s.",ZJe(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=QJe({},tUe),arguments.length>0&&(t=iUe(e,r),t))throw t;return Ps("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),cY.call(this,e),dY(this,"_destroyed",!1),Yi(this,"_objectMode",e.objectMode),Yi(this,"_sep",e.sep),Yi(this,"_iter",e.iter),Yi(this,"_siter",e.siter),dY(this,"_i",0),Yi(this,"_prng",eUe(e)),Yi(this,"PRNG",this._prng.PRNG),this}$Je(Ge,cY);md(Ge.prototype,"seed",nUe);md(Ge.prototype,"seedLength",aUe);KJe(Ge.prototype,"state",oUe,vUe);md(Ge.prototype,"stateLength",sUe);md(Ge.prototype,"byteLength",uUe);Yi(Ge.prototype,"_read",gUe);Yi(Ge.prototype,"destroy",fUe);mY.exports=Ge});var pY=s(function(nnr,hY){"use strict";var dUe=require("@stdlib/assert/is-plain-object"),lUe=require("@stdlib/object/assign"),cUe=require("@stdlib/string/format"),mUe=hd();function hUe(r){var e;if(arguments.length>0){if(e=r,!dUe(e))throw new TypeError(cUe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=lUe({},r)}else e={};return e.objectMode=!0,new mUe(e)}hY.exports=hUe});var qY=s(function(anr,yY){"use strict";var pUe=require("@stdlib/assert/is-plain-object"),yUe=require("@stdlib/object/assign"),qUe=require("@stdlib/string/format"),bUe=hd();function wUe(r){var e;if(arguments.length>0){if(!pUe(r))throw new TypeError(qUe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=yUe({},r)}else e={};return t;function t(){return new bUe(e)}}yY.exports=wUe});var SY=s(function(snr,wY){"use strict";var bY=require("@stdlib/utils/define-nonenumerable-read-only-property"),ah=hd(),SUe=pY(),OUe=qY();bY(ah,"objectMode",SUe);bY(ah,"factory",OUe);wY.exports=ah});var OY=s(function(unr,EUe){EUe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,name:"improved-ziggurat"}});var NY=s(function(onr,_Y){"use strict";var _Ue=require("@stdlib/assert/is-plain-object"),De=require("@stdlib/assert/has-own-property"),NUe=require("@stdlib/assert/is-boolean").isPrimitive,LUe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,EY=require("@stdlib/assert/is-string").isPrimitive,RUe=require("@stdlib/assert/is-positive-integer").isPrimitive,PUe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ea=require("@stdlib/string/format");function TUe(r,e){return _Ue(e)?De(e,"sep")&&(r.sep=e.sep,!EY(r.sep))?new TypeError(ea("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):De(e,"objectMode")&&(r.objectMode=e.objectMode,!NUe(r.objectMode))?new TypeError(ea("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):De(e,"encoding")&&(r.encoding=e.encoding,!EY(r.encoding)&&r.encoding!==null)?new TypeError(ea("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(ea("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):De(e,"iter")&&(r.iter=e.iter,!PUe(r.iter))?new TypeError(ea("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):De(e,"siter")&&(r.siter=e.siter,!RUe(r.siter))?new TypeError(ea("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(ea("invalid argument. Options argument must be an object. Value: `%s`.",e))}_Y.exports=TUe});var RY=s(function(vnr,LY){"use strict";var jUe=require("debug"),MUe=jUe("random:streams:randn");LY.exports=MUe});var yd=s(function(gnr,MY){"use strict";var jY=require("readable-stream").Readable,xUe=require("@stdlib/assert/is-error"),AUe=require("@stdlib/object/assign"),GUe=require("@stdlib/utils/inherit"),PY=require("@stdlib/utils/define-nonenumerable-property"),Hi=require("@stdlib/utils/define-nonenumerable-read-only-property"),pd=require("@stdlib/utils/define-read-only-accessor"),VUe=require("@stdlib/utils/define-read-write-accessor"),FUe=yu().factory,TY=require("@stdlib/buffer/from-string"),WUe=require("@stdlib/utils/next-tick"),IUe=OY(),kUe=NY(),Ts=RY();function zUe(){return this._prng.seed}function JUe(){return this._prng.seedLength}function UUe(){return this._prng.stateLength}function CUe(){return this._prng.byteLength}function BUe(){return this._prng.state}function DUe(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=TY(e):e=TY(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function YUe(r){var e;if(this._destroyed)return Ts("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,WUe(t),this;function t(){r&&(Ts("Stream was destroyed due to an error. Error: %s.",xUe(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=AUe({},IUe),arguments.length>0&&(t=kUe(e,r),t))throw t;return Ts("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),jY.call(this,e),PY(this,"_destroyed",!1),Hi(this,"_objectMode",e.objectMode),Hi(this,"_sep",e.sep),Hi(this,"_iter",e.iter),Hi(this,"_siter",e.siter),PY(this,"_i",0),Hi(this,"_prng",FUe(e)),Hi(this,"PRNG",this._prng.PRNG),this}GUe(Ve,jY);pd(Ve.prototype,"seed",zUe);pd(Ve.prototype,"seedLength",JUe);VUe(Ve.prototype,"state",BUe,DUe);pd(Ve.prototype,"stateLength",UUe);pd(Ve.prototype,"byteLength",CUe);Hi(Ve.prototype,"_read",XUe);Hi(Ve.prototype,"destroy",YUe);MY.exports=Ve});var AY=s(function(fnr,xY){"use strict";var HUe=require("@stdlib/assert/is-plain-object"),ZUe=require("@stdlib/object/assign"),QUe=require("@stdlib/string/format"),$Ue=yd();function KUe(r){var e;if(arguments.length>0){if(e=r,!HUe(e))throw new TypeError(QUe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=ZUe({},r)}else e={};return e.objectMode=!0,new $Ue(e)}xY.exports=KUe});var VY=s(function(dnr,GY){"use strict";var eCe=require("@stdlib/assert/is-plain-object"),rCe=require("@stdlib/object/assign"),tCe=require("@stdlib/string/format"),iCe=yd();function nCe(r){var e;if(arguments.length>0){if(!eCe(r))throw new TypeError(tCe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=rCe({},r)}else e={};return t;function t(){return new iCe(e)}}GY.exports=nCe});var IY=s(function(lnr,WY){"use strict";var FY=require("@stdlib/utils/define-nonenumerable-read-only-property"),sh=yd(),aCe=AY(),sCe=VY();FY(sh,"objectMode",aCe);FY(sh,"factory",sCe);WY.exports=sh});var kY=s(function(cnr,uCe){uCe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,name:"mt19937"}});var UY=s(function(mnr,JY){"use strict";var oCe=require("@stdlib/assert/is-plain-object"),Pr=require("@stdlib/assert/has-own-property"),vCe=require("@stdlib/assert/is-boolean").isPrimitive,gCe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,zY=require("@stdlib/assert/is-string").isPrimitive,fCe=require("@stdlib/assert/is-positive-integer").isPrimitive,dCe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ra=require("@stdlib/string/format");function lCe(r,e){return oCe(e)?Pr(e,"sep")&&(r.sep=e.sep,!zY(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,!vCe(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,!zY(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,!gCe(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,!dCe(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,!fCe(r.siter))?new TypeError(ra("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Pr(e,"name")&&(r.name=e.name),Pr(e,"seed")&&(r.seed=e.seed),Pr(e,"state")&&(r.state=e.state),Pr(e,"copy")&&(r.copy=e.copy),null):new TypeError(ra("invalid argument. Options argument must be an object. Value: `%s`.",e))}JY.exports=lCe});var BY=s(function(hnr,CY){"use strict";var cCe=require("debug"),mCe=cCe("random:streams:randu");CY.exports=mCe});var bd=s(function(pnr,HY){"use strict";var YY=require("readable-stream").Readable,hCe=require("@stdlib/assert/is-error"),pCe=require("@stdlib/object/assign"),yCe=require("@stdlib/utils/inherit"),DY=require("@stdlib/utils/define-nonenumerable-property"),Zi=require("@stdlib/utils/define-nonenumerable-read-only-property"),qd=require("@stdlib/utils/define-read-only-accessor"),qCe=require("@stdlib/utils/define-read-write-accessor"),bCe=Tt().factory,XY=require("@stdlib/buffer/from-string"),wCe=require("@stdlib/utils/next-tick"),SCe=kY(),OCe=UY(),js=BY();function ECe(){return this._prng.seed}function _Ce(){return this._prng.seedLength}function NCe(){return this._prng.stateLength}function LCe(){return this._prng.byteLength}function RCe(){return this._prng.state}function PCe(r){this._prng.state=r}function TCe(){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=XY(e):e=XY(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function jCe(r){var e;if(this._destroyed)return js("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,wCe(t),this;function t(){r&&(js("Stream was destroyed due to an error. Error: %s.",hCe(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=pCe({},SCe),arguments.length>0&&(t=OCe(e,r),t))throw t;return js("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),YY.call(this,e),DY(this,"_destroyed",!1),Zi(this,"_objectMode",e.objectMode),Zi(this,"_sep",e.sep),Zi(this,"_iter",e.iter),Zi(this,"_siter",e.siter),DY(this,"_i",0),Zi(this,"_prng",bCe(e)),Zi(this,"PRNG",this._prng.PRNG),this}yCe(Fe,YY);qd(Fe.prototype,"seed",ECe);qd(Fe.prototype,"seedLength",_Ce);qCe(Fe.prototype,"state",RCe,PCe);qd(Fe.prototype,"stateLength",NCe);qd(Fe.prototype,"byteLength",LCe);Zi(Fe.prototype,"_read",TCe);Zi(Fe.prototype,"destroy",jCe);HY.exports=Fe});var QY=s(function(ynr,ZY){"use strict";var MCe=require("@stdlib/assert/is-plain-object"),xCe=require("@stdlib/object/assign"),ACe=require("@stdlib/string/format"),GCe=bd();function VCe(r){var e;if(arguments.length>0){if(e=r,!MCe(e))throw new TypeError(ACe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=xCe({},r)}else e={};return e.objectMode=!0,new GCe(e)}ZY.exports=VCe});var KY=s(function(qnr,$Y){"use strict";var FCe=require("@stdlib/assert/is-plain-object"),WCe=require("@stdlib/object/assign"),ICe=require("@stdlib/string/format"),kCe=bd();function zCe(r){var e;if(arguments.length>0){if(!FCe(r))throw new TypeError(ICe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=WCe({},r)}else e={};return t;function t(){return new kCe(e)}}$Y.exports=zCe});var t6=s(function(bnr,r6){"use strict";var e6=require("@stdlib/utils/define-nonenumerable-read-only-property"),uh=bd(),JCe=QY(),UCe=KY();e6(uh,"objectMode",JCe);e6(uh,"factory",UCe);r6.exports=uh});var i6=s(function(wnr,CCe){CCe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var s6=s(function(Snr,a6){"use strict";var BCe=require("@stdlib/assert/is-plain-object"),Tr=require("@stdlib/assert/has-own-property"),DCe=require("@stdlib/assert/is-boolean").isPrimitive,XCe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,n6=require("@stdlib/assert/is-string").isPrimitive,YCe=require("@stdlib/assert/is-positive-integer").isPrimitive,HCe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ta=require("@stdlib/string/format");function ZCe(r,e){return BCe(e)?Tr(e,"sep")&&(r.sep=e.sep,!n6(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,!DCe(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,!n6(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,!XCe(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,!HCe(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,!YCe(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))}a6.exports=ZCe});var o6=s(function(Onr,u6){"use strict";var QCe=require("debug"),$Ce=QCe("random:streams:rayleigh");u6.exports=$Ce});var Sd=s(function(Enr,d6){"use strict";var f6=require("readable-stream").Readable,KCe=require("@stdlib/assert/is-positive-number").isPrimitive,eBe=require("@stdlib/assert/is-error"),rBe=require("@stdlib/object/assign"),tBe=require("@stdlib/utils/inherit"),v6=require("@stdlib/utils/define-nonenumerable-property"),Qi=require("@stdlib/utils/define-nonenumerable-read-only-property"),wd=require("@stdlib/utils/define-read-only-accessor"),iBe=require("@stdlib/utils/define-read-write-accessor"),nBe=Ja().factory,g6=require("@stdlib/buffer/from-string"),aBe=require("@stdlib/utils/next-tick"),sBe=require("@stdlib/string/format"),uBe=i6(),oBe=s6(),Ms=o6();function vBe(){return this._prng.seed}function gBe(){return this._prng.seedLength}function fBe(){return this._prng.stateLength}function dBe(){return this._prng.byteLength}function lBe(){return this._prng.state}function cBe(r){this._prng.state=r}function mBe(){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=g6(e):e=g6(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function hBe(r){var e;if(this._destroyed)return Ms("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,aBe(t),this;function t(){r&&(Ms("Stream was destroyed due to an error. Error: %s.",eBe(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(!KCe(r))throw new TypeError(sBe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=rBe({},uBe),arguments.length>1&&(i=oBe(t,e),i))throw i;return Ms("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),f6.call(this,t),v6(this,"_destroyed",!1),Qi(this,"_objectMode",t.objectMode),Qi(this,"_sep",t.sep),Qi(this,"_iter",t.iter),Qi(this,"_siter",t.siter),v6(this,"_i",0),Qi(this,"_prng",nBe(r,t)),Qi(this,"PRNG",this._prng.PRNG),this}tBe(We,f6);wd(We.prototype,"seed",vBe);wd(We.prototype,"seedLength",gBe);iBe(We.prototype,"state",lBe,cBe);wd(We.prototype,"stateLength",fBe);wd(We.prototype,"byteLength",dBe);Qi(We.prototype,"_read",mBe);Qi(We.prototype,"destroy",hBe);d6.exports=We});var c6=s(function(_nr,l6){"use strict";var pBe=require("@stdlib/assert/is-plain-object"),yBe=require("@stdlib/object/assign"),qBe=require("@stdlib/string/format"),bBe=Sd();function wBe(r,e){var t;if(arguments.length>1){if(t=e,!pBe(t))throw new TypeError(qBe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=yBe({},e)}else t={};return t.objectMode=!0,new bBe(r,t)}l6.exports=wBe});var b6=s(function(Nnr,q6){"use strict";var SBe=require("@stdlib/assert/is-positive-number").isPrimitive,m6=require("@stdlib/assert/is-plain-object"),h6=require("@stdlib/object/assign"),p6=require("@stdlib/string/format"),y6=Sd();function OBe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!m6(e))throw new TypeError(p6("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=h6({},e)}else if(t===1)if(SBe(r))n=u,i={};else{if(!m6(r))throw new TypeError(p6("invalid argument. Options argument must be an object. Value: `%s`.",r));i=h6({},r),n=a}else i={},n=a;return n;function a(o){return new y6(o,i)}function u(){return new y6(r,i)}}q6.exports=OBe});var O6=s(function(Lnr,S6){"use strict";var w6=require("@stdlib/utils/define-nonenumerable-read-only-property"),oh=Sd(),EBe=c6(),_Be=b6();w6(oh,"objectMode",EBe);w6(oh,"factory",_Be);S6.exports=oh});var E6=s(function(Rnr,NBe){NBe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var L6=s(function(Pnr,N6){"use strict";var LBe=require("@stdlib/assert/is-plain-object"),jr=require("@stdlib/assert/has-own-property"),RBe=require("@stdlib/assert/is-boolean").isPrimitive,PBe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,_6=require("@stdlib/assert/is-string").isPrimitive,TBe=require("@stdlib/assert/is-positive-integer").isPrimitive,jBe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ia=require("@stdlib/string/format");function MBe(r,e){return LBe(e)?jr(e,"sep")&&(r.sep=e.sep,!_6(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,!RBe(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,!_6(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,!PBe(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,!jBe(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,!TBe(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))}N6.exports=MBe});var P6=s(function(Tnr,R6){"use strict";var xBe=require("debug"),ABe=xBe("random:streams:t");R6.exports=ABe});var Ed=s(function(jnr,x6){"use strict";var M6=require("readable-stream").Readable,GBe=require("@stdlib/assert/is-positive-number").isPrimitive,VBe=require("@stdlib/assert/is-error"),FBe=require("@stdlib/object/assign"),WBe=require("@stdlib/utils/inherit"),T6=require("@stdlib/utils/define-nonenumerable-property"),$i=require("@stdlib/utils/define-nonenumerable-read-only-property"),Od=require("@stdlib/utils/define-read-only-accessor"),IBe=require("@stdlib/utils/define-read-write-accessor"),kBe=Ba().factory,j6=require("@stdlib/buffer/from-string"),zBe=require("@stdlib/utils/next-tick"),JBe=require("@stdlib/string/format"),UBe=E6(),CBe=L6(),xs=P6();function BBe(){return this._prng.seed}function DBe(){return this._prng.seedLength}function XBe(){return this._prng.stateLength}function YBe(){return this._prng.byteLength}function HBe(){return this._prng.state}function ZBe(r){this._prng.state=r}function QBe(){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=j6(e):e=j6(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function $Be(r){var e;if(this._destroyed)return xs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,zBe(t),this;function t(){r&&(xs("Stream was destroyed due to an error. Error: %s.",VBe(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(!GBe(r))throw new TypeError(JBe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=FBe({},UBe),arguments.length>1&&(i=CBe(t,e),i))throw i;return xs("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),M6.call(this,t),T6(this,"_destroyed",!1),$i(this,"_objectMode",t.objectMode),$i(this,"_sep",t.sep),$i(this,"_iter",t.iter),$i(this,"_siter",t.siter),T6(this,"_i",0),$i(this,"_prng",kBe(r,t)),$i(this,"PRNG",this._prng.PRNG),this}WBe(Ie,M6);Od(Ie.prototype,"seed",BBe);Od(Ie.prototype,"seedLength",DBe);IBe(Ie.prototype,"state",HBe,ZBe);Od(Ie.prototype,"stateLength",XBe);Od(Ie.prototype,"byteLength",YBe);$i(Ie.prototype,"_read",QBe);$i(Ie.prototype,"destroy",$Be);x6.exports=Ie});var G6=s(function(Mnr,A6){"use strict";var KBe=require("@stdlib/assert/is-plain-object"),e9e=require("@stdlib/object/assign"),r9e=require("@stdlib/string/format"),t9e=Ed();function i9e(r,e){var t;if(arguments.length>1){if(t=e,!KBe(t))throw new TypeError(r9e("invalid argument. Options argument must be an object. Value: `%s`.",t));t=e9e({},e)}else t={};return t.objectMode=!0,new t9e(r,t)}A6.exports=i9e});var z6=s(function(xnr,k6){"use strict";var n9e=require("@stdlib/assert/is-positive-number").isPrimitive,V6=require("@stdlib/assert/is-plain-object"),F6=require("@stdlib/object/assign"),W6=require("@stdlib/string/format"),I6=Ed();function a9e(r,e){var t,i,n;if(t=arguments.length,t>1){if(!V6(e))throw new TypeError(W6("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=F6({},e)}else if(t===1)if(n9e(r))n=u,i={};else{if(!V6(r))throw new TypeError(W6("invalid argument. Options argument must be an object. Value: `%s`.",r));i=F6({},r),n=a}else i={},n=a;return n;function a(o){return new I6(o,i)}function u(){return new I6(r,i)}}k6.exports=a9e});var C6=s(function(Anr,U6){"use strict";var J6=require("@stdlib/utils/define-nonenumerable-read-only-property"),vh=Ed(),s9e=G6(),u9e=z6();J6(vh,"objectMode",s9e);J6(vh,"factory",u9e);U6.exports=vh});var B6=s(function(Gnr,o9e){o9e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var Y6=s(function(Vnr,X6){"use strict";var v9e=require("@stdlib/assert/is-plain-object"),Mr=require("@stdlib/assert/has-own-property"),g9e=require("@stdlib/assert/is-boolean").isPrimitive,f9e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,D6=require("@stdlib/assert/is-string").isPrimitive,d9e=require("@stdlib/assert/is-positive-integer").isPrimitive,l9e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,na=require("@stdlib/string/format");function c9e(r,e){return v9e(e)?Mr(e,"sep")&&(r.sep=e.sep,!D6(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,!g9e(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,!D6(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,!f9e(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,!l9e(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,!d9e(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))}X6.exports=c9e});var Z6=s(function(Fnr,H6){"use strict";var m9e=require("debug"),h9e=m9e("random:streams:triangular");H6.exports=h9e});var Ld=s(function(Wnr,e4){"use strict";var K6=require("readable-stream").Readable,gh=require("@stdlib/assert/is-number").isPrimitive,fh=require("@stdlib/math/base/assert/is-nan"),p9e=require("@stdlib/assert/is-error"),y9e=require("@stdlib/object/assign"),q9e=require("@stdlib/utils/inherit"),Q6=require("@stdlib/utils/define-nonenumerable-property"),Ki=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nd=require("@stdlib/utils/define-read-only-accessor"),b9e=require("@stdlib/utils/define-read-write-accessor"),w9e=Da().factory,$6=require("@stdlib/buffer/from-string"),S9e=require("@stdlib/utils/next-tick"),_d=require("@stdlib/string/format"),O9e=B6(),E9e=Y6(),As=Z6();function _9e(){return this._prng.seed}function N9e(){return this._prng.seedLength}function L9e(){return this._prng.stateLength}function R9e(){return this._prng.byteLength}function P9e(){return this._prng.state}function T9e(r){this._prng.state=r}function j9e(){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=$6(e):e=$6(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function M9e(r){var e;if(this._destroyed)return As("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,S9e(t),this;function t(){r&&(As("Stream was destroyed due to an error. Error: %s.",p9e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),As("Closing the stream..."),e.emit("close")}}function ke(r,e,t,i){var n,a;if(!(this instanceof ke))return arguments.length>3?new ke(r,e,t,i):new ke(r,e,t);if(!gh(r)||fh(r))throw new TypeError(_d("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!gh(e)||fh(e))throw new TypeError(_d("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(!gh(t)||fh(t))throw new TypeError(_d("invalid argument. Third argument must be a number and not NaN. Value: `%s`.",t));if(!(r<=t&&t<=e))throw new RangeError(_d("invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.","a <= c <= b",r,e,t));if(n=y9e({},O9e),arguments.length>3&&(a=E9e(n,i),a))throw a;return As("Creating a readable stream configured with the following options: %s.",JSON.stringify(n)),K6.call(this,n),Q6(this,"_destroyed",!1),Ki(this,"_objectMode",n.objectMode),Ki(this,"_sep",n.sep),Ki(this,"_iter",n.iter),Ki(this,"_siter",n.siter),Q6(this,"_i",0),Ki(this,"_prng",w9e(r,e,t,n)),Ki(this,"PRNG",this._prng.PRNG),this}q9e(ke,K6);Nd(ke.prototype,"seed",_9e);Nd(ke.prototype,"seedLength",N9e);b9e(ke.prototype,"state",P9e,T9e);Nd(ke.prototype,"stateLength",L9e);Nd(ke.prototype,"byteLength",R9e);Ki(ke.prototype,"_read",j9e);Ki(ke.prototype,"destroy",M9e);e4.exports=ke});var t4=s(function(Inr,r4){"use strict";var x9e=require("@stdlib/assert/is-plain-object"),A9e=require("@stdlib/object/assign"),G9e=require("@stdlib/string/format"),V9e=Ld();function F9e(r,e,t,i){var n;if(arguments.length>3){if(n=i,!x9e(n))throw new TypeError(G9e("invalid argument. Options argument must be an object. Value: `%s`.",n));n=A9e({},i)}else n={};return n.objectMode=!0,new V9e(r,e,t,n)}r4.exports=F9e});var o4=s(function(knr,u4){"use strict";var i4=require("@stdlib/assert/is-plain-object"),n4=require("@stdlib/object/assign"),a4=require("@stdlib/string/format"),s4=Ld();function W9e(r,e,t,i){var n,a,u;if(n=arguments.length,n===1){if(!i4(r))throw new TypeError(a4("invalid argument. Options argument must be an object. Value: `%s`.",r));a=n4({},r)}else if(n>3){if(!i4(i))throw new TypeError(a4("invalid argument. Options argument must be an object. Value: `%s`.",i));a=n4({},i)}else a={};return n<3?u=o:u=v,u;function o(g,c,l){return new s4(g,c,l,a)}function v(){return new s4(r,e,t,a)}}u4.exports=W9e});var f4=s(function(znr,g4){"use strict";var v4=require("@stdlib/utils/define-nonenumerable-read-only-property"),dh=Ld(),I9e=t4(),k9e=o4();v4(dh,"objectMode",I9e);v4(dh,"factory",k9e);g4.exports=dh});var d4=s(function(Jnr,z9e){z9e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var m4=s(function(Unr,c4){"use strict";var J9e=require("@stdlib/assert/is-plain-object"),xr=require("@stdlib/assert/has-own-property"),U9e=require("@stdlib/assert/is-boolean").isPrimitive,C9e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,l4=require("@stdlib/assert/is-string").isPrimitive,B9e=require("@stdlib/assert/is-positive-integer").isPrimitive,D9e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,aa=require("@stdlib/string/format");function X9e(r,e){return J9e(e)?xr(e,"sep")&&(r.sep=e.sep,!l4(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,!U9e(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,!l4(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,!C9e(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,!D9e(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,!B9e(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))}c4.exports=X9e});var p4=s(function(Cnr,h4){"use strict";var Y9e=require("debug"),H9e=Y9e("random:streams:uniform");h4.exports=H9e});var Pd=s(function(Bnr,O4){"use strict";var S4=require("readable-stream").Readable,y4=require("@stdlib/assert/is-number").isPrimitive,q4=require("@stdlib/math/base/assert/is-nan"),Z9e=require("@stdlib/assert/is-error"),Q9e=require("@stdlib/object/assign"),$9e=require("@stdlib/utils/inherit"),b4=require("@stdlib/utils/define-nonenumerable-property"),en=require("@stdlib/utils/define-nonenumerable-read-only-property"),Rd=require("@stdlib/utils/define-read-only-accessor"),K9e=require("@stdlib/utils/define-read-write-accessor"),eDe=pn().factory,w4=require("@stdlib/buffer/from-string"),rDe=require("@stdlib/utils/next-tick"),lh=require("@stdlib/string/format"),tDe=d4(),iDe=m4(),Gs=p4();function nDe(){return this._prng.seed}function aDe(){return this._prng.seedLength}function sDe(){return this._prng.stateLength}function uDe(){return this._prng.byteLength}function oDe(){return this._prng.state}function vDe(r){this._prng.state=r}function gDe(){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=w4(e):e=w4(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function fDe(r){var e;if(this._destroyed)return Gs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,rDe(t),this;function t(){r&&(Gs("Stream was destroyed due to an error. Error: %s.",Z9e(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(!y4(r)||q4(r))throw new TypeError(lh("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!y4(e)||q4(e))throw new TypeError(lh("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(r>=e)throw new RangeError(lh("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e));if(i=Q9e({},tDe),arguments.length>2&&(n=iDe(i,t),n))throw n;return Gs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),S4.call(this,i),b4(this,"_destroyed",!1),en(this,"_objectMode",i.objectMode),en(this,"_sep",i.sep),en(this,"_iter",i.iter),en(this,"_siter",i.siter),b4(this,"_i",0),en(this,"_prng",eDe(r,e,i)),en(this,"PRNG",this._prng.PRNG),this}$9e(ze,S4);Rd(ze.prototype,"seed",nDe);Rd(ze.prototype,"seedLength",aDe);K9e(ze.prototype,"state",oDe,vDe);Rd(ze.prototype,"stateLength",sDe);Rd(ze.prototype,"byteLength",uDe);en(ze.prototype,"_read",gDe);en(ze.prototype,"destroy",fDe);O4.exports=ze});var _4=s(function(Dnr,E4){"use strict";var dDe=require("@stdlib/assert/is-plain-object"),lDe=require("@stdlib/object/assign"),cDe=require("@stdlib/string/format"),mDe=Pd();function hDe(r,e,t){var i;if(arguments.length>2){if(i=t,!dDe(i))throw new TypeError(cDe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=lDe({},t)}else i={};return i.objectMode=!0,new mDe(r,e,i)}E4.exports=hDe});var j4=s(function(Xnr,T4){"use strict";var N4=require("@stdlib/assert/is-plain-object"),L4=require("@stdlib/object/assign"),R4=require("@stdlib/string/format"),P4=Pd();function pDe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!N4(r))throw new TypeError(R4("invalid argument. Options argument must be an object. Value: `%s`.",r));n=L4({},r)}else if(i>2){if(!N4(t))throw new TypeError(R4("invalid argument. Options argument must be an object. Value: `%s`.",t));n=L4({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new P4(v,g,n)}function o(){return new P4(r,e,n)}}T4.exports=pDe});var A4=s(function(Ynr,x4){"use strict";var M4=require("@stdlib/utils/define-nonenumerable-read-only-property"),ch=Pd(),yDe=_4(),qDe=j4();M4(ch,"objectMode",yDe);M4(ch,"factory",qDe);x4.exports=ch});var G4=s(function(Hnr,bDe){bDe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var W4=s(function(Znr,F4){"use strict";var wDe=require("@stdlib/assert/is-plain-object"),Ar=require("@stdlib/assert/has-own-property"),SDe=require("@stdlib/assert/is-boolean").isPrimitive,ODe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,V4=require("@stdlib/assert/is-string").isPrimitive,EDe=require("@stdlib/assert/is-positive-integer").isPrimitive,_De=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,sa=require("@stdlib/string/format");function NDe(r,e){return wDe(e)?Ar(e,"sep")&&(r.sep=e.sep,!V4(r.sep))?new TypeError(sa("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Ar(e,"objectMode")&&(r.objectMode=e.objectMode,!SDe(r.objectMode))?new TypeError(sa("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Ar(e,"encoding")&&(r.encoding=e.encoding,!V4(r.encoding)&&r.encoding!==null)?new TypeError(sa("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Ar(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!ODe(r.highWaterMark))?new TypeError(sa("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Ar(e,"iter")&&(r.iter=e.iter,!_De(r.iter))?new TypeError(sa("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Ar(e,"siter")&&(r.siter=e.siter,!EDe(r.siter))?new TypeError(sa("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(sa("invalid argument. Options argument must be an object. Value: `%s`.",e))}F4.exports=NDe});var k4=s(function(Qnr,I4){"use strict";var LDe=require("debug"),RDe=LDe("random:streams:weibull");I4.exports=RDe});var jd=s(function($nr,D4){"use strict";var B4=require("readable-stream").Readable,z4=require("@stdlib/assert/is-positive-number").isPrimitive,PDe=require("@stdlib/assert/is-error"),TDe=require("@stdlib/object/assign"),jDe=require("@stdlib/utils/inherit"),J4=require("@stdlib/utils/define-nonenumerable-property"),rn=require("@stdlib/utils/define-nonenumerable-read-only-property"),Td=require("@stdlib/utils/define-read-only-accessor"),MDe=require("@stdlib/utils/define-read-write-accessor"),xDe=yn().factory,U4=require("@stdlib/buffer/from-string"),C4=require("@stdlib/string/format"),ADe=require("@stdlib/utils/next-tick"),GDe=G4(),VDe=W4(),Vs=k4();function FDe(){return this._prng.seed}function WDe(){return this._prng.seedLength}function IDe(){return this._prng.stateLength}function kDe(){return this._prng.byteLength}function zDe(){return this._prng.state}function JDe(r){this._prng.state=r}function UDe(){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=U4(e):e=U4(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function CDe(r){var e;if(this._destroyed)return Vs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,ADe(t),this;function t(){r&&(Vs("Stream was destroyed due to an error. Error: %s.",PDe(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(!z4(r))throw new TypeError(C4("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!z4(e))throw new TypeError(C4("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=TDe({},GDe),arguments.length>2&&(n=VDe(i,t),n))throw n;return Vs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),B4.call(this,i),J4(this,"_destroyed",!1),rn(this,"_objectMode",i.objectMode),rn(this,"_sep",i.sep),rn(this,"_iter",i.iter),rn(this,"_siter",i.siter),J4(this,"_i",0),rn(this,"_prng",xDe(r,e,i)),rn(this,"PRNG",this._prng.PRNG),this}jDe(Je,B4);Td(Je.prototype,"seed",FDe);Td(Je.prototype,"seedLength",WDe);MDe(Je.prototype,"state",zDe,JDe);Td(Je.prototype,"stateLength",IDe);Td(Je.prototype,"byteLength",kDe);rn(Je.prototype,"_read",UDe);rn(Je.prototype,"destroy",CDe);D4.exports=Je});var Y4=s(function(Knr,X4){"use strict";var BDe=require("@stdlib/assert/is-plain-object"),DDe=require("@stdlib/object/assign"),XDe=require("@stdlib/string/format"),YDe=jd();function HDe(r,e,t){var i;if(arguments.length>2){if(i=t,!BDe(i))throw new TypeError(XDe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=DDe({},t)}else i={};return i.objectMode=!0,new YDe(r,e,i)}X4.exports=HDe});var eH=s(function(ear,K4){"use strict";var H4=require("@stdlib/assert/is-plain-object"),Z4=require("@stdlib/object/assign"),Q4=require("@stdlib/string/format"),$4=jd();function ZDe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!H4(r))throw new TypeError(Q4("invalid argument. Options argument must be an object. Value: `%s`.",r));n=Z4({},r)}else if(i>2){if(!H4(t))throw new TypeError(Q4("invalid argument. Options argument must be an object. Value: `%s`.",t));n=Z4({},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)}}K4.exports=ZDe});var iH=s(function(rar,tH){"use strict";var rH=require("@stdlib/utils/define-nonenumerable-read-only-property"),mh=jd(),QDe=Y4(),$De=eH();rH(mh,"objectMode",QDe);rH(mh,"factory",$De);tH.exports=mh});var aH=s(function(tar,nH){"use strict";var P=require("@stdlib/utils/define-read-only-property"),L={};P(L,"arcsine",_k());P(L,"bernoulli",Dk());P(L,"beta",mz());P(L,"betaprime",Wz());P(L,"binomial",s3());P(L,"boxMuller",O3());P(L,"cauchy",B3());P(L,"chi",dJ());P(L,"chisquare",xJ());P(L,"cosine",rU());P(L,"discreteUniform",OU());P(L,"erlang",BU());P(L,"exponential",dC());P(L,"f",GC());P(L,"frechet",iB());P(L,"gamma",NB());P(L,"geometric",XB());P(L,"gumbel",m9());P(L,"hypergeometric",V9());P(L,"improvedZiggurat",K9());P(L,"invgamma",SD());P(L,"kumaraswamy",BD());P(L,"laplace",l8());P(L,"levy",G8());P(L,"logistic",iX());P(L,"lognormal",_X());P(L,"minstd",UX());P(L,"minstdShuffle",u7());P(L,"mt19937",_7());P(L,"negativeBinomial",X7());P(L,"normal",m5());P(L,"pareto1",W5());P(L,"poisson",aY());P(L,"randi",SY());P(L,"randn",IY());P(L,"randu",t6());P(L,"rayleigh",O6());P(L,"t",C6());P(L,"triangular",f4());P(L,"uniform",A4());P(L,"weibull",iH());nH.exports=L});var ph=s(function(iar,uH){"use strict";var sH=require("@stdlib/array/base/assert/is-accessor-array"),hh=nn();function KDe(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 sH(r)?g=r.get(t):g=r[t],sH(i)?c=i.get(a):c=i[a],v.fcn=hh.factory(g,c,o),v;v.fcn=hh.factory(o)}else v.fcn=hh;return v.arity+=2,v}uH.exports=KDe});var vH=s(function(nar,oH){"use strict";var e8e=require("@stdlib/strided/base/nullary"),r8e=require("@stdlib/strided/base/binary"),t8e=ph();function i8e(r,e,t,i,n,a,u,o){var v=t8e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(e8e([a],[r],[u],v.fcn),a):(r8e([e,i,a],[r],[t,n,u],v.fcn),a)}oH.exports=i8e});var fH=s(function(aar,gH){"use strict";var n8e=require("@stdlib/strided/base/nullary").ndarray,a8e=require("@stdlib/strided/base/binary").ndarray,s8e=ph();function u8e(r,e,t,i,n,a,u,o,v,g,c){var l=s8e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(n8e([o],[r],[v],[g],l.fcn),o):(a8e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}gH.exports=u8e});var cH=s(function(sar,lH){"use strict";var o8e=require("@stdlib/utils/define-nonenumerable-read-only-property"),dH=vH(),v8e=fH();o8e(dH,"ndarray",v8e);lH.exports=dH});var yH=s(function(uar,pH){"use strict";var mH=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Md=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Fs=require("@stdlib/utils/define-nonenumerable-read-only-property"),g8e=require("@stdlib/assert/is-function"),f8e=require("@stdlib/assert/is-method-in"),d8e=require("@stdlib/assert/is-plain-object"),l8e=require("@stdlib/utils/constant-function"),c8e=require("@stdlib/utils/noop"),hH=require("@stdlib/strided/base/unary"),yh=require("@stdlib/string/format");function m8e(r){if(!g8e(r))throw new TypeError(yh("invalid argument. First argument must be a function. Value: `%s`.",r));if(!f8e(r,"factory"))throw new TypeError(yh("invalid argument. First argument must have a `%s` method.","factory"));return e;function e(){var t,i;if(arguments.length>0){if(i=arguments[0],!d8e(i))throw new TypeError(yh("invalid argument. Options argument must be an object. Value: `%s`.",i));t=r.factory(i)}else i={},t=r;return i&&i.prng?(Fs(n,"seed",null),Fs(n,"seedLength",null),mH(n,"state",l8e(null),c8e),Fs(n,"stateLength",null),Fs(n,"byteLength",null)):(Md(n,"seed",u),Md(n,"seedLength",o),mH(n,"state",c,l),Md(n,"stateLength",v),Md(n,"byteLength",g)),Fs(n,"PRNG",t.PRNG),Fs(n,"ndarray",a),n;function n(m,h,p,d,f){return hH([h,d],[m],[p,f],t),d}function a(m,h,p,d,f,y,q){return hH.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}}}pH.exports=m8e});var Eu=s(function(oar,qH){"use strict";var h8e=yH();qH.exports=h8e});var qh=s(function(gar,bH){"use strict";var p8e=Eu(),y8e=an(),q8e=p8e(y8e);bH.exports=q8e});var SH=s(function(far,wH){"use strict";var b8e=qh(),w8e=b8e();wH.exports=w8e});var _H=s(function(dar,EH){"use strict";var S8e=require("@stdlib/utils/define-nonenumerable-read-only-property"),OH=SH(),O8e=qh();S8e(OH,"factory",O8e);EH.exports=OH});var wh=s(function(lar,LH){"use strict";var NH=require("@stdlib/array/base/assert/is-accessor-array"),bh=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 NH(r)?g=r.get(t):g=r[t],NH(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}LH.exports=E8e});var PH=s(function(car,RH){"use strict";var _8e=require("@stdlib/strided/base/nullary"),N8e=require("@stdlib/strided/base/binary"),L8e=wh();function R8e(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?(_8e([a],[r],[u],v.fcn),a):(N8e([e,i,a],[r],[t,n,u],v.fcn),a)}RH.exports=R8e});var jH=s(function(mar,TH){"use strict";var P8e=require("@stdlib/strided/base/nullary").ndarray,T8e=require("@stdlib/strided/base/binary").ndarray,j8e=wh();function M8e(r,e,t,i,n,a,u,o,v,g,c){var l=j8e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(P8e([o],[r],[v],[g],l.fcn),o):(T8e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}TH.exports=M8e});var AH=s(function(har,xH){"use strict";var x8e=require("@stdlib/utils/define-nonenumerable-read-only-property"),MH=PH(),A8e=jH();x8e(MH,"ndarray",A8e);xH.exports=MH});var Oh=s(function(par,VH){"use strict";var GH=require("@stdlib/array/base/assert/is-accessor-array"),Sh=on();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 GH(r)?g=r.get(t):g=r[t],GH(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}VH.exports=G8e});var WH=s(function(yar,FH){"use strict";var V8e=require("@stdlib/strided/base/nullary"),F8e=require("@stdlib/strided/base/binary"),W8e=Oh();function I8e(r,e,t,i,n,a,u,o){var v=W8e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(V8e([a],[r],[u],v.fcn),a):(F8e([e,i,a],[r],[t,n,u],v.fcn),a)}FH.exports=I8e});var kH=s(function(qar,IH){"use strict";var k8e=require("@stdlib/strided/base/nullary").ndarray,z8e=require("@stdlib/strided/base/binary").ndarray,J8e=Oh();function U8e(r,e,t,i,n,a,u,o,v,g,c){var l=J8e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(k8e([o],[r],[v],[g],l.fcn),o):(z8e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}IH.exports=U8e});var UH=s(function(bar,JH){"use strict";var C8e=require("@stdlib/utils/define-nonenumerable-read-only-property"),zH=WH(),B8e=kH();C8e(zH,"ndarray",B8e);JH.exports=zH});var Eh=s(function(war,CH){"use strict";var D8e=Eu(),X8e=vn(),Y8e=D8e(X8e);CH.exports=Y8e});var DH=s(function(Sar,BH){"use strict";var H8e=Eh(),Z8e=H8e();BH.exports=Z8e});var HH=s(function(Oar,YH){"use strict";var Q8e=require("@stdlib/utils/define-nonenumerable-read-only-property"),XH=DH(),$8e=Eh();Q8e(XH,"factory",$8e);YH.exports=XH});var _h=s(function(Ear,ZH){"use strict";var K8e=Eu(),eXe=Xe(),rXe=K8e(eXe);ZH.exports=rXe});var $H=s(function(_ar,QH){"use strict";var tXe=_h(),iXe=tXe();QH.exports=iXe});var rZ=s(function(Nar,eZ){"use strict";var nXe=require("@stdlib/utils/define-nonenumerable-read-only-property"),KH=$H(),aXe=_h();nXe(KH,"factory",aXe);eZ.exports=KH});var Lh=s(function(Lar,iZ){"use strict";var tZ=require("@stdlib/array/base/assert/is-accessor-array"),Nh=gn();function sXe(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=Nh.factory(g,c,o),v;v.fcn=Nh.factory(o)}else v.fcn=Nh;return v.arity+=2,v}iZ.exports=sXe});var aZ=s(function(Rar,nZ){"use strict";var uXe=require("@stdlib/strided/base/nullary"),oXe=require("@stdlib/strided/base/binary"),vXe=Lh();function gXe(r,e,t,i,n,a,u,o){var v=vXe(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(uXe([a],[r],[u],v.fcn),a):(oXe([e,i,a],[r],[t,n,u],v.fcn),a)}nZ.exports=gXe});var uZ=s(function(Par,sZ){"use strict";var fXe=require("@stdlib/strided/base/nullary").ndarray,dXe=require("@stdlib/strided/base/binary").ndarray,lXe=Lh();function cXe(r,e,t,i,n,a,u,o,v,g,c){var l=lXe(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(fXe([o],[r],[v],[g],l.fcn),o):(dXe([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}sZ.exports=cXe});var gZ=s(function(Tar,vZ){"use strict";var mXe=require("@stdlib/utils/define-nonenumerable-read-only-property"),oZ=aZ(),hXe=uZ();mXe(oZ,"ndarray",hXe);vZ.exports=oZ});var Ph=s(function(jar,dZ){"use strict";var fZ=require("@stdlib/array/base/assert/is-accessor-array"),Rh=fn();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 fZ(r)?g=r.get(t):g=r[t],fZ(i)?c=i.get(a):c=i[a],v.fcn=Rh.factory(g,c,o),v;v.fcn=Rh.factory(o)}else v.fcn=Rh;return v.arity+=2,v}dZ.exports=pXe});var cZ=s(function(Mar,lZ){"use strict";var yXe=require("@stdlib/strided/base/nullary"),qXe=require("@stdlib/strided/base/binary"),bXe=Ph();function wXe(r,e,t,i,n,a,u,o){var v=bXe(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(yXe([a],[r],[u],v.fcn),a):(qXe([e,i,a],[r],[t,n,u],v.fcn),a)}lZ.exports=wXe});var hZ=s(function(xar,mZ){"use strict";var SXe=require("@stdlib/strided/base/nullary").ndarray,OXe=require("@stdlib/strided/base/binary").ndarray,EXe=Ph();function _Xe(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?(SXe([o],[r],[v],[g],l.fcn),o):(OXe([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}mZ.exports=_Xe});var qZ=s(function(Aar,yZ){"use strict";var NXe=require("@stdlib/utils/define-nonenumerable-read-only-property"),pZ=cZ(),LXe=hZ();NXe(pZ,"ndarray",LXe);yZ.exports=pZ});var Th=s(function(Gar,bZ){"use strict";var RXe=Eu(),PXe=dn(),TXe=RXe(PXe);bZ.exports=TXe});var SZ=s(function(Var,wZ){"use strict";var jXe=Th(),MXe=jXe();wZ.exports=MXe});var _Z=s(function(Far,EZ){"use strict";var xXe=require("@stdlib/utils/define-nonenumerable-read-only-property"),OZ=SZ(),AXe=Th();xXe(OZ,"factory",AXe);EZ.exports=OZ});var Mh=s(function(War,LZ){"use strict";var NZ=require("@stdlib/array/base/assert/is-accessor-array"),jh=Ce();function GXe(r,e,t,i,n,a,u,o){var v,g,c;if(v={arity:0,fcn:null},u){if(e===0&&n===0)return NZ(r)?g=r.get(t):g=r[t],NZ(i)?c=i.get(a):c=i[a],v.fcn=jh.factory(g,c,o),v;v.fcn=jh.factory(o)}else v.fcn=jh;return v.arity+=2,v}LZ.exports=GXe});var PZ=s(function(Iar,RZ){"use strict";var VXe=require("@stdlib/strided/base/nullary"),FXe=require("@stdlib/strided/base/binary"),WXe=Mh();function IXe(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?(VXe([a],[r],[u],v.fcn),a):(FXe([e,i,a],[r],[t,n,u],v.fcn),a)}RZ.exports=IXe});var jZ=s(function(kar,TZ){"use strict";var kXe=require("@stdlib/strided/base/nullary").ndarray,zXe=require("@stdlib/strided/base/binary").ndarray,JXe=Mh();function UXe(r,e,t,i,n,a,u,o,v,g,c){var l=JXe(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(kXe([o],[r],[v],[g],l.fcn),o):(zXe([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}TZ.exports=UXe});var AZ=s(function(zar,xZ){"use strict";var CXe=require("@stdlib/utils/define-nonenumerable-read-only-property"),MZ=PZ(),BXe=jZ();CXe(MZ,"ndarray",BXe);xZ.exports=MZ});var Ah=s(function(Jar,VZ){"use strict";var GZ=require("@stdlib/array/base/assert/is-accessor-array"),xh=ln();function DXe(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 GZ(r)?g=r.get(t):g=r[t],GZ(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}VZ.exports=DXe});var WZ=s(function(Uar,FZ){"use strict";var XXe=require("@stdlib/strided/base/nullary"),YXe=require("@stdlib/strided/base/binary"),HXe=Ah();function ZXe(r,e,t,i,n,a,u,o){var v=HXe(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(XXe([a],[r],[u],v.fcn),a):(YXe([e,i,a],[r],[t,n,u],v.fcn),a)}FZ.exports=ZXe});var kZ=s(function(Car,IZ){"use strict";var QXe=require("@stdlib/strided/base/nullary").ndarray,$Xe=require("@stdlib/strided/base/binary").ndarray,KXe=Ah();function e7e(r,e,t,i,n,a,u,o,v,g,c){var l=KXe(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(QXe([o],[r],[v],[g],l.fcn),o):($Xe([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}IZ.exports=e7e});var UZ=s(function(Bar,JZ){"use strict";var r7e=require("@stdlib/utils/define-nonenumerable-read-only-property"),zZ=WZ(),t7e=kZ();r7e(zZ,"ndarray",t7e);JZ.exports=zZ});var Vh=s(function(Dar,BZ){"use strict";var CZ=require("@stdlib/array/base/assert/is-accessor-array"),Gh=cn();function i7e(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=Gh.factory(g,c,o),v;v.fcn=Gh.factory(o)}else v.fcn=Gh;return v.arity+=2,v}BZ.exports=i7e});var XZ=s(function(Xar,DZ){"use strict";var n7e=require("@stdlib/strided/base/nullary"),a7e=require("@stdlib/strided/base/binary"),s7e=Vh();function u7e(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?(n7e([a],[r],[u],v.fcn),a):(a7e([e,i,a],[r],[t,n,u],v.fcn),a)}DZ.exports=u7e});var HZ=s(function(Yar,YZ){"use strict";var o7e=require("@stdlib/strided/base/nullary").ndarray,v7e=require("@stdlib/strided/base/binary").ndarray,g7e=Vh();function f7e(r,e,t,i,n,a,u,o,v,g,c){var l=g7e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(o7e([o],[r],[v],[g],l.fcn),o):(v7e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}YZ.exports=f7e});var $Z=s(function(Har,QZ){"use strict";var d7e=require("@stdlib/utils/define-nonenumerable-read-only-property"),ZZ=XZ(),l7e=HZ();d7e(ZZ,"ndarray",l7e);QZ.exports=ZZ});var rQ=s(function(Zar,eQ){"use strict";var c7e=require("@stdlib/strided/base/nullary"),KZ=$();function m7e(r,e,t,i){var n;return arguments.length>3?n=KZ.factory(i):n=KZ,c7e([e],[r],[t],n),e}eQ.exports=m7e});var nQ=s(function(Qar,iQ){"use strict";var h7e=require("@stdlib/strided/base/nullary").ndarray,tQ=$();function p7e(r,e,t,i,n){var a;return arguments.length>4?a=tQ.factory(n):a=tQ,h7e([e],[r],[t],[i],a),e}iQ.exports=p7e});var uQ=s(function($ar,sQ){"use strict";var y7e=require("@stdlib/strided/base/nullary"),aQ=$();function q7e(r,e,t,i){var n;return arguments.length>3?n=aQ.factory(i):n=aQ,y7e([e],[r],[t],n.normalized),e}sQ.exports=q7e});var gQ=s(function(Kar,vQ){"use strict";var b7e=require("@stdlib/strided/base/nullary").ndarray,oQ=$();function w7e(r,e,t,i,n){var a;return arguments.length>4?a=oQ.factory(n):a=oQ,b7e([e],[r],[t],[i],a.normalized),e}vQ.exports=w7e});var lQ=s(function(esr,dQ){"use strict";var Fh=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wh=rQ(),S7e=nQ(),fQ=uQ(),O7e=gQ();Fh(Wh,"ndarray",S7e);Fh(Wh,"normalized",fQ);Fh(fQ,"ndarray",O7e);dQ.exports=Wh});var hQ=s(function(rsr,mQ){"use strict";var E7e=require("@stdlib/strided/base/nullary"),cQ=ee();function _7e(r,e,t,i){var n;return arguments.length>3?n=cQ.factory(i):n=cQ,E7e([e],[r],[t],n),e}mQ.exports=_7e});var qQ=s(function(tsr,yQ){"use strict";var N7e=require("@stdlib/strided/base/nullary").ndarray,pQ=ee();function L7e(r,e,t,i,n){var a;return arguments.length>4?a=pQ.factory(n):a=pQ,N7e([e],[r],[t],[i],a),e}yQ.exports=L7e});var SQ=s(function(isr,wQ){"use strict";var R7e=require("@stdlib/strided/base/nullary"),bQ=ee();function P7e(r,e,t,i){var n;return arguments.length>3?n=bQ.factory(i):n=bQ,R7e([e],[r],[t],n.normalized),e}wQ.exports=P7e});var _Q=s(function(nsr,EQ){"use strict";var T7e=require("@stdlib/strided/base/nullary").ndarray,OQ=ee();function j7e(r,e,t,i,n){var a;return arguments.length>4?a=OQ.factory(n):a=OQ,T7e([e],[r],[t],[i],a.normalized),e}EQ.exports=j7e});var RQ=s(function(asr,LQ){"use strict";var Ih=require("@stdlib/utils/define-nonenumerable-read-only-property"),kh=hQ(),M7e=qQ(),NQ=SQ(),x7e=_Q();Ih(kh,"ndarray",M7e);Ih(kh,"normalized",NQ);Ih(NQ,"ndarray",x7e);LQ.exports=kh});var jQ=s(function(ssr,TQ){"use strict";var A7e=require("@stdlib/strided/base/nullary"),PQ=T();function G7e(r,e,t,i){var n;return arguments.length>3?n=PQ.factory(i):n=PQ,A7e([e],[r],[t],n),e}TQ.exports=G7e});var AQ=s(function(usr,xQ){"use strict";var V7e=require("@stdlib/strided/base/nullary").ndarray,MQ=T();function F7e(r,e,t,i,n){var a;return arguments.length>4?a=MQ.factory(n):a=MQ,V7e([e],[r],[t],[i],a),e}xQ.exports=F7e});var FQ=s(function(osr,VQ){"use strict";var W7e=require("@stdlib/strided/base/nullary"),GQ=T();function I7e(r,e,t,i){var n;return arguments.length>3?n=GQ.factory(i):n=GQ,W7e([e],[r],[t],n.normalized),e}VQ.exports=I7e});var kQ=s(function(vsr,IQ){"use strict";var k7e=require("@stdlib/strided/base/nullary").ndarray,WQ=T();function z7e(r,e,t,i,n){var a;return arguments.length>4?a=WQ.factory(n):a=WQ,k7e([e],[r],[t],[i],a.normalized),e}IQ.exports=z7e});var UQ=s(function(gsr,JQ){"use strict";var zh=require("@stdlib/utils/define-nonenumerable-read-only-property"),Jh=jQ(),J7e=AQ(),zQ=FQ(),U7e=kQ();zh(Jh,"ndarray",J7e);zh(Jh,"normalized",zQ);zh(zQ,"ndarray",U7e);JQ.exports=Jh});var Ch=s(function(fsr,BQ){"use strict";var CQ=require("@stdlib/array/base/assert/is-accessor-array"),Uh=hn();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 CQ(r)?g=r.get(t):g=r[t],CQ(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}BQ.exports=C7e});var XQ=s(function(dsr,DQ){"use strict";var B7e=require("@stdlib/strided/base/nullary"),D7e=require("@stdlib/strided/base/binary"),X7e=Ch();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)}DQ.exports=Y7e});var HQ=s(function(lsr,YQ){"use strict";var H7e=require("@stdlib/strided/base/nullary").ndarray,Z7e=require("@stdlib/strided/base/binary").ndarray,Q7e=Ch();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)}YQ.exports=$7e});var $Q=s(function(csr,QQ){"use strict";var K7e=require("@stdlib/utils/define-nonenumerable-read-only-property"),ZQ=XQ(),e5e=HQ();K7e(ZQ,"ndarray",e5e);QQ.exports=ZQ});var r$=s(function(msr,e$){"use strict";var r5e=require("@stdlib/strided/base/nullary"),KQ=Tt();function t5e(r,e,t,i){var n;return arguments.length>3?n=KQ.factory(i):n=KQ,r5e([e],[r],[t],n),e}e$.exports=t5e});var n$=s(function(hsr,i$){"use strict";var i5e=require("@stdlib/strided/base/nullary").ndarray,t$=Tt();function n5e(r,e,t,i,n){var a;return arguments.length>4?a=t$.factory(n):a=t$,i5e([e],[r],[t],[i],a),e}i$.exports=n5e});var u$=s(function(psr,s$){"use strict";var a5e=require("@stdlib/utils/define-nonenumerable-read-only-property"),a$=r$(),s5e=n$();a5e(a$,"ndarray",s5e);s$.exports=a$});var Dh=s(function(ysr,v$){"use strict";var o$=require("@stdlib/array/base/assert/is-accessor-array"),Bh=pn();function u5e(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 o$(r)?g=r.get(t):g=r[t],o$(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}v$.exports=u5e});var f$=s(function(qsr,g$){"use strict";var o5e=require("@stdlib/strided/base/nullary"),v5e=require("@stdlib/strided/base/binary"),g5e=Dh();function f5e(r,e,t,i,n,a,u,o){var v=g5e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(o5e([a],[r],[u],v.fcn),a):(v5e([e,i,a],[r],[t,n,u],v.fcn),a)}g$.exports=f5e});var l$=s(function(bsr,d$){"use strict";var d5e=require("@stdlib/strided/base/nullary").ndarray,l5e=require("@stdlib/strided/base/binary").ndarray,c5e=Dh();function m5e(r,e,t,i,n,a,u,o,v,g,c){var l=c5e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(d5e([o],[r],[v],[g],l.fcn),o):(l5e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}d$.exports=m5e});var h$=s(function(wsr,m$){"use strict";var h5e=require("@stdlib/utils/define-nonenumerable-read-only-property"),c$=f$(),p5e=l$();h5e(c$,"ndarray",p5e);m$.exports=c$});var Yh=s(function(Ssr,y$){"use strict";var p$=require("@stdlib/array/base/assert/is-accessor-array"),Xh=yn();function y5e(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 p$(r)?g=r.get(t):g=r[t],p$(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}y$.exports=y5e});var b$=s(function(Osr,q$){"use strict";var q5e=require("@stdlib/strided/base/nullary"),b5e=require("@stdlib/strided/base/binary"),w5e=Yh();function S5e(r,e,t,i,n,a,u,o){var v=w5e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(q5e([a],[r],[u],v.fcn),a):(b5e([e,i,a],[r],[t,n,u],v.fcn),a)}q$.exports=S5e});var S$=s(function(Esr,w$){"use strict";var O5e=require("@stdlib/strided/base/nullary").ndarray,E5e=require("@stdlib/strided/base/binary").ndarray,_5e=Yh();function N5e(r,e,t,i,n,a,u,o,v,g,c){var l=_5e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(O5e([o],[r],[v],[g],l.fcn),o):(E5e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}w$.exports=N5e});var _$=s(function(_sr,E$){"use strict";var L5e=require("@stdlib/utils/define-nonenumerable-read-only-property"),O$=b$(),R5e=S$();L5e(O$,"ndarray",R5e);E$.exports=O$});var L$=s(function(Nsr,N$){"use strict";var z=require("@stdlib/utils/define-read-only-property"),I={};z(I,"arcsine",cH());z(I,"bernoulli",_H());z(I,"beta",AH());z(I,"betaprime",UH());z(I,"chi",HH());z(I,"chisquare",rZ());z(I,"cosine",gZ());z(I,"discreteUniform",qZ());z(I,"exponential",_Z());z(I,"gamma",AZ());z(I,"invgamma",UZ());z(I,"lognormal",$Z());z(I,"minstd",lQ());z(I,"minstdShuffle",RQ());z(I,"mt19937",UQ());z(I,"normal",$Q());z(I,"randu",u$());z(I,"uniform",h$());z(I,"weibull",_$());N$.exports=I});var ua=require("@stdlib/utils/define-read-only-property"),tn={};ua(tn,"array",px());ua(tn,"base",o1());ua(tn,"iterators",yI());ua(tn,"sample",JI());ua(tn,"shuffle",tk());ua(tn,"streams",aH());ua(tn,"strided",L$());module.exports=tn; /** * @license Apache-2.0 * diff --git a/dist/index.js.map b/dist/index.js.map index 64c4efcd..c72fba5c 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1,7 +1,7 @@ { "version": 3, - "sources": ["../array/tools/binary/lib/validate.js", "../array/tools/binary/lib/main.js", "../array/tools/binary/lib/index.js", "../array/tools/nullary/lib/validate.js", "../array/tools/nullary/lib/main.js", "../array/tools/nullary/lib/index.js", "../array/tools/binary-factory/lib/main.js", "../array/tools/binary-factory/lib/index.js", "../base/mt19937/lib/rand_uint32.js", "../base/mt19937/lib/factory.js", "../base/mt19937/lib/main.js", "../base/mt19937/lib/index.js", "../base/arcsine/lib/validate.js", "../base/arcsine/lib/arcsine.js", "../base/arcsine/lib/factory.js", "../base/arcsine/lib/main.js", "../base/arcsine/lib/index.js", "../array/arcsine/lib/factory.js", "../array/arcsine/lib/main.js", "../array/arcsine/lib/index.js", "../array/tools/unary/lib/validate.js", "../array/tools/unary/lib/main.js", "../array/tools/unary/lib/index.js", "../array/tools/unary-factory/lib/main.js", "../array/tools/unary-factory/lib/index.js", "../base/bernoulli/lib/factory.js", "../base/bernoulli/lib/main.js", "../base/bernoulli/lib/index.js", "../array/bernoulli/lib/factory.js", "../array/bernoulli/lib/main.js", "../array/bernoulli/lib/index.js", "../base/improved-ziggurat/lib/coords_array.js", "../base/improved-ziggurat/lib/ratio_array.js", "../base/improved-ziggurat/lib/sample_tail.js", "../base/improved-ziggurat/lib/improved_ziggurat.js", "../base/improved-ziggurat/lib/factory.js", "../base/improved-ziggurat/lib/main.js", "../base/improved-ziggurat/lib/index.js", "../base/beta/lib/validate.js", "../base/beta/lib/standard_gamma.js", "../base/beta/lib/sample1.js", "../base/beta/lib/sample2.js", "../base/beta/lib/sample3.js", "../base/beta/lib/beta.js", "../base/beta/lib/factory.js", "../base/beta/lib/main.js", "../base/beta/lib/index.js", "../array/beta/lib/factory.js", "../array/beta/lib/main.js", "../array/beta/lib/index.js", "../base/gamma/lib/validate.js", "../base/gamma/lib/gamma.js", "../base/gamma/lib/factory.js", "../base/gamma/lib/main.js", "../base/gamma/lib/index.js", "../base/betaprime/lib/validate.js", "../base/betaprime/lib/betaprime.js", "../base/betaprime/lib/factory.js", "../base/betaprime/lib/main.js", "../base/betaprime/lib/index.js", "../array/betaprime/lib/factory.js", "../array/betaprime/lib/main.js", "../array/betaprime/lib/index.js", "../base/binomial/lib/validate.js", "../base/binomial/lib/sample1.js", "../base/binomial/lib/correction.js", "../base/binomial/lib/sample2.js", "../base/binomial/lib/binomial.js", "../base/binomial/lib/factory.js", "../base/binomial/lib/main.js", "../base/binomial/lib/index.js", "../array/binomial/lib/factory.js", "../array/binomial/lib/main.js", "../array/binomial/lib/index.js", "../base/cauchy/lib/validate.js", "../base/cauchy/lib/cauchy.js", "../base/cauchy/lib/factory.js", "../base/cauchy/lib/main.js", "../base/cauchy/lib/index.js", "../array/cauchy/lib/factory.js", "../array/cauchy/lib/main.js", "../array/cauchy/lib/index.js", "../base/chisquare/lib/factory.js", "../base/chisquare/lib/main.js", "../base/chisquare/lib/index.js", "../base/chi/lib/factory.js", "../base/chi/lib/main.js", "../base/chi/lib/index.js", "../array/chi/lib/factory.js", "../array/chi/lib/main.js", "../array/chi/lib/index.js", "../array/chisquare/lib/factory.js", "../array/chisquare/lib/main.js", "../array/chisquare/lib/index.js", "../base/cosine/lib/validate.js", "../base/cosine/lib/cosine.js", "../base/cosine/lib/factory.js", "../base/cosine/lib/main.js", "../base/cosine/lib/index.js", "../array/cosine/lib/factory.js", "../array/cosine/lib/main.js", "../array/cosine/lib/index.js", "../base/discrete-uniform/lib/validate.js", "../base/discrete-uniform/lib/discrete_uniform.js", "../base/discrete-uniform/lib/factory.js", "../base/discrete-uniform/lib/main.js", "../base/discrete-uniform/lib/index.js", "../array/discrete-uniform/lib/factory.js", "../array/discrete-uniform/lib/main.js", "../array/discrete-uniform/lib/index.js", "../base/erlang/lib/validate.js", "../base/erlang/lib/erlang.js", "../base/erlang/lib/factory.js", "../base/erlang/lib/main.js", "../base/erlang/lib/index.js", "../array/erlang/lib/factory.js", "../array/erlang/lib/main.js", "../array/erlang/lib/index.js", "../base/exponential/lib/exponential.js", "../base/exponential/lib/factory.js", "../base/exponential/lib/main.js", "../base/exponential/lib/index.js", "../array/exponential/lib/factory.js", "../array/exponential/lib/main.js", "../array/exponential/lib/index.js", "../base/f/lib/validate.js", "../base/f/lib/f.js", "../base/f/lib/factory.js", "../base/f/lib/main.js", "../base/f/lib/index.js", "../array/f/lib/factory.js", "../array/f/lib/main.js", "../array/f/lib/index.js", "../array/tools/ternary/lib/validate.js", "../array/tools/ternary/lib/main.js", "../array/tools/ternary/lib/index.js", "../array/tools/ternary-factory/lib/main.js", "../array/tools/ternary-factory/lib/index.js", "../base/frechet/lib/validate.js", "../base/frechet/lib/frechet.js", "../base/frechet/lib/factory.js", "../base/frechet/lib/main.js", "../base/frechet/lib/index.js", "../array/frechet/lib/factory.js", "../array/frechet/lib/main.js", "../array/frechet/lib/index.js", "../array/gamma/lib/factory.js", "../array/gamma/lib/main.js", "../array/gamma/lib/index.js", "../base/geometric/lib/geometric.js", "../base/geometric/lib/factory.js", "../base/geometric/lib/main.js", "../base/geometric/lib/index.js", "../array/geometric/lib/factory.js", "../array/geometric/lib/main.js", "../array/geometric/lib/index.js", "../base/gumbel/lib/validate.js", "../base/gumbel/lib/gumbel.js", "../base/gumbel/lib/factory.js", "../base/gumbel/lib/main.js", "../base/gumbel/lib/index.js", "../array/gumbel/lib/factory.js", "../array/gumbel/lib/main.js", "../array/gumbel/lib/index.js", "../base/hypergeometric/lib/validate.js", "../base/hypergeometric/lib/hin.js", "../base/hypergeometric/lib/hypergeometric.js", "../base/hypergeometric/lib/factory.js", "../base/hypergeometric/lib/main.js", "../base/hypergeometric/lib/index.js", "../array/hypergeometric/lib/factory.js", "../array/hypergeometric/lib/main.js", "../array/hypergeometric/lib/index.js", "../base/invgamma/lib/validate.js", "../base/invgamma/lib/factory.js", "../base/invgamma/lib/main.js", "../base/invgamma/lib/index.js", "../array/invgamma/lib/factory.js", "../array/invgamma/lib/main.js", "../array/invgamma/lib/index.js", "../base/kumaraswamy/lib/validate.js", "../base/kumaraswamy/lib/kumaraswamy.js", "../base/kumaraswamy/lib/factory.js", "../base/kumaraswamy/lib/main.js", "../base/kumaraswamy/lib/index.js", "../array/kumaraswamy/lib/factory.js", "../array/kumaraswamy/lib/main.js", "../array/kumaraswamy/lib/index.js", "../base/laplace/lib/validate.js", "../base/laplace/lib/laplace.js", "../base/laplace/lib/factory.js", "../base/laplace/lib/main.js", "../base/laplace/lib/index.js", "../array/laplace/lib/factory.js", "../array/laplace/lib/main.js", "../array/laplace/lib/index.js", "../base/levy/lib/validate.js", "../base/levy/lib/levy.js", "../base/levy/lib/factory.js", "../base/levy/lib/main.js", "../base/levy/lib/index.js", "../array/levy/lib/factory.js", "../array/levy/lib/main.js", "../array/levy/lib/index.js", "../base/logistic/lib/validate.js", "../base/logistic/lib/logistic.js", "../base/logistic/lib/factory.js", "../base/logistic/lib/main.js", "../base/logistic/lib/index.js", "../array/logistic/lib/factory.js", "../array/logistic/lib/main.js", "../array/logistic/lib/index.js", "../base/lognormal/lib/validate.js", "../base/lognormal/lib/lognormal.js", "../base/lognormal/lib/factory.js", "../base/lognormal/lib/main.js", "../base/lognormal/lib/index.js", "../array/lognormal/lib/factory.js", "../array/lognormal/lib/main.js", "../array/lognormal/lib/index.js", "../base/minstd/lib/rand_int32.js", "../base/minstd/lib/factory.js", "../base/minstd/lib/main.js", "../base/minstd/lib/index.js", "../array/minstd/lib/defaults.json", "../array/minstd/lib/validate.js", "../array/minstd/lib/factory.js", "../array/minstd/lib/main.js", "../array/minstd/lib/index.js", "../base/minstd-shuffle/lib/create_table.js", "../base/minstd-shuffle/lib/rand_int32.js", "../base/minstd-shuffle/lib/factory.js", "../base/minstd-shuffle/lib/main.js", "../base/minstd-shuffle/lib/index.js", "../array/minstd-shuffle/lib/defaults.json", "../array/minstd-shuffle/lib/validate.js", "../array/minstd-shuffle/lib/factory.js", "../array/minstd-shuffle/lib/main.js", "../array/minstd-shuffle/lib/index.js", "../array/mt19937/lib/defaults.json", "../array/mt19937/lib/validate.js", "../array/mt19937/lib/factory.js", "../array/mt19937/lib/main.js", "../array/mt19937/lib/index.js", "../base/poisson/lib/knuth.js", "../base/poisson/lib/rejection.js", "../base/poisson/lib/poisson.js", "../base/poisson/lib/factory.js", "../base/poisson/lib/main.js", "../base/poisson/lib/index.js", "../base/negative-binomial/lib/validate.js", "../base/negative-binomial/lib/factory.js", "../base/negative-binomial/lib/main.js", "../base/negative-binomial/lib/index.js", "../array/negative-binomial/lib/factory.js", "../array/negative-binomial/lib/main.js", "../array/negative-binomial/lib/index.js", "../base/normal/lib/validate.js", "../base/normal/lib/normal.js", "../base/normal/lib/factory.js", "../base/normal/lib/main.js", "../base/normal/lib/index.js", "../array/normal/lib/factory.js", "../array/normal/lib/main.js", "../array/normal/lib/index.js", "../base/pareto-type1/lib/validate.js", "../base/pareto-type1/lib/pareto.js", "../base/pareto-type1/lib/factory.js", "../base/pareto-type1/lib/main.js", "../base/pareto-type1/lib/index.js", "../array/pareto-type1/lib/factory.js", "../array/pareto-type1/lib/main.js", "../array/pareto-type1/lib/index.js", "../array/poisson/lib/factory.js", "../array/poisson/lib/main.js", "../array/poisson/lib/index.js", "../base/randu/lib/defaults.json", "../base/randu/lib/prngs.js", "../base/randu/lib/factory.js", "../base/randu/lib/main.js", "../base/randu/lib/index.js", "../array/randu/lib/defaults.json", "../array/randu/lib/validate.js", "../array/randu/lib/factory.js", "../array/randu/lib/main.js", "../array/randu/lib/index.js", "../base/rayleigh/lib/rayleigh.js", "../base/rayleigh/lib/factory.js", "../base/rayleigh/lib/main.js", "../base/rayleigh/lib/index.js", "../array/rayleigh/lib/factory.js", "../array/rayleigh/lib/main.js", "../array/rayleigh/lib/index.js", "../base/t/lib/factory.js", "../base/t/lib/main.js", "../base/t/lib/index.js", "../array/t/lib/factory.js", "../array/t/lib/main.js", "../array/t/lib/index.js", "../base/triangular/lib/validate.js", "../base/triangular/lib/triangular.js", "../base/triangular/lib/factory.js", "../base/triangular/lib/main.js", "../base/triangular/lib/index.js", "../array/triangular/lib/factory.js", "../array/triangular/lib/main.js", "../array/triangular/lib/index.js", "../base/uniform/lib/validate.js", "../base/uniform/lib/uniform.js", "../base/uniform/lib/factory.js", "../base/uniform/lib/main.js", "../base/uniform/lib/index.js", "../array/uniform/lib/factory.js", "../array/uniform/lib/main.js", "../array/uniform/lib/index.js", "../base/weibull/lib/validate.js", "../base/weibull/lib/weibull.js", "../base/weibull/lib/factory.js", "../base/weibull/lib/main.js", "../base/weibull/lib/index.js", "../array/weibull/lib/factory.js", "../array/weibull/lib/main.js", "../array/weibull/lib/index.js", "../array/lib/index.js", "../base/box-muller/lib/randn.js", "../base/box-muller/lib/min.js", "../base/box-muller/lib/max.js", "../base/box-muller/lib/factory.js", "../base/box-muller/lib/main.js", "../base/box-muller/lib/index.js", "../base/randi/lib/defaults.json", "../base/randi/lib/prngs.js", "../base/randi/lib/factory.js", "../base/randi/lib/main.js", "../base/randi/lib/index.js", "../base/randn/lib/defaults.json", "../base/randn/lib/prngs.js", "../base/randn/lib/factory.js", "../base/randn/lib/main.js", "../base/randn/lib/index.js", "../base/reviver/lib/prngs.js", "../base/reviver/lib/main.js", "../base/reviver/lib/index.js", "../base/lib/index.js", "../iter/arcsine/lib/main.js", "../iter/arcsine/lib/index.js", "../iter/bernoulli/lib/main.js", "../iter/bernoulli/lib/index.js", "../iter/beta/lib/main.js", "../iter/beta/lib/index.js", "../iter/betaprime/lib/main.js", "../iter/betaprime/lib/index.js", "../iter/binomial/lib/main.js", "../iter/binomial/lib/index.js", "../iter/box-muller/lib/main.js", "../iter/box-muller/lib/index.js", "../iter/cauchy/lib/main.js", "../iter/cauchy/lib/index.js", "../iter/chi/lib/main.js", "../iter/chi/lib/index.js", "../iter/chisquare/lib/main.js", "../iter/chisquare/lib/index.js", "../iter/cosine/lib/main.js", "../iter/cosine/lib/index.js", "../iter/discrete-uniform/lib/main.js", "../iter/discrete-uniform/lib/index.js", "../iter/erlang/lib/main.js", "../iter/erlang/lib/index.js", "../iter/exponential/lib/main.js", "../iter/exponential/lib/index.js", "../iter/f/lib/main.js", "../iter/f/lib/index.js", "../iter/frechet/lib/main.js", "../iter/frechet/lib/index.js", "../iter/gamma/lib/main.js", "../iter/gamma/lib/index.js", "../iter/geometric/lib/main.js", "../iter/geometric/lib/index.js", "../iter/gumbel/lib/main.js", "../iter/gumbel/lib/index.js", "../iter/hypergeometric/lib/main.js", "../iter/hypergeometric/lib/index.js", "../iter/improved-ziggurat/lib/main.js", "../iter/improved-ziggurat/lib/index.js", "../iter/invgamma/lib/main.js", "../iter/invgamma/lib/index.js", "../iter/kumaraswamy/lib/main.js", "../iter/kumaraswamy/lib/index.js", "../iter/laplace/lib/main.js", "../iter/laplace/lib/index.js", "../iter/levy/lib/main.js", "../iter/levy/lib/index.js", "../iter/logistic/lib/main.js", "../iter/logistic/lib/index.js", "../iter/lognormal/lib/main.js", "../iter/lognormal/lib/index.js", "../iter/minstd/lib/main.js", "../iter/minstd/lib/index.js", "../iter/minstd-shuffle/lib/main.js", "../iter/minstd-shuffle/lib/index.js", "../iter/mt19937/lib/main.js", "../iter/mt19937/lib/index.js", "../iter/negative-binomial/lib/main.js", "../iter/negative-binomial/lib/index.js", "../iter/normal/lib/main.js", "../iter/normal/lib/index.js", "../iter/pareto-type1/lib/main.js", "../iter/pareto-type1/lib/index.js", "../iter/poisson/lib/main.js", "../iter/poisson/lib/index.js", "../iter/randi/lib/main.js", "../iter/randi/lib/index.js", "../iter/randn/lib/main.js", "../iter/randn/lib/index.js", "../iter/randu/lib/main.js", "../iter/randu/lib/index.js", "../iter/rayleigh/lib/main.js", "../iter/rayleigh/lib/index.js", "../iter/t/lib/main.js", "../iter/t/lib/index.js", "../iter/triangular/lib/main.js", "../iter/triangular/lib/index.js", "../iter/uniform/lib/main.js", "../iter/uniform/lib/index.js", "../iter/weibull/lib/main.js", "../iter/weibull/lib/index.js", "../iter/lib/index.js", "../sample/lib/discrete_uniform.js", "../sample/lib/renormalizing.js", "../sample/lib/fisher_yates.js", "../sample/lib/vose.js", "../sample/lib/defaults.json", "../sample/lib/validate.js", "../sample/lib/factory.js", "../sample/lib/main.js", "../sample/lib/index.js", "../shuffle/lib/defaults.json", "../shuffle/lib/validate.js", "../shuffle/lib/factory.js", "../shuffle/lib/main.js", "../shuffle/lib/index.js", "../streams/arcsine/lib/defaults.json", "../streams/arcsine/lib/validate.js", "../streams/arcsine/lib/debug.js", "../streams/arcsine/lib/main.js", "../streams/arcsine/lib/object_mode.js", "../streams/arcsine/lib/factory.js", "../streams/arcsine/lib/index.js", "../streams/bernoulli/lib/defaults.json", "../streams/bernoulli/lib/validate.js", "../streams/bernoulli/lib/debug.js", "../streams/bernoulli/lib/main.js", "../streams/bernoulli/lib/object_mode.js", "../streams/bernoulli/lib/factory.js", "../streams/bernoulli/lib/index.js", "../streams/beta/lib/defaults.json", "../streams/beta/lib/validate.js", "../streams/beta/lib/debug.js", "../streams/beta/lib/main.js", "../streams/beta/lib/object_mode.js", "../streams/beta/lib/factory.js", "../streams/beta/lib/index.js", "../streams/betaprime/lib/defaults.json", "../streams/betaprime/lib/validate.js", "../streams/betaprime/lib/debug.js", "../streams/betaprime/lib/main.js", "../streams/betaprime/lib/object_mode.js", "../streams/betaprime/lib/factory.js", "../streams/betaprime/lib/index.js", "../streams/binomial/lib/defaults.json", "../streams/binomial/lib/validate.js", "../streams/binomial/lib/debug.js", "../streams/binomial/lib/main.js", "../streams/binomial/lib/object_mode.js", "../streams/binomial/lib/factory.js", "../streams/binomial/lib/index.js", "../streams/box-muller/lib/defaults.json", "../streams/box-muller/lib/validate.js", "../streams/box-muller/lib/debug.js", "../streams/box-muller/lib/main.js", "../streams/box-muller/lib/object_mode.js", "../streams/box-muller/lib/factory.js", "../streams/box-muller/lib/index.js", "../streams/cauchy/lib/defaults.json", "../streams/cauchy/lib/validate.js", "../streams/cauchy/lib/debug.js", "../streams/cauchy/lib/main.js", "../streams/cauchy/lib/object_mode.js", "../streams/cauchy/lib/factory.js", "../streams/cauchy/lib/index.js", "../streams/chi/lib/defaults.json", "../streams/chi/lib/validate.js", "../streams/chi/lib/debug.js", "../streams/chi/lib/main.js", "../streams/chi/lib/object_mode.js", "../streams/chi/lib/factory.js", "../streams/chi/lib/index.js", "../streams/chisquare/lib/defaults.json", "../streams/chisquare/lib/validate.js", "../streams/chisquare/lib/debug.js", "../streams/chisquare/lib/main.js", "../streams/chisquare/lib/object_mode.js", "../streams/chisquare/lib/factory.js", "../streams/chisquare/lib/index.js", "../streams/cosine/lib/defaults.json", "../streams/cosine/lib/validate.js", "../streams/cosine/lib/debug.js", "../streams/cosine/lib/main.js", "../streams/cosine/lib/object_mode.js", "../streams/cosine/lib/factory.js", "../streams/cosine/lib/index.js", "../streams/discrete-uniform/lib/defaults.json", "../streams/discrete-uniform/lib/validate.js", "../streams/discrete-uniform/lib/debug.js", "../streams/discrete-uniform/lib/main.js", "../streams/discrete-uniform/lib/object_mode.js", "../streams/discrete-uniform/lib/factory.js", "../streams/discrete-uniform/lib/index.js", "../streams/erlang/lib/defaults.json", "../streams/erlang/lib/validate.js", "../streams/erlang/lib/debug.js", "../streams/erlang/lib/main.js", "../streams/erlang/lib/object_mode.js", "../streams/erlang/lib/factory.js", "../streams/erlang/lib/index.js", "../streams/exponential/lib/defaults.json", "../streams/exponential/lib/validate.js", "../streams/exponential/lib/debug.js", "../streams/exponential/lib/main.js", "../streams/exponential/lib/object_mode.js", "../streams/exponential/lib/factory.js", "../streams/exponential/lib/index.js", "../streams/f/lib/defaults.json", "../streams/f/lib/validate.js", "../streams/f/lib/debug.js", "../streams/f/lib/main.js", "../streams/f/lib/object_mode.js", "../streams/f/lib/factory.js", "../streams/f/lib/index.js", "../streams/frechet/lib/defaults.json", "../streams/frechet/lib/validate.js", "../streams/frechet/lib/debug.js", "../streams/frechet/lib/main.js", "../streams/frechet/lib/object_mode.js", "../streams/frechet/lib/factory.js", "../streams/frechet/lib/index.js", "../streams/gamma/lib/defaults.json", "../streams/gamma/lib/validate.js", "../streams/gamma/lib/debug.js", "../streams/gamma/lib/main.js", "../streams/gamma/lib/object_mode.js", "../streams/gamma/lib/factory.js", "../streams/gamma/lib/index.js", "../streams/geometric/lib/defaults.json", "../streams/geometric/lib/validate.js", "../streams/geometric/lib/debug.js", "../streams/geometric/lib/main.js", "../streams/geometric/lib/object_mode.js", "../streams/geometric/lib/factory.js", "../streams/geometric/lib/index.js", "../streams/gumbel/lib/defaults.json", "../streams/gumbel/lib/validate.js", "../streams/gumbel/lib/debug.js", "../streams/gumbel/lib/main.js", "../streams/gumbel/lib/object_mode.js", "../streams/gumbel/lib/factory.js", "../streams/gumbel/lib/index.js", "../streams/hypergeometric/lib/defaults.json", "../streams/hypergeometric/lib/validate.js", "../streams/hypergeometric/lib/debug.js", "../streams/hypergeometric/lib/main.js", "../streams/hypergeometric/lib/object_mode.js", "../streams/hypergeometric/lib/factory.js", "../streams/hypergeometric/lib/index.js", "../streams/improved-ziggurat/lib/defaults.json", "../streams/improved-ziggurat/lib/validate.js", "../streams/improved-ziggurat/lib/debug.js", "../streams/improved-ziggurat/lib/main.js", "../streams/improved-ziggurat/lib/object_mode.js", "../streams/improved-ziggurat/lib/factory.js", "../streams/improved-ziggurat/lib/index.js", "../streams/invgamma/lib/defaults.json", "../streams/invgamma/lib/validate.js", "../streams/invgamma/lib/debug.js", "../streams/invgamma/lib/main.js", "../streams/invgamma/lib/object_mode.js", "../streams/invgamma/lib/factory.js", "../streams/invgamma/lib/index.js", "../streams/kumaraswamy/lib/defaults.json", "../streams/kumaraswamy/lib/validate.js", "../streams/kumaraswamy/lib/debug.js", "../streams/kumaraswamy/lib/main.js", "../streams/kumaraswamy/lib/object_mode.js", "../streams/kumaraswamy/lib/factory.js", "../streams/kumaraswamy/lib/index.js", "../streams/laplace/lib/defaults.json", "../streams/laplace/lib/validate.js", "../streams/laplace/lib/debug.js", "../streams/laplace/lib/main.js", "../streams/laplace/lib/object_mode.js", "../streams/laplace/lib/factory.js", "../streams/laplace/lib/index.js", "../streams/levy/lib/defaults.json", "../streams/levy/lib/validate.js", "../streams/levy/lib/debug.js", "../streams/levy/lib/main.js", "../streams/levy/lib/object_mode.js", "../streams/levy/lib/factory.js", "../streams/levy/lib/index.js", "../streams/logistic/lib/defaults.json", "../streams/logistic/lib/validate.js", "../streams/logistic/lib/debug.js", "../streams/logistic/lib/main.js", "../streams/logistic/lib/object_mode.js", "../streams/logistic/lib/factory.js", "../streams/logistic/lib/index.js", "../streams/lognormal/lib/defaults.json", "../streams/lognormal/lib/validate.js", "../streams/lognormal/lib/debug.js", "../streams/lognormal/lib/main.js", "../streams/lognormal/lib/object_mode.js", "../streams/lognormal/lib/factory.js", "../streams/lognormal/lib/index.js", "../streams/minstd/lib/defaults.json", "../streams/minstd/lib/validate.js", "../streams/minstd/lib/debug.js", "../streams/minstd/lib/main.js", "../streams/minstd/lib/object_mode.js", "../streams/minstd/lib/factory.js", "../streams/minstd/lib/index.js", "../streams/minstd-shuffle/lib/defaults.json", "../streams/minstd-shuffle/lib/validate.js", "../streams/minstd-shuffle/lib/debug.js", "../streams/minstd-shuffle/lib/main.js", "../streams/minstd-shuffle/lib/object_mode.js", "../streams/minstd-shuffle/lib/factory.js", "../streams/minstd-shuffle/lib/index.js", "../streams/mt19937/lib/defaults.json", "../streams/mt19937/lib/validate.js", "../streams/mt19937/lib/debug.js", "../streams/mt19937/lib/main.js", "../streams/mt19937/lib/object_mode.js", "../streams/mt19937/lib/factory.js", "../streams/mt19937/lib/index.js", "../streams/negative-binomial/lib/defaults.json", "../streams/negative-binomial/lib/validate.js", "../streams/negative-binomial/lib/debug.js", "../streams/negative-binomial/lib/main.js", "../streams/negative-binomial/lib/object_mode.js", "../streams/negative-binomial/lib/factory.js", "../streams/negative-binomial/lib/index.js", "../streams/normal/lib/defaults.json", "../streams/normal/lib/validate.js", "../streams/normal/lib/debug.js", "../streams/normal/lib/main.js", "../streams/normal/lib/object_mode.js", "../streams/normal/lib/factory.js", "../streams/normal/lib/index.js", "../streams/pareto-type1/lib/defaults.json", "../streams/pareto-type1/lib/validate.js", "../streams/pareto-type1/lib/debug.js", "../streams/pareto-type1/lib/main.js", "../streams/pareto-type1/lib/object_mode.js", "../streams/pareto-type1/lib/factory.js", "../streams/pareto-type1/lib/index.js", "../streams/poisson/lib/defaults.json", "../streams/poisson/lib/validate.js", "../streams/poisson/lib/debug.js", "../streams/poisson/lib/main.js", "../streams/poisson/lib/object_mode.js", "../streams/poisson/lib/factory.js", "../streams/poisson/lib/index.js", "../streams/randi/lib/defaults.json", "../streams/randi/lib/validate.js", "../streams/randi/lib/debug.js", "../streams/randi/lib/main.js", "../streams/randi/lib/object_mode.js", "../streams/randi/lib/factory.js", "../streams/randi/lib/index.js", "../streams/randn/lib/defaults.json", "../streams/randn/lib/validate.js", "../streams/randn/lib/debug.js", "../streams/randn/lib/main.js", "../streams/randn/lib/object_mode.js", "../streams/randn/lib/factory.js", "../streams/randn/lib/index.js", "../streams/randu/lib/defaults.json", "../streams/randu/lib/validate.js", "../streams/randu/lib/debug.js", "../streams/randu/lib/main.js", "../streams/randu/lib/object_mode.js", "../streams/randu/lib/factory.js", "../streams/randu/lib/index.js", "../streams/rayleigh/lib/defaults.json", "../streams/rayleigh/lib/validate.js", "../streams/rayleigh/lib/debug.js", "../streams/rayleigh/lib/main.js", "../streams/rayleigh/lib/object_mode.js", "../streams/rayleigh/lib/factory.js", "../streams/rayleigh/lib/index.js", "../streams/t/lib/defaults.json", "../streams/t/lib/validate.js", "../streams/t/lib/debug.js", "../streams/t/lib/main.js", "../streams/t/lib/object_mode.js", "../streams/t/lib/factory.js", "../streams/t/lib/index.js", "../streams/triangular/lib/defaults.json", "../streams/triangular/lib/validate.js", "../streams/triangular/lib/debug.js", "../streams/triangular/lib/main.js", "../streams/triangular/lib/object_mode.js", "../streams/triangular/lib/factory.js", "../streams/triangular/lib/index.js", "../streams/uniform/lib/defaults.json", "../streams/uniform/lib/validate.js", "../streams/uniform/lib/debug.js", "../streams/uniform/lib/main.js", "../streams/uniform/lib/object_mode.js", "../streams/uniform/lib/factory.js", "../streams/uniform/lib/index.js", "../streams/weibull/lib/defaults.json", "../streams/weibull/lib/validate.js", "../streams/weibull/lib/debug.js", "../streams/weibull/lib/main.js", "../streams/weibull/lib/object_mode.js", "../streams/weibull/lib/factory.js", "../streams/weibull/lib/index.js", "../streams/lib/index.js", "../strided/arcsine/lib/prng.js", "../strided/arcsine/lib/main.js", "../strided/arcsine/lib/ndarray.js", "../strided/arcsine/lib/index.js", "../strided/tools/unary-factory/lib/main.js", "../strided/tools/unary-factory/lib/index.js", "../strided/bernoulli/lib/factory.js", "../strided/bernoulli/lib/main.js", "../strided/bernoulli/lib/index.js", "../strided/beta/lib/prng.js", "../strided/beta/lib/main.js", "../strided/beta/lib/ndarray.js", "../strided/beta/lib/index.js", "../strided/betaprime/lib/prng.js", "../strided/betaprime/lib/main.js", "../strided/betaprime/lib/ndarray.js", "../strided/betaprime/lib/index.js", "../strided/chi/lib/factory.js", "../strided/chi/lib/main.js", "../strided/chi/lib/index.js", "../strided/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) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar unaryFactory = require( './../../../strided/tools/unary-factory' );\nvar base = require( './../../../base/chi' );\n\n\n// MAIN //\n\n/**\n* Returns a function for filling strided arrays containing pseudorandom numbers drawn from a chi distribution.\n*\n* @name factory\n* @type {Function}\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for filling strided arrays\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var chi = factory();\n* // returns \n*\n* var out = new Float64Array( 10 );\n* // returns \n*\n* var arr = chi( out.length, [ 2.0 ], 0, out, 1 );\n* // returns \n*\n* var bool = ( arr === out );\n* // returns true\n*/\nvar factory = unaryFactory( base );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a chi distribution.\n*\n* @name chi\n* @type {Function}\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} k - degrees of freedom\n* @param {integer} sk - `k` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* chi( out.length, [ 2.0 ], 0, out, 1 );\n*/\nvar chi = factory();\n\n\n// EXPORTS //\n\nmodule.exports = chi;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a chi distribution.\n*\n* @module @stdlib/random/strided/chi\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var chi = require( '@stdlib/random/strided/chi' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* chi( out.length, [ 2.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var chi = require( '@stdlib/random/strided/chi' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* chi.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See 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 chi\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/chi}\n*/\nsetReadOnly( ns, 'chi', require( './../../strided/chi' ) );\n\n/**\n* @name 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,GA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,IAAc,QAAS,uDAAwD,EAC/EC,GAAO,KACPC,IAAU,KAKdF,IAAaC,GAAM,UAAWC,GAAQ,EAKtCH,GAAO,QAAUE,KC5DjB,IAAAE,GAAAC,EAAA,SAAAC,IAAAC,GAAA,cA0BA,IAAIC,EAAc,QAAS,yCAA0C,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,MAAO,IAAiC,EASzDD,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,ICjLjB,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_factory", "__commonJSMin", "exports", "module", "unaryFactory", "base", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "chi", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "cosine", "N", "mu", "sm", "s", "ss", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "cosine", "N", "mu", "sm", "om", "s", "ss", "os", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "discreteUniform", "N", "a", "sa", "b", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "discreteUniform", "N", "a", "sa", "oa", "b", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "base", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "exponential", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "gamma", "N", "alpha", "sa", "beta", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "gamma", "N", "alpha", "sa", "oa", "beta", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "invgamma", "N", "alpha", "sa", "beta", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "invgamma", "N", "alpha", "sa", "oa", "beta", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "lognormal", "N", "mu", "sm", "sigma", "ss", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "lognormal", "N", "mu", "sm", "om", "sigma", "ss", "os", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "oo", "options", "rand", "require_normalized", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "options", "rand", "require_normalized_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "normalized", "ndarrayNormalized", "require_main", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "oo", "options", "rand", "require_normalized", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "options", "rand", "require_normalized_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "normalized", "ndarrayNormalized", "require_main", "__commonJSMin", "exports", "module", "nullary", "random", "mt19937", "N", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "mt19937", "N", "out", "so", "oo", "options", "rand", "require_normalized", "__commonJSMin", "exports", "module", "nullary", "random", "mt19937", "N", "out", "so", "options", "rand", "require_normalized_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "mt19937", "N", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "normalized", "ndarrayNormalized", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "normal", "N", "mu", "sm", "sigma", "ss", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "normal", "N", "mu", "sm", "om", "sigma", "ss", "os", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "nullary", "random", "randu", "N", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "randu", "N", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "uniform", "N", "a", "sa", "b", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "uniform", "N", "a", "sa", "oa", "b", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "weibull", "N", "k", "sk", "lambda", "sl", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "weibull", "N", "k", "sk", "ok", "lambda", "sl", "ol", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "ns", "setReadOnly", "ns"] + "sources": ["../array/tools/binary/lib/validate.js", "../array/tools/binary/lib/main.js", "../array/tools/binary/lib/index.js", "../array/tools/nullary/lib/validate.js", "../array/tools/nullary/lib/main.js", "../array/tools/nullary/lib/index.js", "../array/tools/binary-factory/lib/main.js", "../array/tools/binary-factory/lib/index.js", "../base/mt19937/lib/rand_uint32.js", "../base/mt19937/lib/factory.js", "../base/mt19937/lib/main.js", "../base/mt19937/lib/index.js", "../base/arcsine/lib/validate.js", "../base/arcsine/lib/arcsine.js", "../base/arcsine/lib/factory.js", "../base/arcsine/lib/main.js", "../base/arcsine/lib/index.js", "../array/arcsine/lib/factory.js", "../array/arcsine/lib/main.js", "../array/arcsine/lib/index.js", "../array/tools/unary/lib/validate.js", "../array/tools/unary/lib/main.js", "../array/tools/unary/lib/index.js", "../array/tools/unary-factory/lib/main.js", "../array/tools/unary-factory/lib/index.js", "../base/bernoulli/lib/factory.js", "../base/bernoulli/lib/main.js", "../base/bernoulli/lib/index.js", "../array/bernoulli/lib/factory.js", "../array/bernoulli/lib/main.js", "../array/bernoulli/lib/index.js", "../base/improved-ziggurat/lib/coords_array.js", "../base/improved-ziggurat/lib/ratio_array.js", "../base/improved-ziggurat/lib/sample_tail.js", "../base/improved-ziggurat/lib/improved_ziggurat.js", "../base/improved-ziggurat/lib/factory.js", "../base/improved-ziggurat/lib/main.js", "../base/improved-ziggurat/lib/index.js", "../base/beta/lib/validate.js", "../base/beta/lib/standard_gamma.js", "../base/beta/lib/sample1.js", "../base/beta/lib/sample2.js", "../base/beta/lib/sample3.js", "../base/beta/lib/beta.js", "../base/beta/lib/factory.js", "../base/beta/lib/main.js", "../base/beta/lib/index.js", "../array/beta/lib/factory.js", "../array/beta/lib/main.js", "../array/beta/lib/index.js", "../base/gamma/lib/validate.js", "../base/gamma/lib/gamma.js", "../base/gamma/lib/factory.js", "../base/gamma/lib/main.js", "../base/gamma/lib/index.js", "../base/betaprime/lib/validate.js", "../base/betaprime/lib/betaprime.js", "../base/betaprime/lib/factory.js", "../base/betaprime/lib/main.js", "../base/betaprime/lib/index.js", "../array/betaprime/lib/factory.js", "../array/betaprime/lib/main.js", "../array/betaprime/lib/index.js", "../base/binomial/lib/validate.js", "../base/binomial/lib/sample1.js", "../base/binomial/lib/correction.js", "../base/binomial/lib/sample2.js", "../base/binomial/lib/binomial.js", "../base/binomial/lib/factory.js", "../base/binomial/lib/main.js", "../base/binomial/lib/index.js", "../array/binomial/lib/factory.js", "../array/binomial/lib/main.js", "../array/binomial/lib/index.js", "../base/cauchy/lib/validate.js", "../base/cauchy/lib/cauchy.js", "../base/cauchy/lib/factory.js", "../base/cauchy/lib/main.js", "../base/cauchy/lib/index.js", "../array/cauchy/lib/factory.js", "../array/cauchy/lib/main.js", "../array/cauchy/lib/index.js", "../base/chisquare/lib/factory.js", "../base/chisquare/lib/main.js", "../base/chisquare/lib/index.js", "../base/chi/lib/factory.js", "../base/chi/lib/main.js", "../base/chi/lib/index.js", "../array/chi/lib/factory.js", "../array/chi/lib/main.js", "../array/chi/lib/index.js", "../array/chisquare/lib/factory.js", "../array/chisquare/lib/main.js", "../array/chisquare/lib/index.js", "../base/cosine/lib/validate.js", "../base/cosine/lib/cosine.js", "../base/cosine/lib/factory.js", "../base/cosine/lib/main.js", "../base/cosine/lib/index.js", "../array/cosine/lib/factory.js", "../array/cosine/lib/main.js", "../array/cosine/lib/index.js", "../base/discrete-uniform/lib/validate.js", "../base/discrete-uniform/lib/discrete_uniform.js", "../base/discrete-uniform/lib/factory.js", "../base/discrete-uniform/lib/main.js", "../base/discrete-uniform/lib/index.js", "../array/discrete-uniform/lib/factory.js", "../array/discrete-uniform/lib/main.js", "../array/discrete-uniform/lib/index.js", "../base/erlang/lib/validate.js", "../base/erlang/lib/erlang.js", "../base/erlang/lib/factory.js", "../base/erlang/lib/main.js", "../base/erlang/lib/index.js", "../array/erlang/lib/factory.js", "../array/erlang/lib/main.js", "../array/erlang/lib/index.js", "../base/exponential/lib/exponential.js", "../base/exponential/lib/factory.js", "../base/exponential/lib/main.js", "../base/exponential/lib/index.js", "../array/exponential/lib/factory.js", "../array/exponential/lib/main.js", "../array/exponential/lib/index.js", "../base/f/lib/validate.js", "../base/f/lib/f.js", "../base/f/lib/factory.js", "../base/f/lib/main.js", "../base/f/lib/index.js", "../array/f/lib/factory.js", "../array/f/lib/main.js", "../array/f/lib/index.js", "../array/tools/ternary/lib/validate.js", "../array/tools/ternary/lib/main.js", "../array/tools/ternary/lib/index.js", "../array/tools/ternary-factory/lib/main.js", "../array/tools/ternary-factory/lib/index.js", "../base/frechet/lib/validate.js", "../base/frechet/lib/frechet.js", "../base/frechet/lib/factory.js", "../base/frechet/lib/main.js", "../base/frechet/lib/index.js", "../array/frechet/lib/factory.js", "../array/frechet/lib/main.js", "../array/frechet/lib/index.js", "../array/gamma/lib/factory.js", "../array/gamma/lib/main.js", "../array/gamma/lib/index.js", "../base/geometric/lib/geometric.js", "../base/geometric/lib/factory.js", "../base/geometric/lib/main.js", "../base/geometric/lib/index.js", "../array/geometric/lib/factory.js", "../array/geometric/lib/main.js", "../array/geometric/lib/index.js", "../base/gumbel/lib/validate.js", "../base/gumbel/lib/gumbel.js", "../base/gumbel/lib/factory.js", "../base/gumbel/lib/main.js", "../base/gumbel/lib/index.js", "../array/gumbel/lib/factory.js", "../array/gumbel/lib/main.js", "../array/gumbel/lib/index.js", "../base/hypergeometric/lib/validate.js", "../base/hypergeometric/lib/hin.js", "../base/hypergeometric/lib/hypergeometric.js", "../base/hypergeometric/lib/factory.js", "../base/hypergeometric/lib/main.js", "../base/hypergeometric/lib/index.js", "../array/hypergeometric/lib/factory.js", "../array/hypergeometric/lib/main.js", "../array/hypergeometric/lib/index.js", "../base/invgamma/lib/validate.js", "../base/invgamma/lib/factory.js", "../base/invgamma/lib/main.js", "../base/invgamma/lib/index.js", "../array/invgamma/lib/factory.js", "../array/invgamma/lib/main.js", "../array/invgamma/lib/index.js", "../base/kumaraswamy/lib/validate.js", "../base/kumaraswamy/lib/kumaraswamy.js", "../base/kumaraswamy/lib/factory.js", "../base/kumaraswamy/lib/main.js", "../base/kumaraswamy/lib/index.js", "../array/kumaraswamy/lib/factory.js", "../array/kumaraswamy/lib/main.js", "../array/kumaraswamy/lib/index.js", "../base/laplace/lib/validate.js", "../base/laplace/lib/laplace.js", "../base/laplace/lib/factory.js", "../base/laplace/lib/main.js", "../base/laplace/lib/index.js", "../array/laplace/lib/factory.js", "../array/laplace/lib/main.js", "../array/laplace/lib/index.js", "../base/levy/lib/validate.js", "../base/levy/lib/levy.js", "../base/levy/lib/factory.js", "../base/levy/lib/main.js", "../base/levy/lib/index.js", "../array/levy/lib/factory.js", "../array/levy/lib/main.js", "../array/levy/lib/index.js", "../base/logistic/lib/validate.js", "../base/logistic/lib/logistic.js", "../base/logistic/lib/factory.js", "../base/logistic/lib/main.js", "../base/logistic/lib/index.js", "../array/logistic/lib/factory.js", "../array/logistic/lib/main.js", "../array/logistic/lib/index.js", "../base/lognormal/lib/validate.js", "../base/lognormal/lib/lognormal.js", "../base/lognormal/lib/factory.js", "../base/lognormal/lib/main.js", "../base/lognormal/lib/index.js", "../array/lognormal/lib/factory.js", "../array/lognormal/lib/main.js", "../array/lognormal/lib/index.js", "../base/minstd/lib/rand_int32.js", "../base/minstd/lib/factory.js", "../base/minstd/lib/main.js", "../base/minstd/lib/index.js", "../array/minstd/lib/defaults.json", "../array/minstd/lib/validate.js", "../array/minstd/lib/factory.js", "../array/minstd/lib/main.js", "../array/minstd/lib/index.js", "../base/minstd-shuffle/lib/create_table.js", "../base/minstd-shuffle/lib/rand_int32.js", "../base/minstd-shuffle/lib/factory.js", "../base/minstd-shuffle/lib/main.js", "../base/minstd-shuffle/lib/index.js", "../array/minstd-shuffle/lib/defaults.json", "../array/minstd-shuffle/lib/validate.js", "../array/minstd-shuffle/lib/factory.js", "../array/minstd-shuffle/lib/main.js", "../array/minstd-shuffle/lib/index.js", "../array/mt19937/lib/defaults.json", "../array/mt19937/lib/validate.js", "../array/mt19937/lib/factory.js", "../array/mt19937/lib/main.js", "../array/mt19937/lib/index.js", "../base/poisson/lib/knuth.js", "../base/poisson/lib/rejection.js", "../base/poisson/lib/poisson.js", "../base/poisson/lib/factory.js", "../base/poisson/lib/main.js", "../base/poisson/lib/index.js", "../base/negative-binomial/lib/validate.js", "../base/negative-binomial/lib/factory.js", "../base/negative-binomial/lib/main.js", "../base/negative-binomial/lib/index.js", "../array/negative-binomial/lib/factory.js", "../array/negative-binomial/lib/main.js", "../array/negative-binomial/lib/index.js", "../base/normal/lib/validate.js", "../base/normal/lib/normal.js", "../base/normal/lib/factory.js", "../base/normal/lib/main.js", "../base/normal/lib/index.js", "../array/normal/lib/factory.js", "../array/normal/lib/main.js", "../array/normal/lib/index.js", "../base/pareto-type1/lib/validate.js", "../base/pareto-type1/lib/pareto.js", "../base/pareto-type1/lib/factory.js", "../base/pareto-type1/lib/main.js", "../base/pareto-type1/lib/index.js", "../array/pareto-type1/lib/factory.js", "../array/pareto-type1/lib/main.js", "../array/pareto-type1/lib/index.js", "../array/poisson/lib/factory.js", "../array/poisson/lib/main.js", "../array/poisson/lib/index.js", "../base/randu/lib/defaults.json", "../base/randu/lib/prngs.js", "../base/randu/lib/factory.js", "../base/randu/lib/main.js", "../base/randu/lib/index.js", "../array/randu/lib/defaults.json", "../array/randu/lib/validate.js", "../array/randu/lib/factory.js", "../array/randu/lib/main.js", "../array/randu/lib/index.js", "../base/rayleigh/lib/rayleigh.js", "../base/rayleigh/lib/factory.js", "../base/rayleigh/lib/main.js", "../base/rayleigh/lib/index.js", "../array/rayleigh/lib/factory.js", "../array/rayleigh/lib/main.js", "../array/rayleigh/lib/index.js", "../base/t/lib/factory.js", "../base/t/lib/main.js", "../base/t/lib/index.js", "../array/t/lib/factory.js", "../array/t/lib/main.js", "../array/t/lib/index.js", "../base/triangular/lib/validate.js", "../base/triangular/lib/triangular.js", "../base/triangular/lib/factory.js", "../base/triangular/lib/main.js", "../base/triangular/lib/index.js", "../array/triangular/lib/factory.js", "../array/triangular/lib/main.js", "../array/triangular/lib/index.js", "../base/uniform/lib/validate.js", "../base/uniform/lib/uniform.js", "../base/uniform/lib/factory.js", "../base/uniform/lib/main.js", "../base/uniform/lib/index.js", "../array/uniform/lib/factory.js", "../array/uniform/lib/main.js", "../array/uniform/lib/index.js", "../base/weibull/lib/validate.js", "../base/weibull/lib/weibull.js", "../base/weibull/lib/factory.js", "../base/weibull/lib/main.js", "../base/weibull/lib/index.js", "../array/weibull/lib/factory.js", "../array/weibull/lib/main.js", "../array/weibull/lib/index.js", "../array/lib/index.js", "../base/box-muller/lib/randn.js", "../base/box-muller/lib/min.js", "../base/box-muller/lib/max.js", "../base/box-muller/lib/factory.js", "../base/box-muller/lib/main.js", "../base/box-muller/lib/index.js", "../base/randi/lib/defaults.json", "../base/randi/lib/prngs.js", "../base/randi/lib/factory.js", "../base/randi/lib/main.js", "../base/randi/lib/index.js", "../base/randn/lib/defaults.json", "../base/randn/lib/prngs.js", "../base/randn/lib/factory.js", "../base/randn/lib/main.js", "../base/randn/lib/index.js", "../base/reviver/lib/prngs.js", "../base/reviver/lib/main.js", "../base/reviver/lib/index.js", "../base/lib/index.js", "../iter/arcsine/lib/main.js", "../iter/arcsine/lib/index.js", "../iter/bernoulli/lib/main.js", "../iter/bernoulli/lib/index.js", "../iter/beta/lib/main.js", "../iter/beta/lib/index.js", "../iter/betaprime/lib/main.js", "../iter/betaprime/lib/index.js", "../iter/binomial/lib/main.js", "../iter/binomial/lib/index.js", "../iter/box-muller/lib/main.js", "../iter/box-muller/lib/index.js", "../iter/cauchy/lib/main.js", "../iter/cauchy/lib/index.js", "../iter/chi/lib/main.js", "../iter/chi/lib/index.js", "../iter/chisquare/lib/main.js", "../iter/chisquare/lib/index.js", "../iter/cosine/lib/main.js", "../iter/cosine/lib/index.js", "../iter/discrete-uniform/lib/main.js", "../iter/discrete-uniform/lib/index.js", "../iter/erlang/lib/main.js", "../iter/erlang/lib/index.js", "../iter/exponential/lib/main.js", "../iter/exponential/lib/index.js", "../iter/f/lib/main.js", "../iter/f/lib/index.js", "../iter/frechet/lib/main.js", "../iter/frechet/lib/index.js", "../iter/gamma/lib/main.js", "../iter/gamma/lib/index.js", "../iter/geometric/lib/main.js", "../iter/geometric/lib/index.js", "../iter/gumbel/lib/main.js", "../iter/gumbel/lib/index.js", "../iter/hypergeometric/lib/main.js", "../iter/hypergeometric/lib/index.js", "../iter/improved-ziggurat/lib/main.js", "../iter/improved-ziggurat/lib/index.js", "../iter/invgamma/lib/main.js", "../iter/invgamma/lib/index.js", "../iter/kumaraswamy/lib/main.js", "../iter/kumaraswamy/lib/index.js", "../iter/laplace/lib/main.js", "../iter/laplace/lib/index.js", "../iter/levy/lib/main.js", "../iter/levy/lib/index.js", "../iter/logistic/lib/main.js", "../iter/logistic/lib/index.js", "../iter/lognormal/lib/main.js", "../iter/lognormal/lib/index.js", "../iter/minstd/lib/main.js", "../iter/minstd/lib/index.js", "../iter/minstd-shuffle/lib/main.js", "../iter/minstd-shuffle/lib/index.js", "../iter/mt19937/lib/main.js", "../iter/mt19937/lib/index.js", "../iter/negative-binomial/lib/main.js", "../iter/negative-binomial/lib/index.js", "../iter/normal/lib/main.js", "../iter/normal/lib/index.js", "../iter/pareto-type1/lib/main.js", "../iter/pareto-type1/lib/index.js", "../iter/poisson/lib/main.js", "../iter/poisson/lib/index.js", "../iter/randi/lib/main.js", "../iter/randi/lib/index.js", "../iter/randn/lib/main.js", "../iter/randn/lib/index.js", "../iter/randu/lib/main.js", "../iter/randu/lib/index.js", "../iter/rayleigh/lib/main.js", "../iter/rayleigh/lib/index.js", "../iter/t/lib/main.js", "../iter/t/lib/index.js", "../iter/triangular/lib/main.js", "../iter/triangular/lib/index.js", "../iter/uniform/lib/main.js", "../iter/uniform/lib/index.js", "../iter/weibull/lib/main.js", "../iter/weibull/lib/index.js", "../iter/lib/index.js", "../sample/lib/discrete_uniform.js", "../sample/lib/renormalizing.js", "../sample/lib/fisher_yates.js", "../sample/lib/vose.js", "../sample/lib/defaults.json", "../sample/lib/validate.js", "../sample/lib/factory.js", "../sample/lib/main.js", "../sample/lib/index.js", "../shuffle/lib/defaults.json", "../shuffle/lib/validate.js", "../shuffle/lib/factory.js", "../shuffle/lib/main.js", "../shuffle/lib/index.js", "../streams/arcsine/lib/defaults.json", "../streams/arcsine/lib/validate.js", "../streams/arcsine/lib/debug.js", "../streams/arcsine/lib/main.js", "../streams/arcsine/lib/object_mode.js", "../streams/arcsine/lib/factory.js", "../streams/arcsine/lib/index.js", "../streams/bernoulli/lib/defaults.json", "../streams/bernoulli/lib/validate.js", "../streams/bernoulli/lib/debug.js", "../streams/bernoulli/lib/main.js", "../streams/bernoulli/lib/object_mode.js", "../streams/bernoulli/lib/factory.js", "../streams/bernoulli/lib/index.js", "../streams/beta/lib/defaults.json", "../streams/beta/lib/validate.js", "../streams/beta/lib/debug.js", "../streams/beta/lib/main.js", "../streams/beta/lib/object_mode.js", "../streams/beta/lib/factory.js", "../streams/beta/lib/index.js", "../streams/betaprime/lib/defaults.json", "../streams/betaprime/lib/validate.js", "../streams/betaprime/lib/debug.js", "../streams/betaprime/lib/main.js", "../streams/betaprime/lib/object_mode.js", "../streams/betaprime/lib/factory.js", "../streams/betaprime/lib/index.js", "../streams/binomial/lib/defaults.json", "../streams/binomial/lib/validate.js", "../streams/binomial/lib/debug.js", "../streams/binomial/lib/main.js", "../streams/binomial/lib/object_mode.js", "../streams/binomial/lib/factory.js", "../streams/binomial/lib/index.js", "../streams/box-muller/lib/defaults.json", "../streams/box-muller/lib/validate.js", "../streams/box-muller/lib/debug.js", "../streams/box-muller/lib/main.js", "../streams/box-muller/lib/object_mode.js", "../streams/box-muller/lib/factory.js", "../streams/box-muller/lib/index.js", "../streams/cauchy/lib/defaults.json", "../streams/cauchy/lib/validate.js", "../streams/cauchy/lib/debug.js", "../streams/cauchy/lib/main.js", "../streams/cauchy/lib/object_mode.js", "../streams/cauchy/lib/factory.js", "../streams/cauchy/lib/index.js", "../streams/chi/lib/defaults.json", "../streams/chi/lib/validate.js", "../streams/chi/lib/debug.js", "../streams/chi/lib/main.js", "../streams/chi/lib/object_mode.js", "../streams/chi/lib/factory.js", "../streams/chi/lib/index.js", "../streams/chisquare/lib/defaults.json", "../streams/chisquare/lib/validate.js", "../streams/chisquare/lib/debug.js", "../streams/chisquare/lib/main.js", "../streams/chisquare/lib/object_mode.js", "../streams/chisquare/lib/factory.js", "../streams/chisquare/lib/index.js", "../streams/cosine/lib/defaults.json", "../streams/cosine/lib/validate.js", "../streams/cosine/lib/debug.js", "../streams/cosine/lib/main.js", "../streams/cosine/lib/object_mode.js", "../streams/cosine/lib/factory.js", "../streams/cosine/lib/index.js", "../streams/discrete-uniform/lib/defaults.json", "../streams/discrete-uniform/lib/validate.js", "../streams/discrete-uniform/lib/debug.js", "../streams/discrete-uniform/lib/main.js", "../streams/discrete-uniform/lib/object_mode.js", "../streams/discrete-uniform/lib/factory.js", "../streams/discrete-uniform/lib/index.js", "../streams/erlang/lib/defaults.json", "../streams/erlang/lib/validate.js", "../streams/erlang/lib/debug.js", "../streams/erlang/lib/main.js", "../streams/erlang/lib/object_mode.js", "../streams/erlang/lib/factory.js", "../streams/erlang/lib/index.js", "../streams/exponential/lib/defaults.json", "../streams/exponential/lib/validate.js", "../streams/exponential/lib/debug.js", "../streams/exponential/lib/main.js", "../streams/exponential/lib/object_mode.js", "../streams/exponential/lib/factory.js", "../streams/exponential/lib/index.js", "../streams/f/lib/defaults.json", "../streams/f/lib/validate.js", "../streams/f/lib/debug.js", "../streams/f/lib/main.js", "../streams/f/lib/object_mode.js", "../streams/f/lib/factory.js", "../streams/f/lib/index.js", "../streams/frechet/lib/defaults.json", "../streams/frechet/lib/validate.js", "../streams/frechet/lib/debug.js", "../streams/frechet/lib/main.js", "../streams/frechet/lib/object_mode.js", "../streams/frechet/lib/factory.js", "../streams/frechet/lib/index.js", "../streams/gamma/lib/defaults.json", "../streams/gamma/lib/validate.js", "../streams/gamma/lib/debug.js", "../streams/gamma/lib/main.js", "../streams/gamma/lib/object_mode.js", "../streams/gamma/lib/factory.js", "../streams/gamma/lib/index.js", "../streams/geometric/lib/defaults.json", "../streams/geometric/lib/validate.js", "../streams/geometric/lib/debug.js", "../streams/geometric/lib/main.js", "../streams/geometric/lib/object_mode.js", "../streams/geometric/lib/factory.js", "../streams/geometric/lib/index.js", "../streams/gumbel/lib/defaults.json", "../streams/gumbel/lib/validate.js", "../streams/gumbel/lib/debug.js", "../streams/gumbel/lib/main.js", "../streams/gumbel/lib/object_mode.js", "../streams/gumbel/lib/factory.js", "../streams/gumbel/lib/index.js", "../streams/hypergeometric/lib/defaults.json", "../streams/hypergeometric/lib/validate.js", "../streams/hypergeometric/lib/debug.js", "../streams/hypergeometric/lib/main.js", "../streams/hypergeometric/lib/object_mode.js", "../streams/hypergeometric/lib/factory.js", "../streams/hypergeometric/lib/index.js", "../streams/improved-ziggurat/lib/defaults.json", "../streams/improved-ziggurat/lib/validate.js", "../streams/improved-ziggurat/lib/debug.js", "../streams/improved-ziggurat/lib/main.js", "../streams/improved-ziggurat/lib/object_mode.js", "../streams/improved-ziggurat/lib/factory.js", "../streams/improved-ziggurat/lib/index.js", "../streams/invgamma/lib/defaults.json", "../streams/invgamma/lib/validate.js", "../streams/invgamma/lib/debug.js", "../streams/invgamma/lib/main.js", "../streams/invgamma/lib/object_mode.js", "../streams/invgamma/lib/factory.js", "../streams/invgamma/lib/index.js", "../streams/kumaraswamy/lib/defaults.json", "../streams/kumaraswamy/lib/validate.js", "../streams/kumaraswamy/lib/debug.js", "../streams/kumaraswamy/lib/main.js", "../streams/kumaraswamy/lib/object_mode.js", "../streams/kumaraswamy/lib/factory.js", "../streams/kumaraswamy/lib/index.js", "../streams/laplace/lib/defaults.json", "../streams/laplace/lib/validate.js", "../streams/laplace/lib/debug.js", "../streams/laplace/lib/main.js", "../streams/laplace/lib/object_mode.js", "../streams/laplace/lib/factory.js", "../streams/laplace/lib/index.js", "../streams/levy/lib/defaults.json", "../streams/levy/lib/validate.js", "../streams/levy/lib/debug.js", "../streams/levy/lib/main.js", "../streams/levy/lib/object_mode.js", "../streams/levy/lib/factory.js", "../streams/levy/lib/index.js", "../streams/logistic/lib/defaults.json", "../streams/logistic/lib/validate.js", "../streams/logistic/lib/debug.js", "../streams/logistic/lib/main.js", "../streams/logistic/lib/object_mode.js", "../streams/logistic/lib/factory.js", "../streams/logistic/lib/index.js", "../streams/lognormal/lib/defaults.json", "../streams/lognormal/lib/validate.js", "../streams/lognormal/lib/debug.js", "../streams/lognormal/lib/main.js", "../streams/lognormal/lib/object_mode.js", "../streams/lognormal/lib/factory.js", "../streams/lognormal/lib/index.js", "../streams/minstd/lib/defaults.json", "../streams/minstd/lib/validate.js", "../streams/minstd/lib/debug.js", "../streams/minstd/lib/main.js", "../streams/minstd/lib/object_mode.js", "../streams/minstd/lib/factory.js", "../streams/minstd/lib/index.js", "../streams/minstd-shuffle/lib/defaults.json", "../streams/minstd-shuffle/lib/validate.js", "../streams/minstd-shuffle/lib/debug.js", "../streams/minstd-shuffle/lib/main.js", "../streams/minstd-shuffle/lib/object_mode.js", "../streams/minstd-shuffle/lib/factory.js", "../streams/minstd-shuffle/lib/index.js", "../streams/mt19937/lib/defaults.json", "../streams/mt19937/lib/validate.js", "../streams/mt19937/lib/debug.js", "../streams/mt19937/lib/main.js", "../streams/mt19937/lib/object_mode.js", "../streams/mt19937/lib/factory.js", "../streams/mt19937/lib/index.js", "../streams/negative-binomial/lib/defaults.json", "../streams/negative-binomial/lib/validate.js", "../streams/negative-binomial/lib/debug.js", "../streams/negative-binomial/lib/main.js", "../streams/negative-binomial/lib/object_mode.js", "../streams/negative-binomial/lib/factory.js", "../streams/negative-binomial/lib/index.js", "../streams/normal/lib/defaults.json", "../streams/normal/lib/validate.js", "../streams/normal/lib/debug.js", "../streams/normal/lib/main.js", "../streams/normal/lib/object_mode.js", "../streams/normal/lib/factory.js", "../streams/normal/lib/index.js", "../streams/pareto-type1/lib/defaults.json", "../streams/pareto-type1/lib/validate.js", "../streams/pareto-type1/lib/debug.js", "../streams/pareto-type1/lib/main.js", "../streams/pareto-type1/lib/object_mode.js", "../streams/pareto-type1/lib/factory.js", "../streams/pareto-type1/lib/index.js", "../streams/poisson/lib/defaults.json", "../streams/poisson/lib/validate.js", "../streams/poisson/lib/debug.js", "../streams/poisson/lib/main.js", "../streams/poisson/lib/object_mode.js", "../streams/poisson/lib/factory.js", "../streams/poisson/lib/index.js", "../streams/randi/lib/defaults.json", "../streams/randi/lib/validate.js", "../streams/randi/lib/debug.js", "../streams/randi/lib/main.js", "../streams/randi/lib/object_mode.js", "../streams/randi/lib/factory.js", "../streams/randi/lib/index.js", "../streams/randn/lib/defaults.json", "../streams/randn/lib/validate.js", "../streams/randn/lib/debug.js", "../streams/randn/lib/main.js", "../streams/randn/lib/object_mode.js", "../streams/randn/lib/factory.js", "../streams/randn/lib/index.js", "../streams/randu/lib/defaults.json", "../streams/randu/lib/validate.js", "../streams/randu/lib/debug.js", "../streams/randu/lib/main.js", "../streams/randu/lib/object_mode.js", "../streams/randu/lib/factory.js", "../streams/randu/lib/index.js", "../streams/rayleigh/lib/defaults.json", "../streams/rayleigh/lib/validate.js", "../streams/rayleigh/lib/debug.js", "../streams/rayleigh/lib/main.js", "../streams/rayleigh/lib/object_mode.js", "../streams/rayleigh/lib/factory.js", "../streams/rayleigh/lib/index.js", "../streams/t/lib/defaults.json", "../streams/t/lib/validate.js", "../streams/t/lib/debug.js", "../streams/t/lib/main.js", "../streams/t/lib/object_mode.js", "../streams/t/lib/factory.js", "../streams/t/lib/index.js", "../streams/triangular/lib/defaults.json", "../streams/triangular/lib/validate.js", "../streams/triangular/lib/debug.js", "../streams/triangular/lib/main.js", "../streams/triangular/lib/object_mode.js", "../streams/triangular/lib/factory.js", "../streams/triangular/lib/index.js", "../streams/uniform/lib/defaults.json", "../streams/uniform/lib/validate.js", "../streams/uniform/lib/debug.js", "../streams/uniform/lib/main.js", "../streams/uniform/lib/object_mode.js", "../streams/uniform/lib/factory.js", "../streams/uniform/lib/index.js", "../streams/weibull/lib/defaults.json", "../streams/weibull/lib/validate.js", "../streams/weibull/lib/debug.js", "../streams/weibull/lib/main.js", "../streams/weibull/lib/object_mode.js", "../streams/weibull/lib/factory.js", "../streams/weibull/lib/index.js", "../streams/lib/index.js", "../strided/arcsine/lib/prng.js", "../strided/arcsine/lib/main.js", "../strided/arcsine/lib/ndarray.js", "../strided/arcsine/lib/index.js", "../strided/tools/unary-factory/lib/main.js", "../strided/tools/unary-factory/lib/index.js", "../strided/bernoulli/lib/factory.js", "../strided/bernoulli/lib/main.js", "../strided/bernoulli/lib/index.js", "../strided/beta/lib/prng.js", "../strided/beta/lib/main.js", "../strided/beta/lib/ndarray.js", "../strided/beta/lib/index.js", "../strided/betaprime/lib/prng.js", "../strided/betaprime/lib/main.js", "../strided/betaprime/lib/ndarray.js", "../strided/betaprime/lib/index.js", "../strided/chi/lib/factory.js", "../strided/chi/lib/main.js", "../strided/chi/lib/index.js", "../strided/chisquare/lib/factory.js", "../strided/chisquare/lib/main.js", "../strided/chisquare/lib/index.js", "../strided/cosine/lib/prng.js", "../strided/cosine/lib/main.js", "../strided/cosine/lib/ndarray.js", "../strided/cosine/lib/index.js", "../strided/discrete-uniform/lib/prng.js", "../strided/discrete-uniform/lib/main.js", "../strided/discrete-uniform/lib/ndarray.js", "../strided/discrete-uniform/lib/index.js", "../strided/exponential/lib/factory.js", "../strided/exponential/lib/main.js", "../strided/exponential/lib/index.js", "../strided/gamma/lib/prng.js", "../strided/gamma/lib/main.js", "../strided/gamma/lib/ndarray.js", "../strided/gamma/lib/index.js", "../strided/invgamma/lib/prng.js", "../strided/invgamma/lib/main.js", "../strided/invgamma/lib/ndarray.js", "../strided/invgamma/lib/index.js", "../strided/lognormal/lib/prng.js", "../strided/lognormal/lib/main.js", "../strided/lognormal/lib/ndarray.js", "../strided/lognormal/lib/index.js", "../strided/minstd/lib/main.js", "../strided/minstd/lib/ndarray.js", "../strided/minstd/lib/normalized.js", "../strided/minstd/lib/normalized.ndarray.js", "../strided/minstd/lib/index.js", "../strided/minstd-shuffle/lib/main.js", "../strided/minstd-shuffle/lib/ndarray.js", "../strided/minstd-shuffle/lib/normalized.js", "../strided/minstd-shuffle/lib/normalized.ndarray.js", "../strided/minstd-shuffle/lib/index.js", "../strided/mt19937/lib/main.js", "../strided/mt19937/lib/ndarray.js", "../strided/mt19937/lib/normalized.js", "../strided/mt19937/lib/normalized.ndarray.js", "../strided/mt19937/lib/index.js", "../strided/normal/lib/prng.js", "../strided/normal/lib/main.js", "../strided/normal/lib/ndarray.js", "../strided/normal/lib/index.js", "../strided/randu/lib/main.js", "../strided/randu/lib/ndarray.js", "../strided/randu/lib/index.js", "../strided/uniform/lib/prng.js", "../strided/uniform/lib/main.js", "../strided/uniform/lib/ndarray.js", "../strided/uniform/lib/index.js", "../strided/weibull/lib/prng.js", "../strided/weibull/lib/main.js", "../strided/weibull/lib/ndarray.js", "../strided/weibull/lib/index.js", "../strided/lib/index.js", "../lib/index.js"], + "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar contains = require( '@stdlib/array/base/assert/contains' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Array} dtypes - list of supported output data types\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, dtypes, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, dtypes, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( !contains( dtypes, opts.dtype ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', dtypes.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar contains = require( '@stdlib/array/base/assert/contains' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar ctors = require( '@stdlib/array/ctors' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Constructor for creating arrays filled with pseudorandom values drawn from a binary PRNG.\n*\n* @constructor\n* @param {Function} prng - binary pseudorandom value generator\n* @param {StringArray} dtypes - list of supported output data types\n* @param {string} dtype - default output data type\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be an array of strings\n* @throws {TypeError} third argument must be a supported data type\n* @returns {Random} instance\n*\n* @example\n* var arcsine = require( '@stdlib/random/base/arcsine' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( arcsine, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0, 5.0 );\n* // returns \n*/\nfunction Random( prng, dtypes, dtype ) {\n\tif ( !( this instanceof Random ) ) {\n\t\treturn new Random( prng, dtypes, dtype );\n\t}\n\tif ( !isFunction( prng ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) );\n\t}\n\t// TODO: tighten this up by actually validating that `dtypes` contains only recognized/supported dtype strings\n\tif ( !isStringArray( dtypes ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array of strings. Value: `%s`.', dtypes ) );\n\t}\n\t// Require that the default output array data type be a member of the list of supported output array data types...\n\tif ( !contains( dtypes, dtype ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a supported data type. Value: `%s`.', dtype ) );\n\t}\n\tthis._prng = prng;\n\tthis._dtypes = dtypes;\n\tthis._dtype = dtype;\n\treturn this;\n}\n\n/**\n* Returns an array filled with pseudorandom values drawn from a binary PRNG.\n*\n* @name generate\n* @memberof Random.prototype\n* @type {Function}\n* @param {NonNegativeInteger} len - number of elements\n* @param {*} param1 - first PRNG parameter\n* @param {*} param2 - second PRNG parameter\n* @param {Options} [options] - function options\n* @param {string} [options.dtype] - array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Collection} output array\n*\n* @example\n* var arcsine = require( '@stdlib/random/base/arcsine' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( arcsine, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0, 5.0 );\n* // returns \n*/\nsetReadOnly( Random.prototype, 'generate', function generate( len, param1, param2, options ) {\n\tvar ctor;\n\tvar opts;\n\tvar prng;\n\tvar out;\n\tvar err;\n\tvar dt;\n\tif ( !isNonNegativeInteger( len ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t}\n\topts = {};\n\tif ( arguments.length > 3 ) {\n\t\terr = validate( opts, this._dtypes, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// NOTE: we could alternatively use the PRNG factory function to create a nullary PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. The decision made here avoids this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom value. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in, e.g., a return value of `NaN` (however, realization of this benefit depends on the output array being a floating-point array).\n\tprng = this._prng;\n\tdt = opts.dtype || this._dtype;\n\tif ( dt === 'generic' ) {\n\t\treturn filledBy( len, wrapper );\n\t}\n\tctor = ctors( dt );\n\tout = new ctor( len );\n\tbinary( [ [ param1 ], [ param2 ], out ], [ len ], [ 0, 0, 1 ], prng );\n\treturn out;\n\n\t/**\n\t* Applies parameters to a pseudorandom value generator function.\n\t*\n\t* @private\n\t* @returns {*} pseudorandom value\n\t*/\n\tfunction wrapper() {\n\t\treturn prng( param1, param2 );\n\t}\n});\n\n/**\n* Fills an array with pseudorandom values drawn from a binary PRNG.\n*\n* @name assign\n* @memberof Random.prototype\n* @type {Function}\n* @param {*} param1 - first PRNG parameter\n* @param {*} param2 - second PRNG parameter\n* @param {Collection} out - output array\n* @throws {TypeError} third argument must be a collection\n* @returns {Collection} output array\n*\n* @example\n* var arcsine = require( '@stdlib/random/base/arcsine' );\n* var zeros = require( '@stdlib/array/zeros' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( arcsine, dtypes, defaultDType );\n*\n* var out = zeros( 10, 'float64' );\n* // returns \n*\n* var v = rand.assign( 2.0, 5.0, out );\n* // returns \n*\n* var bool = ( v === out );\n* // returns true\n*/\nsetReadOnly( Random.prototype, 'assign', function assign( param1, param2, out ) {\n\tif ( !isCollection( out ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an array-like object. Value: `%s`.', out ) );\n\t}\n\t// NOTE: we could alternatively use the PRNG factory function to create a nullary PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when filling small arrays. The decision made here avoids this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom value. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in, e.g., a return value of `NaN` (however, realization of this benefit depends on the output array being a floating-point array).\n\tbinary( [ [ param1 ], [ param2 ], out ], [ out.length ], [ 0, 0, 1 ], this._prng ); // eslint-disable-line max-len\n\treturn out;\n});\n\n\n// EXPORTS //\n\nmodule.exports = Random;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Constructor for creating arrays filled with pseudorandom values drawn from a binary PRNG.\n*\n* @module @stdlib/random/array/tools/binary\n*\n* @example\n* var arcsine = require( '@stdlib/random/base/arcsine' );\n* var Random = require( '@stdlib/random/array/tools/binary' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( arcsine, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0, 5.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar contains = require( '@stdlib/array/base/assert/contains' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Array} dtypes - list of supported output data types\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, dtypes, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, dtypes, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( !contains( dtypes, opts.dtype ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', dtypes.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar contains = require( '@stdlib/array/base/assert/contains' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar ctors = require( '@stdlib/array/ctors' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Constructor for creating arrays filled with pseudorandom values drawn from a nullary PRNG.\n*\n* @constructor\n* @param {Function} prng - nullary pseudorandom value generator\n* @param {StringArray} dtypes - list of supported output data types\n* @param {string} dtype - default output data type\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be an array of strings\n* @throws {TypeError} third argument must be a supported data type\n* @returns {Random} instance\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential.factory( 2.0 ), dtypes, defaultDType );\n*\n* var v = rand.generate( 10 );\n* // returns \n*/\nfunction Random( prng, dtypes, dtype ) {\n\tif ( !( this instanceof Random ) ) {\n\t\treturn new Random( prng, dtypes, dtype );\n\t}\n\tif ( !isFunction( prng ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) );\n\t}\n\t// TODO: tighten this up by actually validating that `dtypes` contains only recognized/supported dtype strings\n\tif ( !isStringArray( dtypes ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array of strings. Value: `%s`.', dtypes ) );\n\t}\n\t// Require that the default output array data type be a member of the list of supported output array data types...\n\tif ( !contains( dtypes, dtype ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a supported data type. Value: `%s`.', dtype ) );\n\t}\n\tthis._prng = prng;\n\tthis._dtypes = dtypes;\n\tthis._dtype = dtype;\n\treturn this;\n}\n\n/**\n* Returns an array filled with pseudorandom values drawn from a nullary PRNG.\n*\n* @name generate\n* @memberof Random.prototype\n* @type {Function}\n* @param {NonNegativeInteger} len - number of elements\n* @param {Options} [options] - function options\n* @param {string} [options.dtype] - array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Collection} output array\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential.factory( 2.0 ), dtypes, defaultDType );\n*\n* var v = rand.generate( 10 );\n* // returns \n*/\nsetReadOnly( Random.prototype, 'generate', function generate( len, options ) {\n\tvar ctor;\n\tvar opts;\n\tvar out;\n\tvar err;\n\tvar dt;\n\tif ( !isNonNegativeInteger( len ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t}\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, this._dtypes, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tdt = opts.dtype || this._dtype;\n\tif ( dt === 'generic' ) {\n\t\treturn filledBy( len, this._prng );\n\t}\n\tctor = ctors( dt );\n\tout = new ctor( len );\n\tnullary( [ out ], [ len ], [ 1 ], this._prng );\n\treturn out;\n});\n\n/**\n* Fills an array with pseudorandom values drawn from a nullary PRNG.\n*\n* @name assign\n* @memberof Random.prototype\n* @type {Function}\n* @param {Collection} out - output array\n* @throws {TypeError} first argument must be a collection\n* @returns {Collection} output array\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n* var zeros = require( '@stdlib/array/zeros' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential.factory( 2.0 ), dtypes, defaultDType );\n*\n* var out = zeros( 10, 'float64' );\n* // returns \n*\n* var v = rand.assign( out );\n* // returns \n*\n* var bool = ( v === out );\n* // returns true\n*/\nsetReadOnly( Random.prototype, 'assign', function assign( out ) {\n\tif ( !isCollection( out ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', out ) );\n\t}\n\tnullary( [ out ], [ out.length ], [ 1 ], this._prng );\n\treturn out;\n});\n\n\n// EXPORTS //\n\nmodule.exports = Random;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Constructor for creating arrays filled with pseudorandom values drawn from a nullary PRNG.\n*\n* @module @stdlib/random/array/tools/nullary\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n* var Random = require( '@stdlib/random/array/tools/nullary' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential.factory( 2.0 ), dtypes, defaultDType );\n*\n* var v = rand.generate( 10 );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isMethodIn = require( '@stdlib/assert/is-method-in' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar contains = require( '@stdlib/array/base/assert/contains' ).factory;\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar BinaryRandom = require( './../../../../array/tools/binary' );\nvar NullaryRandom = require( './../../../../array/tools/nullary' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a factory function for generating pseudorandom values drawn from a binary PRNG.\n*\n* @param {Function} prng - binary pseudorandom value generator\n* @param {Function} prng.factory - method which returns a new binary pseudorandom value generator\n* @param {StringArray} dtypes - list of supported output array data types\n* @param {string} dtype - default output array data type\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} first argument must have a `factory` method\n* @throws {TypeError} second argument must be an array of strings\n* @throws {TypeError} third argument must be a supported output array data type\n* @returns {Function} function which returns a function for creating arrays\n*\n* @example\n* var arcsine = require( '@stdlib/random/base/arcsine' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = createFactory( arcsine, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arcsine = require( '@stdlib/random/base/arcsine' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = createFactory( arcsine, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 2.0, 5.0, {\n* 'dtype': 'float32'\n* });\n* // returns \n*/\nfunction createFactory( prng, dtypes, dtype ) {\n\tvar isValidDataType;\n\tif ( !isFunction( prng ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) );\n\t}\n\tif ( !isMethodIn( prng, 'factory' ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must have a `%s` method.', 'factory' ) );\n\t}\n\t// TODO: tighten this up by actually validating that `dtypes` contains only recognized/supported dtype strings\n\tif ( !isStringArray( dtypes ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must an array of strings. Value: `%s`.', dtypes ) );\n\t}\n\t// Require that the default output array data type be a member of the list of supported output array data types...\n\tif ( !contains( dtypes, dtype ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a supported data type. Value: `%s`.', dtype ) );\n\t}\n\tisValidDataType = contains( dtypes );\n\treturn factory;\n\n\t/**\n\t* Returns a function for generating pseudorandom values drawn from a PRNG.\n\t*\n\t* @private\n\t* @param {*} [param1] - first PRNG parameter\n\t* @param {*} [param2] - second PRNG parameter\n\t* @param {Options} [options] - function options\n\t* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n\t* @param {*} [options.seed] - pseudorandom value generator seed\n\t* @param {*} [options.state] - pseudorandom value generator state\n\t* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom value generator state\n\t* @param {string} [options.dtype] - default output array data type\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {Function} function for creating arrays\n\t*/\n\tfunction factory() {\n\t\tvar Random;\n\t\tvar random;\n\t\tvar param1;\n\t\tvar param2;\n\t\tvar assign;\n\t\tvar nargs;\n\t\tvar base;\n\t\tvar opts;\n\t\tvar rand;\n\t\tvar dt;\n\n\t\tnargs = arguments.length;\n\t\tif ( nargs < 1 ) { // e.g., factory()\n\t\t\topts = {};\n\t\t\tbase = prng;\n\t\t\trand = rand1;\n\t\t} else if ( nargs === 1 ) { // e.g., factory( {} )\n\t\t\topts = arguments[ 0 ];\n\t\t\tbase = prng.factory( opts );\n\t\t\trand = rand1;\n\t\t} else if ( nargs === 2 ) { // e.g., factory( param1, param2 )\n\t\t\tparam1 = arguments[ 0 ];\n\t\t\tparam2 = arguments[ 1 ];\n\t\t\topts = {};\n\t\t\tbase = prng.factory( param1, param2 );\n\t\t\trand = rand2;\n\t\t} else { // e.g., factory( param1, param2, {} )\n\t\t\tparam1 = arguments[ 0 ];\n\t\t\tparam2 = arguments[ 1 ];\n\t\t\topts = arguments[ 2 ];\n\t\t\tbase = prng.factory( param1, param2, opts );\n\t\t\trand = rand2;\n\t\t}\n\t\tif ( hasOwnProp( opts, 'dtype' ) ) {\n\t\t\tdt = opts.dtype;\n\t\t\tif ( !isValidDataType( dt ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', dtypes.join( '\", \"' ), dt ) );\n\t\t\t}\n\t\t} else {\n\t\t\tdt = dtype;\n\t\t}\n\t\tif ( rand === rand1 ) {\n\t\t\tassign = assign1;\n\t\t\tRandom = BinaryRandom;\n\t\t} else {\n\t\t\tassign = assign2;\n\t\t\tRandom = NullaryRandom;\n\t\t}\n\t\trandom = new Random( base, dtypes, dt );\n\t\tif ( opts && opts.prng ) {\n\t\t\tsetReadOnly( rand, 'seed', null );\n\t\t\tsetReadOnly( rand, 'seedLength', null );\n\t\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\t\tsetReadOnly( rand, 'stateLength', null );\n\t\t\tsetReadOnly( rand, 'byteLength', null );\n\t\t} else {\n\t\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t\t}\n\t\tsetReadOnly( rand, 'PRNG', base.PRNG );\n\t\tsetReadOnly( rand, 'assign', assign );\n\t\treturn rand;\n\n\t\t/**\n\t\t* Returns an array of pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} len - output array length\n\t\t* @param {*} param1 - first PRNG parameter\n\t\t* @param {*} param2 - second PRNG parameter\n\t\t* @param {Options} [options] - function options\n\t\t* @param {string} [options.dtype] - output array data type\n\t\t* @throws {TypeError} first argument must be a nonnegative integer\n\t\t* @throws {TypeError} options argument must be an object\n\t\t* @throws {TypeError} must provide valid options\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction rand1( len, param1, param2, options ) {\n\t\t\tif ( arguments.length < 4 ) {\n\t\t\t\treturn random.generate( len, param1, param2 );\n\t\t\t}\n\t\t\treturn random.generate( len, param1, param2, options );\n\t\t}\n\n\t\t/**\n\t\t* Returns an array of pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} len - output array length\n\t\t* @param {Options} [options] - function options\n\t\t* @param {string} [options.dtype] - output array data type\n\t\t* @throws {TypeError} first argument must be a nonnegative integer\n\t\t* @throws {TypeError} options argument must be an object\n\t\t* @throws {TypeError} must provide valid options\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction rand2( len, options ) {\n\t\t\tif ( arguments.length < 2 ) {\n\t\t\t\treturn random.generate( len );\n\t\t\t}\n\t\t\treturn random.generate( len, options );\n\t\t}\n\n\t\t/**\n\t\t* Fills an array with pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {*} param1 - first PRNG parameter\n\t\t* @param {*} param2 - second PRNG parameter\n\t\t* @param {Collection} out - output array\n\t\t* @throws {TypeError} third argument must be a collection\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction assign1( param1, param2, out ) {\n\t\t\treturn random.assign( param1, param2, out );\n\t\t}\n\n\t\t/**\n\t\t* Fills an array with pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {Collection} out - output array\n\t\t* @throws {TypeError} first argument must be a collection\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction assign2( out ) {\n\t\t\treturn random.assign( out );\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG seed.\n\t\t*\n\t\t* @private\n\t\t* @returns {*} seed\n\t\t*/\n\t\tfunction getSeed() {\n\t\t\treturn rand.PRNG.seed;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG seed length.\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} seed length\n\t\t*/\n\t\tfunction getSeedLength() {\n\t\t\treturn rand.PRNG.seedLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG state length.\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} state length\n\t\t*/\n\t\tfunction getStateLength() {\n\t\t\treturn rand.PRNG.stateLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG state size (in bytes).\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} state size (in bytes)\n\t\t*/\n\t\tfunction getStateSize() {\n\t\t\treturn rand.PRNG.byteLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the current pseudorandom number generator state.\n\t\t*\n\t\t* @private\n\t\t* @returns {*} current state\n\t\t*/\n\t\tfunction getState() {\n\t\t\treturn rand.PRNG.state;\n\t\t}\n\n\t\t/**\n\t\t* Sets the pseudorandom number generator state.\n\t\t*\n\t\t* @private\n\t\t* @param {*} s - generator state\n\t\t* @throws {Error} must provide a valid state\n\t\t*/\n\t\tfunction setState( s ) {\n\t\t\trand.PRNG.state = s;\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = createFactory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a factory function for generating pseudorandom values drawn from a binary PRNG.\n*\n* @module @stdlib/random/array/tools/binary-factory\n*\n* @example\n* var arcsine = require( '@stdlib/random/base/arcsine' );\n* var binaryFactory = require( '@stdlib/random/array/tools/binary-factory' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = binaryFactory( arcsine, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 2.0, 5.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar UINT32_MAX = require( '@stdlib/constants/uint32/max' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\nvar MAX = UINT32_MAX - 1;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom integer on the interval \\\\( [1, 2^{32}-1) \\\\).\n*\n* @private\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = randuint32();\n* // returns \n*/\nfunction randuint32() {\n\tvar v = floor( 1.0 + (MAX*Math.random()) ); // eslint-disable-line stdlib/no-builtin-math\n\treturn v >>> 0; // asm type annotation\n}\n\n\n// EXPORTS //\n\nmodule.exports = randuint32;\n", "/* eslint-disable max-lines, max-len */\n\n/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The original C code and copyright notice are from the [source implementation][mt19937]. The implementation has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,\n* All rights reserved.\n*\n* Redistribution and use in source and binary forms, with or without\n* modification, are permitted provided that the following conditions\n* are met:\n*\n* 1. Redistributions of source code must retain the above copyright\n* notice, this list of conditions and the following disclaimer.\n*\n* 2. Redistributions in binary form must reproduce the above copyright\n* notice, this list of conditions and the following disclaimer in the\n* documentation and/or other materials provided with the distribution.\n*\n* 3. The names of its contributors may not be used to endorse or promote\n* products derived from this software without specific prior written\n* permission.\n*\n* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n* \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n* ```\n*\n* [mt19937]: http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/mt19937ar.c\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar FLOAT64_MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar UINT32_MAX = require( '@stdlib/constants/uint32/max' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar max = require( '@stdlib/math/base/special/max' );\nvar umul = require( '@stdlib/math/base/ops/umul' );\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar randuint32 = require( './rand_uint32.js' );\n\n\n// VARIABLES //\n\n// Define the size of the state array (see refs):\nvar N = 624;\n\n// Define a (magic) constant used for indexing into the state array:\nvar M = 397;\n\n// Define the maximum seed: 11111111111111111111111111111111\nvar MAX_SEED = UINT32_MAX >>> 0; // asm type annotation\n\n// For seed arrays, define an initial state (magic) constant: 19650218 => 00000001001010111101011010101010\nvar SEED_ARRAY_INIT_STATE = 19650218 >>> 0; // asm type annotation\n\n// Define a mask for the most significant `w-r` bits, where `w` is the word size (32 bits) and `r` is the separation point of one word (see refs): 2147483648 => 0x80000000 => 10000000000000000000000000000000\nvar UPPER_MASK = 0x80000000 >>> 0; // asm type annotation\n\n// Define a mask for the least significant `r` bits (see refs): 2147483647 => 0x7fffffff => 01111111111111111111111111111111\nvar LOWER_MASK = 0x7fffffff >>> 0; // asm type annotation\n\n// Define a multiplier (see Knuth TAOCP Vol2. 3rd Ed. P.106): 1812433253 => 01101100000001111000100101100101\nvar KNUTH_MULTIPLIER = 1812433253 >>> 0; // asm type annotation\n\n// Define a (magic) multiplier: 1664525 => 00000000000110010110011000001101\nvar MAGIC_MULTIPLIER_1 = 1664525 >>> 0; // asm type annotation\n\n// Define a (magic) multiplier: 1566083941 => 01011101010110001000101101100101\nvar MAGIC_MULTIPLIER_2 = 1566083941 >>> 0; // asm type annotation\n\n// Define a tempering coefficient: 2636928640 => 0x9d2c5680 => 10011101001011000101011010000000\nvar TEMPERING_COEFFICIENT_1 = 0x9d2c5680 >>> 0; // asm type annotation\n\n// Define a tempering coefficient: 4022730752 => 0xefc60000 => 11101111110001100000000000000000\nvar TEMPERING_COEFFICIENT_2 = 0xefc60000 >>> 0; // asm type annotation\n\n// Define a constant vector `a` (see refs): 2567483615 => 0x9908b0df => 10011001000010001011000011011111\nvar MATRIX_A = 0x9908b0df >>> 0; // asm type annotation\n\n// MAG01[x] = x * MATRIX_A; for x = {0,1}\nvar MAG01 = [ 0x0 >>> 0, MATRIX_A >>> 0 ]; // asm type annotation\n\n// Define a normalization constant when generating double-precision floating-point numbers: 2^53 => 9007199254740992\nvar FLOAT64_NORMALIZATION_CONSTANT = 1.0 / ( FLOAT64_MAX_SAFE_INTEGER+1.0 ); // eslint-disable-line id-length\n\n// 2^26: 67108864\nvar TWO_26 = 67108864 >>> 0; // asm type annotation\n\n// 2^32: 2147483648 => 0x80000000 => 10000000000000000000000000000000\nvar TWO_32 = 0x80000000 >>> 0; // asm type annotation\n\n// 1 (as a 32-bit unsigned integer): 1 => 0x1 => 00000000000000000000000000000001\nvar ONE = 0x1 >>> 0; // asm type annotation\n\n// Define the maximum normalized pseudorandom double-precision floating-point number: ( (((2^32-1)>>>5)*2^26)+( (2^32-1)>>>6) ) / 2^53\nvar MAX_NORMALIZED = FLOAT64_MAX_SAFE_INTEGER * FLOAT64_NORMALIZATION_CONSTANT;\n\n// Define the state array schema version:\nvar STATE_ARRAY_VERSION = 1; // NOTE: anytime the state array schema changes, this value should be incremented!!!\n\n// Define the number of sections in the state array:\nvar NUM_STATE_SECTIONS = 3; // state, other, seed\n\n// Define the index offset of the \"state\" section in the state array:\nvar STATE_SECTION_OFFSET = 2; // | version | num_sections | state_length | ...state | other_length | state_index | seed_length | ...seed |\n\n// Define the index offset of the \"other\" section in the state array:\nvar OTHER_SECTION_OFFSET = N + 3; // | version | num_sections | state_length | ...state | other_length | state_index | seed_length | ...seed |\n\n// Define the index offset of the seed section in the state array:\nvar SEED_SECTION_OFFSET = N + 5; // | version | num_sections | state_length | ...state | other_length | state_index | seed_length | ...seed |\n\n// Define the length of the \"fixed\" length portion of the state array:\nvar STATE_FIXED_LENGTH = N + 6; // 1 (version) + 1 (num_sections) + 1 (state_length) + N (state) + 1 (other_length) + 1 (state_index) + 1 (seed_length)\n\n\n// FUNCTIONS //\n\n/**\n* Verifies state array integrity.\n*\n* @private\n* @param {Uint32Array} state - state array\n* @param {boolean} FLG - flag indicating whether the state array was provided as an option (true) or an argument (false)\n* @returns {(Error|null)} an error or `null`\n*/\nfunction verifyState( state, FLG ) {\n\tvar s1;\n\tif ( FLG ) {\n\t\ts1 = 'option';\n\t} else {\n\t\ts1 = 'argument';\n\t}\n\t// The state array must have a minimum length...\n\tif ( state.length < STATE_FIXED_LENGTH+1 ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array has insufficient length.', s1 ) );\n\t}\n\t// The first element of the state array must equal the supported state array schema version...\n\tif ( state[ 0 ] !== STATE_ARRAY_VERSION ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array has an incompatible schema version. Expected: `%s`. Actual: `%s.`', s1, STATE_ARRAY_VERSION, state[ 0 ] ) );\n\t}\n\t// The second element of the state array must contain the number of sections...\n\tif ( state[ 1 ] !== NUM_STATE_SECTIONS ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array has an incompatible number of sections. Expected: `%s`. Actual: `%s`.', s1, NUM_STATE_SECTIONS, state[ 1 ] ) );\n\t}\n\t// The length of the \"state\" section must equal `N`...\n\tif ( state[ STATE_SECTION_OFFSET ] !== N ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array has an incompatible state length. Expected: `%u`. Actual: `%u`.', s1, N, state[ STATE_SECTION_OFFSET ] ) );\n\t}\n\t// The length of the \"other\" section must equal `1`...\n\tif ( state[ OTHER_SECTION_OFFSET ] !== 1 ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array has an incompatible section length. Expected: `%u`. Actual: `%u`.', s1, 1, state[ OTHER_SECTION_OFFSET ] ) );\n\t}\n\t// The length of the \"seed\" section much match the empirical length...\n\tif ( state[ SEED_SECTION_OFFSET ] !== state.length-STATE_FIXED_LENGTH ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array length is incompatible with seed section length. Expected: `%u`. Actual: `%u`.', s1, state.length-STATE_FIXED_LENGTH, state[ SEED_SECTION_OFFSET ] ) );\n\t}\n\treturn null;\n}\n\n/**\n* Returns an initial PRNG state.\n*\n* @private\n* @param {Uint32Array} state - state array\n* @param {PositiveInteger} N - state size\n* @param {uinteger32} s - seed\n* @returns {Uint32Array} state array\n*/\nfunction createState( state, N, s ) {\n\tvar i;\n\n\t// Set the first element of the state array to the provided seed:\n\tstate[ 0 ] = s >>> 0; // equivalent to `s & 0xffffffffUL` in original C implementation\n\n\t// Initialize the remaining state array elements:\n\tfor ( i = 1; i < N; i++ ) {\n\t\t/*\n\t\t* In the original C implementation (see `init_genrand()`),\n\t\t*\n\t\t* ```c\n\t\t* mt[i] = (KNUTH_MULTIPLIER * (mt[i-1] ^ (mt[i-1] >> 30)) + i)\n\t\t* ```\n\t\t*\n\t\t* In order to replicate this in JavaScript, we must emulate C-like multiplication of unsigned 32-bit integers.\n\t\t*/\n\t\ts = state[ i-1 ]>>>0; // asm type annotation\n\t\ts = ( s^(s>>>30) )>>>0; // asm type annotation\n\t\tstate[ i ] = ( umul( s, KNUTH_MULTIPLIER ) + i )>>>0; // asm type annotation\n\t}\n\treturn state;\n}\n\n/**\n* Initializes a PRNG state array according to a seed array.\n*\n* @private\n* @param {Uint32Array} state - state array\n* @param {NonNegativeInteger} N - state array length\n* @param {Collection} seed - seed array\n* @param {NonNegativeInteger} M - seed array length\n* @returns {Uint32Array} state array\n*/\nfunction initState( state, N, seed, M ) {\n\tvar s;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\ti = 1;\n\tj = 0;\n\tfor ( k = max( N, M ); k > 0; k-- ) {\n\t\t/*\n\t\t* In the original C implementation (see `init_by_array()`),\n\t\t*\n\t\t* ```c\n\t\t* mt[i] = (mt[i]^((mt[i-1]^(mt[i-1]>>30))*1664525UL)) + seed[j] + j;\n\t\t* ```\n\t\t*\n\t\t* In order to replicate this in JavaScript, we must emulate C-like multiplication of unsigned 32-bit integers.\n\t\t*/\n\t\ts = state[ i-1 ]>>>0; // asm type annotation\n\t\ts = ( s^(s>>>30) )>>>0; // asm type annotation\n\t\ts = ( umul( s, MAGIC_MULTIPLIER_1 ) )>>>0; // asm type annotation\n\t\tstate[ i ] = ( ((state[i]>>>0)^s) + seed[j] + j )>>>0; /* non-linear */ // asm type annotation\n\n\t\ti += 1;\n\t\tj += 1;\n\t\tif ( i >= N ) {\n\t\t\tstate[ 0 ] = state[ N-1 ];\n\t\t\ti = 1;\n\t\t}\n\t\tif ( j >= M ) {\n\t\t\tj = 0;\n\t\t}\n\t}\n\tfor ( k = N-1; k > 0; k-- ) {\n\t\t/*\n\t\t* In the original C implementation (see `init_by_array()`),\n\t\t*\n\t\t* ```c\n\t\t* mt[i] = (mt[i]^((mt[i-1]^(mt[i-1]>>30))*1566083941UL)) - i;\n\t\t* ```\n\t\t*\n\t\t* In order to replicate this in JavaScript, we must emulate C-like multiplication of unsigned 32-bit integers.\n\t\t*/\n\t\ts = state[ i-1 ]>>>0; // asm type annotation\n\t\ts = ( s^(s>>>30) )>>>0; // asm type annotation\n\t\ts = ( umul( s, MAGIC_MULTIPLIER_2 ) )>>>0; // asm type annotation\n\t\tstate[ i ] = ( ((state[i]>>>0)^s) - i )>>>0; /* non-linear */ // asm type annotation\n\n\t\ti += 1;\n\t\tif ( i >= N ) {\n\t\t\tstate[ 0 ] = state[ N-1 ];\n\t\t\ti = 1;\n\t\t}\n\t}\n\t// Ensure a non-zero initial state array:\n\tstate[ 0 ] = TWO_32; // MSB (most significant bit) is 1\n\n\treturn state;\n}\n\n/**\n* Updates a PRNG's internal state by generating the next `N` words.\n*\n* @private\n* @param {Uint32Array} state - state array\n* @returns {Uint32Array} state array\n*/\nfunction twist( state ) {\n\tvar w;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tk = N - M;\n\tfor ( i = 0; i < k; i++ ) {\n\t\tw = ( state[i]&UPPER_MASK ) | ( state[i+1]&LOWER_MASK );\n\t\tstate[ i ] = state[ i+M ] ^ ( w>>>1 ) ^ MAG01[ w&ONE ];\n\t}\n\tj = N - 1;\n\tfor ( ; i < j; i++ ) {\n\t\tw = ( state[i]&UPPER_MASK ) | ( state[i+1]&LOWER_MASK );\n\t\tstate[ i ] = state[ i-k ] ^ ( w>>>1 ) ^ MAG01[ w&ONE ];\n\t}\n\tw = ( state[j]&UPPER_MASK ) | ( state[0]&LOWER_MASK );\n\tstate[ j ] = state[ M-1 ] ^ ( w>>>1 ) ^ MAG01[ w&ONE ];\n\treturn state;\n}\n\n\n// MAIN //\n\n/**\n* Returns a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* ## Notes\n*\n* - In contrast to the original C implementation, array seeds of length `1` are considered integer seeds. This ensures that the seed `[ 1234 ]` generates the same output as the seed `1234`. In the original C implementation, the two seeds would yield different output, which is **not** obvious from a user perspective.\n*\n* @param {Options} [options] - options\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} a seed must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integers less than or equal to the maximum unsigned 32-bit integer\n* @throws {RangeError} a numeric seed must be a positive integer less than or equal to the maximum unsigned 32-bit integer\n* @throws {TypeError} state must be a `Uint32Array`\n* @throws {Error} must provide a valid state\n* @throws {TypeError} `copy` option must be a boolean\n* @returns {PRNG} Mersenne Twister PRNG\n*\n* @example\n* var mt19937 = factory();\n*\n* var v = mt19937();\n* // returns \n*\n* @example\n* // Return a seeded Mersenne Twister PRNG:\n* var mt19937 = factory({\n* 'seed': 1234\n* });\n*\n* var v = mt19937();\n* // returns 822569775\n*/\nfunction factory( options ) {\n\tvar STATE;\n\tvar state;\n\tvar opts;\n\tvar seed;\n\tvar slen;\n\tvar err;\n\n\topts = {};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( options.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', options.copy ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'state' ) ) {\n\t\t\tstate = options.state;\n\t\t\topts.state = true;\n\t\t\tif ( !isUint32Array( state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', state ) );\n\t\t\t}\n\t\t\terr = verifyState( state, true );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tSTATE = state;\n\t\t\t} else {\n\t\t\t\tSTATE = new Uint32Array( state.length );\n\t\t\t\tgcopy( state.length, state, 1, STATE, 1 );\n\t\t\t}\n\t\t\t// Create a state \"view\":\n\t\t\tstate = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );\n\n\t\t\t// Create a seed \"view\":\n\t\t\tseed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), state[ SEED_SECTION_OFFSET ] );\n\t\t}\n\t\t// If provided a PRNG state, we ignore the `seed` option...\n\t\tif ( seed === void 0 ) {\n\t\t\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\t\t\tseed = options.seed;\n\t\t\t\topts.seed = true;\n\t\t\t\tif ( isPositiveInteger( seed ) ) {\n\t\t\t\t\tif ( seed > MAX_SEED ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid option. `%s` option must be a positive integer less than or equal to the maximum unsigned 32-bit integer. Option: `%u`.', 'seed', seed ) );\n\t\t\t\t\t}\n\t\t\t\t\tseed >>>= 0; // asm type annotation\n\t\t\t\t} else if ( isCollection( seed ) === false || seed.length < 1 ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%s`.', 'seed', seed ) );\n\t\t\t\t} else if ( seed.length === 1 ) {\n\t\t\t\t\tseed = seed[ 0 ];\n\t\t\t\t\tif ( !isPositiveInteger( seed ) ) {\n\t\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%s`.', 'seed', seed ) );\n\t\t\t\t\t}\n\t\t\t\t\tif ( seed > MAX_SEED ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%u`.', 'seed', seed ) );\n\t\t\t\t\t}\n\t\t\t\t\tseed >>>= 0; // asm type annotation\n\t\t\t\t} else {\n\t\t\t\t\tslen = seed.length;\n\t\t\t\t\tSTATE = new Uint32Array( STATE_FIXED_LENGTH+slen );\n\n\t\t\t\t\t// Initialize sections:\n\t\t\t\t\tSTATE[ 0 ] = STATE_ARRAY_VERSION;\n\t\t\t\t\tSTATE[ 1 ] = NUM_STATE_SECTIONS;\n\t\t\t\t\tSTATE[ STATE_SECTION_OFFSET ] = N;\n\t\t\t\t\tSTATE[ OTHER_SECTION_OFFSET ] = 1;\n\t\t\t\t\tSTATE[ OTHER_SECTION_OFFSET+1 ] = N; // state index\n\t\t\t\t\tSTATE[ SEED_SECTION_OFFSET ] = slen;\n\n\t\t\t\t\t// Copy the provided seed array to prevent external mutation, as mutation would lead to an inability to reproduce PRNG values according to the PRNG's stated seed:\n\t\t\t\t\tgcopy.ndarray( slen, seed, 1, 0, STATE, 1, SEED_SECTION_OFFSET+1 );\n\n\t\t\t\t\t// Create a state \"view\":\n\t\t\t\t\tstate = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );\n\n\t\t\t\t\t// Create a seed \"view\":\n\t\t\t\t\tseed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), slen );\n\n\t\t\t\t\t// Initialize the internal PRNG state:\n\t\t\t\t\tstate = createState( state, N, SEED_ARRAY_INIT_STATE );\n\t\t\t\t\tstate = initState( state, N, seed, slen );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tseed = randuint32() >>> 0; // asm type annotation\n\t\t\t}\n\t\t}\n\t} else {\n\t\tseed = randuint32() >>> 0; // asm type annotation\n\t}\n\tif ( state === void 0 ) {\n\t\tSTATE = new Uint32Array( STATE_FIXED_LENGTH+1 );\n\n\t\t// Initialize sections:\n\t\tSTATE[ 0 ] = STATE_ARRAY_VERSION;\n\t\tSTATE[ 1 ] = NUM_STATE_SECTIONS;\n\t\tSTATE[ STATE_SECTION_OFFSET ] = N;\n\t\tSTATE[ OTHER_SECTION_OFFSET ] = 1;\n\t\tSTATE[ OTHER_SECTION_OFFSET+1 ] = N; // state index\n\t\tSTATE[ SEED_SECTION_OFFSET ] = 1;\n\t\tSTATE[ SEED_SECTION_OFFSET+1 ] = seed;\n\n\t\t// Create a state \"view\":\n\t\tstate = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );\n\n\t\t// Create a seed \"view\":\n\t\tseed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t// Initialize the internal PRNG state:\n\t\tstate = createState( state, N, seed );\n\t}\n\t// Note: property order matters in order to maintain consistency of PRNG \"shape\" (hidden classes).\n\tsetReadOnly( mt19937, 'NAME', 'mt19937' );\n\tsetReadOnlyAccessor( mt19937, 'seed', getSeed );\n\tsetReadOnlyAccessor( mt19937, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( mt19937, 'state', getState, setState );\n\tsetReadOnlyAccessor( mt19937, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( mt19937, 'byteLength', getStateSize );\n\tsetReadOnly( mt19937, 'toJSON', toJSON );\n\tsetReadOnly( mt19937, 'MIN', 0 );\n\tsetReadOnly( mt19937, 'MAX', UINT32_MAX );\n\tsetReadOnly( mt19937, 'normalized', normalized );\n\n\tsetReadOnly( normalized, 'NAME', mt19937.NAME );\n\tsetReadOnlyAccessor( normalized, 'seed', getSeed );\n\tsetReadOnlyAccessor( normalized, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( normalized, 'state', getState, setState );\n\tsetReadOnlyAccessor( normalized, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( normalized, 'byteLength', getStateSize );\n\tsetReadOnly( normalized, 'toJSON', toJSON );\n\tsetReadOnly( normalized, 'MIN', 0.0 );\n\tsetReadOnly( normalized, 'MAX', MAX_NORMALIZED );\n\n\treturn mt19937;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\tvar len = STATE[ SEED_SECTION_OFFSET ];\n\t\treturn gcopy( len, seed, 1, new Uint32Array( len ), 1 );\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn STATE[ SEED_SECTION_OFFSET ];\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn STATE.length;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn STATE.byteLength;\n\t}\n\n\t/**\n\t* Returns the current PRNG state.\n\t*\n\t* ## Notes\n\t*\n\t* - The PRNG state array is comprised of a preamble followed by `3` sections:\n\t*\n\t* 0. preamble (version + number of sections)\n\t* 1. internal PRNG state\n\t* 2. auxiliary state information\n\t* 3. PRNG seed\n\t*\n\t* - The first element of the PRNG state array preamble is the state array schema version.\n\t*\n\t* - The second element of the PRNG state array preamble is the number of state array sections (i.e., `3`).\n\t*\n\t* - The first element of each section following the preamble specifies the section length. The remaining section elements comprise the section contents.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\tvar len = STATE.length;\n\t\treturn gcopy( len, STATE, 1, new Uint32Array( len ), 1 );\n\t}\n\n\t/**\n\t* Sets the PRNG state.\n\t*\n\t* ## Notes\n\t*\n\t* - If PRNG state is \"shared\" (meaning a state array was provided during PRNG creation and **not** copied) and one sets the generator state to a state array having a different length, the PRNG does **not** update the existing shared state and, instead, points to the newly provided state array. In order to synchronize PRNG output according to the new shared state array, the state array for **each** relevant PRNG must be **explicitly** set.\n\t* - If PRNG state is \"shared\" and one sets the generator state to a state array of the same length, the PRNG state is updated (along with the state of all other PRNGs sharing the PRNG's state array).\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {TypeError} must provide a `Uint32Array`\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\tvar err;\n\t\tif ( !isUint32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a Uint32Array. Value: `%s`.', s ) );\n\t\t}\n\t\terr = verifyState( s, false );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( opts.copy === false ) {\n\t\t\tif ( opts.state && s.length === STATE.length ) {\n\t\t\t\tgcopy( s.length, s, 1, STATE, 1 ); // update current shared state\n\t\t\t} else {\n\t\t\t\tSTATE = s; // point to new shared state\n\t\t\t\topts.state = true; // setting this flag allows updating a shared state even if a state array was not provided at PRNG creation\n\t\t\t}\n\t\t} else {\n\t\t\t// Check if we can reuse allocated memory...\n\t\t\tif ( s.length !== STATE.length ) {\n\t\t\t\tSTATE = new Uint32Array( s.length ); // reallocate\n\t\t\t}\n\t\t\tgcopy( s.length, s, 1, STATE, 1 );\n\t\t}\n\t\t// Create a new state \"view\":\n\t\tstate = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );\n\n\t\t// Create a new seed \"view\":\n\t\tseed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), STATE[ SEED_SECTION_OFFSET ] );\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = mt19937.NAME;\n\t\tout.state = typedarray2json( STATE );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n\n\t/**\n\t* Generates a pseudorandom integer on the interval \\\\( [0, 2^{32}) \\\\).\n\t*\n\t* @private\n\t* @returns {uinteger32} pseudorandom integer\n\t*\n\t* @example\n\t* var r = mt19937();\n\t* // returns \n\t*/\n\tfunction mt19937() {\n\t\tvar r;\n\t\tvar i;\n\n\t\t// Retrieve the current state index:\n\t\ti = STATE[ OTHER_SECTION_OFFSET+1 ];\n\n\t\t// Determine whether we need to update the PRNG state:\n\t\tif ( i >= N ) {\n\t\t\tstate = twist( state );\n\t\t\ti = 0;\n\t\t}\n\t\t// Get the next word of \"raw\"/untempered state:\n\t\tr = state[ i ];\n\n\t\t// Update the state index:\n\t\tSTATE[ OTHER_SECTION_OFFSET+1 ] = i + 1;\n\n\t\t// Tempering transform to compensate for the reduced dimensionality of equidistribution:\n\t\tr ^= r >>> 11;\n\t\tr ^= ( r << 7 ) & TEMPERING_COEFFICIENT_1;\n\t\tr ^= ( r << 15 ) & TEMPERING_COEFFICIENT_2;\n\t\tr ^= r >>> 18;\n\n\t\treturn r >>> 0;\n\t}\n\n\t/**\n\t* Generates a pseudorandom number on the interval \\\\( [0, 1) \\\\).\n\t*\n\t* ## Notes\n\t*\n\t* - The original C implementation credits Isaku Wada for this algorithm (2002/01/09).\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var r = normalized();\n\t* // returns \n\t*/\n\tfunction normalized() {\n\t\tvar x = mt19937() >>> 5;\n\t\tvar y = mt19937() >>> 6;\n\t\treturn ( (x*TWO_26)+y ) * FLOAT64_NORMALIZATION_CONSTANT;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\nvar randuint32 = require( './rand_uint32.js' );\n\n\n// MAIN //\n\n/**\n* Generates a pseudorandom integer on the interval \\\\( [0, 2^{32}) \\\\).\n*\n* ## Method\n*\n* - When generating normalized double-precision floating-point numbers, we first generate two pseudorandom integers \\\\( x \\\\) and \\\\( y \\\\) on the interval \\\\( [0, 2^{32}) \\\\) for a combined \\\\( 64 \\\\) random bits.\n*\n* - We would like \\\\( 53 \\\\) random bits to generate a 53-bit precision integer and, thus, want to discard \\\\( 11 \\\\) of the generated bits.\n*\n* - We do so by discarding \\\\( 5 \\\\) bits from \\\\( x \\\\) and \\\\( 6 \\\\) bits from \\\\( y \\\\).\n*\n* - Accordingly, \\\\( x \\\\) contains \\\\( 27 \\\\) random bits, which are subsequently shifted left \\\\( 26 \\\\) bits (multiplied by \\\\( 2^{26} \\\\), and \\\\( y \\\\) contains \\\\( 26 \\\\) random bits to fill in the lower \\\\( 26 \\\\) bits. When summed, they combine to comprise \\\\( 53 \\\\) random bits of a double-precision floating-point integer.\n*\n* - As an example, suppose, for the sake of argument, the 32-bit PRNG generates the maximum unsigned 32-bit integer \\\\( 2^{32}-1 \\\\) twice in a row. Then,\n*\n* ```javascript\n* x = 4294967295 >>> 5; // 00000111111111111111111111111111\n* y = 4294967295 >>> 6; // 00000011111111111111111111111111\n* ```\n*\n* Multiplying \\\\( x \\\\) by \\\\( 2^{26} \\\\) returns \\\\( 9007199187632128 \\\\), which, in binary, is\n*\n* ```binarystring\n* 0 10000110011 11111111111111111111 11111100000000000000000000000000\n* ```\n*\n* Adding \\\\( y \\\\) yields \\\\( 9007199254740991 \\\\) (the maximum \"safe\" double-precision floating-point integer value), which, in binary, is\n*\n* ```binarystring\n* 0 10000110011 11111111111111111111 11111111111111111111111111111111\n* ```\n*\n* - Similarly, suppose the 32-bit PRNG generates the following values\n*\n* ```javascript\n* x = 1 >>> 5; // 0 => 00000000000000000000000000000000\n* y = 64 >>> 6; // 1 => 00000000000000000000000000000001\n* ```\n*\n* Multiplying \\\\( x \\\\) by \\\\( 2^{26} \\\\) returns \\\\( 0 \\\\), which, in binary, is\n*\n* ```binarystring\n* 0 00000000000 00000000000000000000 00000000000000000000000000000000\n* ```\n*\n* Adding \\\\( y \\\\) yields \\\\( 1 \\\\), which, in binary, is\n*\n* ```binarystring\n* 0 01111111111 00000000000000000000 00000000000000000000000000000000\n* ```\n*\n* - As different combinations of \\\\( x \\\\) and \\\\( y \\\\) are generated, different combinations of double-precision floating-point exponent and significand bits will be toggled, thus generating pseudorandom double-precision floating-point numbers.\n*\n* ## References\n*\n* - Matsumoto, Makoto, and Takuji Nishimura. 1998. \"Mersenne Twister: A 623-dimensionally Equidistributed Uniform Pseudo-random Number Generator.\" _ACM Transactions on Modeling and Computer Simulation_ 8 (1). New York, NY, USA: ACM: 3\u201330. doi:[10.1145/272991.272995][@matsumoto:1998a].\n* - Harase, Shin. 2017. \"Conversion of Mersenne Twister to double-precision floating-point numbers.\" _ArXiv_ abs/1708.06018 (September). .\n*\n* [@matsumoto:1998a]: https://doi.org/10.1145/272991.272995\n*\n* @function mt19937\n* @type {PRNG}\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = mt19937();\n* // returns \n*/\nvar mt19937 = factory({\n\t'seed': randuint32()\n});\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* A 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @module @stdlib/random/base/mt19937\n*\n* @example\n* var mt19937 = require( '@stdlib/random/base/mt19937' );\n*\n* var v = mt19937();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/mt19937' ).factory;\n*\n* var mt19937 = factory({\n* 'seed': 1234\n* });\n*\n* var v = mt19937();\n* // returns 822569775\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates values provided for minimum and maximum support.\n*\n* @private\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( a, b ) {\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\treturn new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar pow = require( '@stdlib/math/base/special/pow' );\nvar sin = require( '@stdlib/math/base/special/sin' );\nvar HALF_PI = require( '@stdlib/constants/float64/half-pi' );\n\n\n// MAIN //\n\n/**\n* Returns an arcsine distributed pseudorandom number with minimum support `a` and maximum support `b`.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @returns {number} pseudorandom number\n*/\nfunction arcsine( rand, a, b ) {\n\treturn a + ( pow( sin( HALF_PI*rand() ), 2.0 ) * ( b-a ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = arcsine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar arcsine0 = require( './arcsine.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating arcsine distributed random numbers.\n*\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var arcsine = factory( 0.0, 1.0 );\n*\n* var v = arcsine();\n* // returns \n*\n* @example\n* var arcsine = factory( -3.0, -1.0, {\n* 'seed': 297\n* });\n* var v = arcsine();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar a;\n\tvar b;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\ta = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\terr = validate( a, b );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( a === void 0 ) {\n\t\tprng = arcsine2;\n\t} else {\n\t\tprng = arcsine1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'arcsine' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( a === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ a, b ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a arcsine distributed pseudorandom number with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = arcsine1();\n\t* // returns \n\t*/\n\tfunction arcsine1() {\n\t\treturn arcsine0( rand, a, b );\n\t}\n\n\t/**\n\t* Returns an arcsine distributed pseudorandom number with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = arcsine2( 0.0, 1.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = arcsine2( 1.0, 0.0 );\n\t* // returns NaN\n\t*/\n\tfunction arcsine2( a, b ) {\n\t\tif (\n\t\t\tisnan( a ) ||\n\t\t\tisnan( b ) ||\n\t\t\ta >= b\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn arcsine0( rand, a, b );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an arcsine distributed pseudorandom number with minimum support `a` and maximum support `b`.\n*\n* @name arcsine\n* @type {PRNG}\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = arcsine( 0.0, 1.0 );\n* // returns \n*/\nvar arcsine = factory();\n\n\n// EXPORTS //\n\nmodule.exports = arcsine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Arcsine distribution pseudorandom numbers.\n*\n* @module @stdlib/random/base/arcsine\n*\n* @example\n* var arcsine = require( '@stdlib/random/base/arcsine' );\n*\n* var v = arcsine( 0.0, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/arcsine' ).factory;\n*\n* var arcsine = factory( -5.0, 5.0, {\n* 'seed': 297\n* });\n*\n* var v = arcsine();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/arcsine' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from an arcsine distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var arcsine = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = arcsine( 10 );\n* // returns \n*\n* @example\n* var arcsine = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = arcsine( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from an arcsine distribution.\n*\n* @name arcsine\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = arcsine( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = arcsine( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar arcsine = factory();\n\n\n// EXPORTS //\n\nmodule.exports = arcsine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from an arcsine distribution.\n*\n* @module @stdlib/random/array/arcsine\n*\n* @example\n* var arcsine = require( '@stdlib/random/array/arcsine' );\n*\n* var arr = arcsine( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arcsine = require( '@stdlib/random/array/arcsine' );\n*\n* var arr = arcsine( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var arcsine = require( '@stdlib/random/array/arcsine' );\n*\n* var rand = arcsine.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var arcsine = require( '@stdlib/random/array/arcsine' );\n*\n* var rand = arcsine.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar contains = require( '@stdlib/array/base/assert/contains' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Array} dtypes - list of supported output data types\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, dtypes, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, dtypes, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( !contains( dtypes, opts.dtype ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', dtypes.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar contains = require( '@stdlib/array/base/assert/contains' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar unary = require( '@stdlib/strided/base/unary' );\nvar ctors = require( '@stdlib/array/ctors' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Constructor for creating arrays filled with pseudorandom values drawn from a unary PRNG.\n*\n* @constructor\n* @param {Function} prng - unary pseudorandom value generator\n* @param {StringArray} dtypes - list of supported output data types\n* @param {string} dtype - default output data type\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be an array of strings\n* @throws {TypeError} third argument must be a supported data type\n* @returns {Random} instance\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0 );\n* // returns \n*/\nfunction Random( prng, dtypes, dtype ) {\n\tif ( !( this instanceof Random ) ) {\n\t\treturn new Random( prng, dtypes, dtype );\n\t}\n\tif ( !isFunction( prng ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) );\n\t}\n\t// TODO: tighten this up by actually validating that `dtypes` contains only recognized/supported dtype strings\n\tif ( !isStringArray( dtypes ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array of strings. Value: `%s`.', dtypes ) );\n\t}\n\t// Require that the default output array data type be a member of the list of supported output array data types...\n\tif ( !contains( dtypes, dtype ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a supported data type. Value: `%s`.', dtype ) );\n\t}\n\tthis._prng = prng;\n\tthis._dtypes = dtypes;\n\tthis._dtype = dtype;\n\treturn this;\n}\n\n/**\n* Returns an array filled with pseudorandom values drawn from a unary PRNG.\n*\n* @name generate\n* @memberof Random.prototype\n* @type {Function}\n* @param {NonNegativeInteger} len - number of elements\n* @param {*} param1 - PRNG parameter\n* @param {Options} [options] - function options\n* @param {string} [options.dtype] - array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Collection} output array\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0 );\n* // returns \n*/\nsetReadOnly( Random.prototype, 'generate', function generate( len, param1, options ) {\n\tvar ctor;\n\tvar opts;\n\tvar prng;\n\tvar out;\n\tvar err;\n\tvar dt;\n\tif ( !isNonNegativeInteger( len ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t}\n\topts = {};\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, this._dtypes, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// NOTE: we could alternatively use the PRNG factory function to create a nullary PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. The decision made here avoids this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom value. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in, e.g., a return value of `NaN` (however, realization of this benefit depends on the output array being a floating-point array).\n\tprng = this._prng;\n\tdt = opts.dtype || this._dtype;\n\tif ( dt === 'generic' ) {\n\t\treturn filledBy( len, wrapper );\n\t}\n\tctor = ctors( dt );\n\tout = new ctor( len );\n\tunary( [ [ param1 ], out ], [ len ], [ 0, 1 ], prng );\n\treturn out;\n\n\t/**\n\t* Applies parameters to a pseudorandom value generator function.\n\t*\n\t* @private\n\t* @returns {*} pseudorandom value\n\t*/\n\tfunction wrapper() {\n\t\treturn prng( param1 );\n\t}\n});\n\n/**\n* Fills an array with pseudorandom values drawn from a unary PRNG.\n*\n* @name assign\n* @memberof Random.prototype\n* @type {Function}\n* @param {*} param1 - PRNG parameter\n* @param {Collection} out - output array\n* @throws {TypeError} second argument must be a collection\n* @returns {Collection} output array\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n* var zeros = require( '@stdlib/array/zeros' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential, dtypes, defaultDType );\n*\n* var out = zeros( 10, 'float64' );\n* // returns \n*\n* var v = rand.assign( 2.0, out );\n* // returns \n*\n* var bool = ( v === out );\n* // returns true\n*/\nsetReadOnly( Random.prototype, 'assign', function assign( param1, out ) {\n\tif ( !isCollection( out ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object. Value: `%s`.', out ) );\n\t}\n\t// NOTE: we could alternatively use the PRNG factory function to create a nullary PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when filling small arrays. The decision made here avoids this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom value. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in, e.g., a return value of `NaN` (however, realization of this benefit depends on the output array being a floating-point array).\n\tunary( [ [ param1 ], out ], [ out.length ], [ 0, 1 ], this._prng );\n\treturn out;\n});\n\n\n// EXPORTS //\n\nmodule.exports = Random;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Constructor for creating arrays filled with pseudorandom values drawn from a unary PRNG.\n*\n* @module @stdlib/random/array/tools/unary\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n* var Random = require( '@stdlib/random/array/tools/unary' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isMethodIn = require( '@stdlib/assert/is-method-in' );\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar contains = require( '@stdlib/array/base/assert/contains' ).factory;\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar UnaryRandom = require( './../../../../array/tools/unary' );\nvar NullaryRandom = require( './../../../../array/tools/nullary' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a factory function for generating pseudorandom values drawn from a unary PRNG.\n*\n* @param {Function} prng - unary pseudorandom value generator\n* @param {Function} prng.factory - method which returns a new unary pseudorandom value generator\n* @param {StringArray} dtypes - list of supported output array data types\n* @param {string} dtype - default output array data type\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} first argument must have a `factory` method\n* @throws {TypeError} second argument must be an array of strings\n* @throws {TypeError} third argument must be a supported output array data type\n* @returns {Function} function which returns a function for creating arrays\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = createFactory( exponential, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 2.0 );\n* // returns \n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = createFactory( exponential, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 2.0, {\n* 'dtype': 'float32'\n* });\n* // returns \n*/\nfunction createFactory( prng, dtypes, dtype ) {\n\tvar isValidDataType;\n\tif ( !isFunction( prng ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) );\n\t}\n\tif ( !isMethodIn( prng, 'factory' ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must have a `%s` method.', 'factory' ) );\n\t}\n\t// TODO: tighten this up by actually validating that `dtypes` contains only recognized/supported dtype strings\n\tif ( !isStringArray( dtypes ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must an array of strings. Value: `%s`.', dtypes ) );\n\t}\n\t// Require that the default output array data type be a member of the list of supported output array data types...\n\tif ( !contains( dtypes, dtype ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a supported data type. Value: `%s`.', dtype ) );\n\t}\n\tisValidDataType = contains( dtypes );\n\treturn factory;\n\n\t/**\n\t* Returns a function for generating pseudorandom values drawn from a PRNG.\n\t*\n\t* @private\n\t* @param {*} [param1] - PRNG parameter\n\t* @param {Options} [options] - function options\n\t* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n\t* @param {*} [options.seed] - pseudorandom value generator seed\n\t* @param {*} [options.state] - pseudorandom value generator state\n\t* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom value generator state\n\t* @param {string} [options.dtype] - default output array data type\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {Function} function for creating arrays\n\t*/\n\tfunction factory() {\n\t\tvar Random;\n\t\tvar random;\n\t\tvar param1;\n\t\tvar assign;\n\t\tvar nargs;\n\t\tvar base;\n\t\tvar opts;\n\t\tvar rand;\n\t\tvar dt;\n\n\t\tnargs = arguments.length;\n\t\tif ( nargs < 1 ) { // e.g., factory()\n\t\t\topts = {};\n\t\t\tbase = prng;\n\t\t\trand = rand1;\n\t\t} else if ( nargs > 1 ) { // e.g., factory( param1, {} )\n\t\t\tparam1 = arguments[ 0 ];\n\t\t\topts = arguments[ 1 ];\n\t\t\tbase = prng.factory( param1, opts );\n\t\t\trand = rand2;\n\t\t} else if ( isPlainObject( arguments[ 0 ] ) ) { // e.g., factory( {} )\n\t\t\topts = arguments[ 0 ];\n\t\t\tbase = prng.factory( opts );\n\t\t\trand = rand1;\n\t\t} else { // e.g., factory( param1 )\n\t\t\tparam1 = arguments[ 0 ];\n\t\t\topts = {};\n\t\t\tbase = prng.factory( param1 );\n\t\t\trand = rand2;\n\t\t}\n\t\tif ( hasOwnProp( opts, 'dtype' ) ) {\n\t\t\tdt = opts.dtype;\n\t\t\tif ( !isValidDataType( dt ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', dtypes.join( '\", \"' ), dt ) );\n\t\t\t}\n\t\t} else {\n\t\t\tdt = dtype;\n\t\t}\n\t\tif ( rand === rand1 ) {\n\t\t\tassign = assign1;\n\t\t\tRandom = UnaryRandom;\n\t\t} else {\n\t\t\tassign = assign2;\n\t\t\tRandom = NullaryRandom;\n\t\t}\n\t\trandom = new Random( base, dtypes, dt );\n\t\tif ( opts && opts.prng ) {\n\t\t\tsetReadOnly( rand, 'seed', null );\n\t\t\tsetReadOnly( rand, 'seedLength', null );\n\t\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\t\tsetReadOnly( rand, 'stateLength', null );\n\t\t\tsetReadOnly( rand, 'byteLength', null );\n\t\t} else {\n\t\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t\t}\n\t\tsetReadOnly( rand, 'PRNG', base.PRNG );\n\t\tsetReadOnly( rand, 'assign', assign );\n\t\treturn rand;\n\n\t\t/**\n\t\t* Returns an array of pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} len - output array length\n\t\t* @param {*} param1 - PRNG parameter\n\t\t* @param {Options} [options] - function options\n\t\t* @param {string} [options.dtype] - output array data type\n\t\t* @throws {TypeError} first argument must be a nonnegative integer\n\t\t* @throws {TypeError} options argument must be an object\n\t\t* @throws {TypeError} must provide valid options\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction rand1( len, param1, options ) {\n\t\t\tif ( arguments.length < 3 ) {\n\t\t\t\treturn random.generate( len, param1 );\n\t\t\t}\n\t\t\treturn random.generate( len, param1, options );\n\t\t}\n\n\t\t/**\n\t\t* Returns an array of pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} len - output array length\n\t\t* @param {Options} [options] - function options\n\t\t* @param {string} [options.dtype] - output array data type\n\t\t* @throws {TypeError} first argument must be a nonnegative integer\n\t\t* @throws {TypeError} options argument must be an object\n\t\t* @throws {TypeError} must provide valid options\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction rand2( len, options ) {\n\t\t\tif ( arguments.length < 2 ) {\n\t\t\t\treturn random.generate( len );\n\t\t\t}\n\t\t\treturn random.generate( len, options );\n\t\t}\n\n\t\t/**\n\t\t* Fills an array with pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {*} param1 - PRNG parameter\n\t\t* @param {Collection} out - output array\n\t\t* @throws {TypeError} second argument must be a collection\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction assign1( param1, out ) {\n\t\t\treturn random.assign( param1, out );\n\t\t}\n\n\t\t/**\n\t\t* Fills an array with pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {Collection} out - output array\n\t\t* @throws {TypeError} first argument must be a collection\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction assign2( out ) {\n\t\t\treturn random.assign( out );\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG seed.\n\t\t*\n\t\t* @private\n\t\t* @returns {*} seed\n\t\t*/\n\t\tfunction getSeed() {\n\t\t\treturn rand.PRNG.seed;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG seed length.\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} seed length\n\t\t*/\n\t\tfunction getSeedLength() {\n\t\t\treturn rand.PRNG.seedLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG state length.\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} state length\n\t\t*/\n\t\tfunction getStateLength() {\n\t\t\treturn rand.PRNG.stateLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG state size (in bytes).\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} state size (in bytes)\n\t\t*/\n\t\tfunction getStateSize() {\n\t\t\treturn rand.PRNG.byteLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the current pseudorandom number generator state.\n\t\t*\n\t\t* @private\n\t\t* @returns {*} current state\n\t\t*/\n\t\tfunction getState() {\n\t\t\treturn rand.PRNG.state;\n\t\t}\n\n\t\t/**\n\t\t* Sets the pseudorandom number generator state.\n\t\t*\n\t\t* @private\n\t\t* @param {*} s - generator state\n\t\t* @throws {Error} must provide a valid state\n\t\t*/\n\t\tfunction setState( s ) {\n\t\t\trand.PRNG.state = s;\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = createFactory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a factory function for generating pseudorandom values drawn from a unary PRNG.\n*\n* @module @stdlib/random/array/tools/unary-factory\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n* var unaryFactory = require( '@stdlib/random/array/tools/unary-factory' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = unaryFactory( exponential, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Bernoulli distributed random numbers.\n*\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var bernoulli = factory( 0.5 );\n* var v = bernoulli();\n* // returns \n*\n* @example\n* var bernoulli = factory( 0.8, {\n* 'seed': 297\n* });\n* var v = bernoulli();\n* // returns \n*\n* @example\n* var bernoulli = factory();\n* var v = bernoulli( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar p;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tp = arguments[ 0 ];\n\t\tif ( !isProbability( p ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( p === void 0 ) {\n\t\tprng = bernoulli2;\n\t} else {\n\t\tprng = bernoulli1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'bernoulli' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( p === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ p ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Bernoulli distribution with bound parameter `p`.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = bernoulli1();\n\t* // returns \n\t*/\n\tfunction bernoulli1() {\n\t\treturn ( rand() <= p ) ? 1 : 0;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Bernoulli distribution with parameter `p`.\n\t*\n\t* @private\n\t* @param {Probability} p - success probability\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = bernoulli2( 0.5 );\n\t* // returns \n\t*/\n\tfunction bernoulli2( p ) {\n\t\tif (\n\t\t\tisnan( p ) ||\n\t\t\tp < 0.0 ||\n\t\t\tp > 1.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn ( rand() <= p ) ? 1 : 0;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom random number drawn from a Bernoulli distribution with parameter `p`.\n*\n* @name bernoulli\n* @type {PRNG}\n* @param {Probability} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var v = bernoulli( 0.5 );\n* // returns \n*\n* @example\n* var v = bernoulli( 3.14 );\n* // returns NaN\n*\n* @example\n* var v = bernoulli( -1.0 );\n* // returns NaN\n*\n* @example\n* var v = bernoulli( NaN );\n* // returns NaN\n*/\nvar bernoulli = factory();\n\n\n// EXPORTS //\n\nmodule.exports = bernoulli;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Bernoulli distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/bernoulli\n*\n* @example\n* var bernoulli = require( '@stdlib/random/base/bernoulli' );\n*\n* var v = bernoulli( 0.5 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/bernoulli' ).factory;\n*\n* var bernoulli = factory( 0.3, {\n* 'seed': 297\n* });\n*\n* var v = bernoulli();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/bernoulli' ).factory;\n*\n* var bernoulli = factory({\n* 'seed': 297\n* });\n*\n* var v = bernoulli( 0.5 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar unaryFactory = require( './../../../array/tools/unary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/bernoulli' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @name factory\n* @type {Function}\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `p` must be a probability (i.e., a number on the interval [0,1])\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var bernoulli = factory( 0.5 );\n* // returns \n*\n* var arr = bernoulli( 10 );\n* // returns \n*\n* @example\n* var bernoulli = factory( 0.5 );\n* // returns \n*\n* var arr = bernoulli( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = unaryFactory( base, DTYPES, defaults.get( 'dtypes.real' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @name bernoulli\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {Probability} p - success probability\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = bernoulli( 10, 0.5 );\n* // returns \n*\n* @example\n* var arr = bernoulli( 10, 0.5, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar bernoulli = factory();\n\n\n// EXPORTS //\n\nmodule.exports = bernoulli;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @module @stdlib/random/array/bernoulli\n*\n* @example\n* var bernoulli = require( '@stdlib/random/array/bernoulli' );\n*\n* var arr = bernoulli( 10, 0.5 );\n* // returns \n*\n* @example\n* var bernoulli = require( '@stdlib/random/array/bernoulli' );\n*\n* var arr = bernoulli( 10, 0.5, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var bernoulli = require( '@stdlib/random/array/bernoulli' );\n*\n* var rand = bernoulli.factory( 0.5 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var bernoulli = require( '@stdlib/random/array/bernoulli' );\n*\n* var rand = bernoulli.factory( 0.5 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar exp = require( '@stdlib/math/base/special/exp' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// VARIABLES //\n\n// (R*phi(R) + Pr(X>=R))*sqrt(2\\pi)\nvar V = 9.91256303526217e-3;\n\n\n// MAIN //\n\n/**\n* Returns an array containing coordinates such that each rectangle has the same area.\n*\n* @private\n* @param {PositiveInteger} N - number of rectangles\n* @param {number} rTail - start of right tail\n* @returns {NumberArray} coordinate array\n*\n* @example\n* var X = coordsArray( 128, 3.44 );\n* // returns \n*/\nfunction coordsArray( N, rTail ) {\n\tvar X;\n\tvar f;\n\tvar i;\n\n\tf = exp( -0.5 * rTail * rTail );\n\n\tX = [];\n\tX.push( V/f ); // bottom block: V / f(R)\n\tX.push( rTail );\n\tfor ( i = 2; i < N; i++ ) {\n\t\tX[ i ] = sqrt( -2.0 * ln( ( V/X[i-1] ) + f ) );\n\t\tf = exp( -0.5 * X[ i ] * X[ i ] );\n\t}\n\tX.push( 0.0 );\n\treturn X;\n}\n\n\n// EXPORTS //\n\nmodule.exports = coordsArray;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an array containing the ratio of each pair of consecutive elements in order: `X[ i+1 ] / X[ i ]`.\n*\n* @private\n* @param {NumberArray} X - input array\n* @returns {NumberArray} ratio array\n*\n* @example\n* var R = ratioArray( [ 1.0, 2.0, 5.0 ] );\n* // returns [ 2.0, 2.5 ]\n*/\nfunction ratioArray( X ) {\n\tvar R;\n\tvar i;\n\n\tR = [];\n\tfor ( i = 0; i < X.length-1; i++ ) {\n\t\tR.push( X[ i+1 ] / X[ i ] );\n\t}\n\treturn R;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ratioArray;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Transforms the tail of the normal distribution to the unit interval and then uses rejection technique to generate standard normal variable.\n*\n* ## References\n*\n* - Marsaglia, George. 1964. \"Generating a Variable from the Tail of the Normal Distribution.\" _Technometrics_ 6 (1): 101\u20132. doi:[10.1080/00401706.1964.10490150](http://dx.doi.org/10.1080/00401706.1964.10490150).\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator\n* @param {number} rTail - start value of the right tail\n* @param {boolean} isNegative - boolean indicating which side to evaluate\n* @returns {number} standard normal variable\n*/\nfunction sampleTail( rand, rTail, isNegative ) {\n\tvar x;\n\tvar y;\n\tdo {\n\t\tx = ln( rand() ) / rTail;\n\t\ty = ln( rand() );\n\t} while ( -2.0*y < x*x );\n\treturn ( isNegative ) ? x-rTail : rTail-x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sampleTail;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar exp = require( '@stdlib/math/base/special/exp' );\nvar coordsArray = require( './coords_array.js' );\nvar ratioArray = require( './ratio_array.js' );\nvar sampleTail = require( './sample_tail.js' );\n\n\n// VARIABLES //\n\n// Number of blocks:\nvar NUM_BLOCKS = 128;\n\n// Start of right tail (R):\nvar START_RIGHT_TAIL = 3.442619855899;\n\n// `X` holds coordinates, such that each rectangle has same area:\nvar X = coordsArray( NUM_BLOCKS, START_RIGHT_TAIL );\n\n// `R` holds `X[ i+1 ] / X[ i ]`:\nvar R = ratioArray( X );\n\n// 127 => 0x7F => 00000000000000000000000001111111\nvar LAST_7_BITS_MASK = 127|0; // asm type annotation\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator which implements the improved Ziggurat algorithm for generating normally distributed pseudorandom numbers.\n*\n* @private\n* @param {PRNG} randu - PRNG for generating uniformly distributed numbers\n* @param {PRNG} randi - PRNG for generating uniformly distributed integers\n* @returns {number} pseudorandom number\n*/\nfunction wrap( randu, randi ) {\n\treturn randn;\n\n\t/**\n\t* Generates a normally distributed pseudorandom number.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var r = randn();\n\t* // returns \n\t*/\n\tfunction randn() {\n\t\tvar f0;\n\t\tvar f1;\n\t\tvar x2;\n\t\tvar x;\n\t\tvar u;\n\t\tvar i;\n\t\tvar j;\n\t\twhile ( true ) {\n\t\t\tu = ( 2.0*randu() ) - 1.0;\n\t\t\ti = randi() & LAST_7_BITS_MASK;\n\n\t\t\t// First try the rectangular boxes...\n\t\t\tif ( abs( u ) < R[ i ] ) {\n\t\t\t\treturn u * X[ i ];\n\t\t\t}\n\t\t\t// If bottom box, sample from the tail...\n\t\t\tif ( i === 0 ) {\n\t\t\t\treturn sampleTail( randu, START_RIGHT_TAIL, u < 0.0 );\n\t\t\t}\n\t\t\t// Is this a sample from the wedges?\n\t\t\tx = u * X[ i ];\n\t\t\tx2 = x * x;\n\t\t\tj = i + 1;\n\t\t\tf0 = exp( -0.5 * ( (X[ i ]*X[ i ]) - x2 ) );\n\t\t\tf1 = exp( -0.5 * ( (X[ j ]*X[ j ]) - x2 ) );\n\t\t\tif ( f1 + (randu()*(f0-f1)) < 1.0 ) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = wrap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar mt19937 = require( './../../../base/mt19937' ).factory;\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar UINT32_MAX = require( '@stdlib/constants/uint32/max' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar improvedZiggurat = require( './improved_ziggurat.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator which implements the improved Ziggurat method to generate normally distributed pseudorandom numbers.\n*\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} must provide an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var randn = factory();\n*\n* var r = randn();\n* // returns \n*\n* @example\n* // Return a seeded PRNG:\n* var randn = factory({\n* 'seed': 12345\n* });\n*\n* var r = randn();\n* // returns \n*/\nfunction factory( options ) {\n\tvar randu;\n\tvar randi;\n\tvar randn;\n\tvar opts;\n\n\topts = {\n\t\t'copy': true\n\t};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( options.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', options.copy ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\t\tif ( !isFunction( options.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', options.prng ) );\n\t\t\t}\n\t\t\trandu = options.prng;\n\t\t}\n\t\t// If provided a PRNG, ignore the `state` option, as we don't support getting or setting PRNG state.\n\t\telse if ( hasOwnProp( options, 'state' ) ) {\n\t\t\topts.state = options.state;\n\t\t\tif ( !isUint32Array( options.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', options.state ) );\n\t\t\t}\n\t\t}\n\t\t// If provided a PRNG, ignore the `seed` option, as a `seed`, by itself, is insufficient to guarantee reproducibility. If provided a state, ignore the `seed` option, as a PRNG state should contain seed information.\n\t\telse if ( hasOwnProp( options, 'seed' ) ) {\n\t\t\topts.seed = options.seed;\n\t\t\tif ( options.seed === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%s`.', 'seed', options.seed ) );\n\t\t\t}\n\t\t}\n\t}\n\tif ( opts.state === void 0 ) {\n\t\tif ( randu === void 0 ) {\n\t\t\trandi = mt19937( opts );\n\t\t\trandu = randi.normalized;\n\t\t} else {\n\t\t\trandi = mt19937({\n\t\t\t\t'seed': floor( 1.0 + ( UINT32_MAX*randu() ) ), // allows seeding via an externally seeded PRNG\n\t\t\t\t'copy': opts.copy\n\t\t\t});\n\t\t\topts.seed = null;\n\t\t}\n\t} else {\n\t\trandi = mt19937( opts );\n\t\trandu = randi.normalized;\n\t}\n\trandn = improvedZiggurat( randu, randi );\n\n\tsetReadOnly( randn, 'NAME', 'improved-ziggurat' );\n\tif ( opts.seed === null ) {\n\t\tsetReadOnly( randn, 'seed', null );\n\t\tsetReadOnly( randn, 'seedLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( randn, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( randn, 'seedLength', getSeedLength );\n\t}\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( options && options.prng ) {\n\t\tsetReadWriteAccessor( randn, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( randn, 'stateLength', null );\n\t\tsetReadOnly( randn, 'byteLength', null );\n\t\tsetReadOnly( randn, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadWriteAccessor( randn, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( randn, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( randn, 'byteLength', getStateSize );\n\t\tsetReadOnly( randn, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( randn, 'PRNG', randu );\n\n\treturn randn;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn randi.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn randi.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn randi.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn randi.byteLength;\n\t}\n\n\t/**\n\t* Returns the current PRNG state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn randi.state;\n\t}\n\n\t/**\n\t* Sets the PRNG state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trandi.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = randn.NAME;\n\t\tout.state = typedarray2json( randi.state );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Generates a standard normally distributed random number.\n*\n* ## Method\n*\n* The basic Ziggurat method works as follows:\n*\n* ```tex\n* x_{C-1}(r) \\left[ f(0) - f\\left( x_{C-1}(r) \\right) \\right] - V(r) = 0\n* ```\n*\n* where\n*\n* ```tex\n* V(r) = r \\; f(r) + \\int_r^\\infty \\; f(x) \\; dx\n* ```\n*\n* and \\\\( r \\\\) denotes the right-most \\\\( x_1 \\\\).\n*\n* - We then use the following rejection algorithm:\n*\n* - Draw a box \\\\( B_i \\\\) at random with probability \\\\( \\tfrac{1}{C} \\\\).\n* - Draw a random number from the box as \\\\( z = U_0 x_i \\\\) for \\\\( i > 0 \\\\) and \\\\( z = U_0 V / f(x_1) \\\\).\n* - If \\\\( z < x_{i+1} \\\\), accept \\\\( z \\\\).\n* - If \\\\( i = 0 \\\\), accept a \\\\( v \\\\) by transforming the tail of the normal distribution to the unit interval and then use rejection technique by Marsaglia, G. (1964) to generate a standard normal variable. Otherwise, if \\\\( i > 0 \\\\) and \\\\( U_1 \\left[ f(x_i) - f(x_{i+1})\\right] < f(z) - f(x_{i+1}) \\\\) accept \\\\( z \\\\).\n* - Go back to the first step.\n*\n* - The improved version by Doornik (2005) changes step four in order to correct a deficiency of the original Ziggurat algorithm. The updated version requires the generation of two random numbers, a uniform variable drawn from \\\\( U(-1,1) \\\\) and the last seven bits of a random integer.\n*\n* ## References\n*\n* - Doornik, Jurgen A. 2005. \"An Improved Ziggurat Method to Generate Normal Random Samples.\" .\n* - Marsaglia, George, and Wai Wan Tsang. 2000. \"The Ziggurat Method for Generating Random Variables.\" _Journal of Statistical Software_ 5 (1): 1\u20137. doi:[10.18637/jss.v005.i08](http://dx.doi.org/10.18637/jss.v005.i08).\n* - Marsaglia, George. 1964. \"Generating a Variable from the Tail of the Normal Distribution.\" _Technometrics_ 6 (1): 101\u20132. doi:[10.1080/00401706.1964.10490150](http://dx.doi.org/10.1080/00401706.1964.10490150).\n*\n* @name randn\n* @type {PRNG}\n* @returns {number} pseudorandom number\n*\n* @example\n* var r = randn();\n* // returns \n*/\nvar randn = factory();\n\n\n// EXPORTS //\n\nmodule.exports = randn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Normally distributed pseudorandom numbers using the improved Ziggurat method.\n*\n* @module @stdlib/random/base/improved-ziggurat\n*\n* @example\n* var randn = require( '@stdlib/random/base/improved-ziggurat' );\n*\n* var r = randn();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/improved-ziggurat' ).factory;\n*\n* var randn = factory({\n* 'seed': 12345\n* });\n*\n* var r = randn();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, beta ) {\n\tif ( !isPositive( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ln = require( '@stdlib/math/base/special/ln' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar pow = require( '@stdlib/math/base/special/pow' );\n\n\n// VARIABLES //\n\nvar ONE_THIRD = 1.0 / 3.0;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a gamma distribution with rate parameter equal to 1.0 and shape parameter equal to `alpha`.\n*\n* @private\n* @param {PRNG} randu - PRNG for uniformly distributed numbers\n* @param {PRNG} randn - PRNG for standard normally distributed numbers\n* @param {PositiveNumber} alpha - shape parameter\n* @returns {PositiveNumber} pseudorandom number\n*/\nfunction standardGamma( randu, randn, alpha ) {\n\tvar flg;\n\tvar x2;\n\tvar v0;\n\tvar v1;\n\tvar c;\n\tvar d;\n\tvar x;\n\tvar s;\n\tvar u;\n\tvar v;\n\n\tif ( alpha < 1.0 ) {\n\t\td = alpha + 1.0 - ONE_THIRD;\n\t\tc = 1.0 / sqrt( 9.0*d );\n\t\ts = pow( randu(), 1.0/alpha );\n\t} else {\n\t\td = alpha - ONE_THIRD;\n\t\tc = 1.0 / sqrt( 9.0*d );\n\t\ts = 1.0;\n\t}\n\tflg = true;\n\twhile ( flg ) {\n\t\tdo {\n\t\t\tx = randn();\n\t\t\tv = 1.0 + (c*x);\n\t\t} while ( v <= 0.0 );\n\t\tv *= v * v;\n\t\tx2 = x * x;\n\t\tv0 = 1.0 - (0.331*x2*x2);\n\t\tv1 = (0.5*x2) + (d*( 1.0-v+ln(v) ));\n\t\tu = randu();\n\t\tif ( u < v0 || ln( u ) < v1 ) {\n\t\t\tflg = false;\n\t\t}\n\t}\n\treturn d * v * s;\n}\n\n\n// EXPORTS //\n\nmodule.exports = standardGamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar pow = require( '@stdlib/math/base/special/pow' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Handles case where `alpha` and `beta` are equal and greater than `1.5`.\n*\n* @private\n* @param {PRNG} randu - PRNG for uniformly distributed numbers\n* @param {PRNG} randn - PRNG for normally distributed numbers\n* @param {PositiveNumber} alpha - first shape parameter\n* @returns {Probability} pseudorandom number\n*/\nfunction sample( randu, randn, alpha ) {\n\tvar flg;\n\tvar s4;\n\tvar A;\n\tvar s;\n\tvar t;\n\tvar u;\n\tvar x;\n\tvar y;\n\n\tA = alpha - 1.0;\n\tt = pow( A+A, 0.5 );\n\n\tflg = true;\n\twhile ( flg === true ) {\n\t\ts = randn();\n\t\tx = 0.5 * ( 1.0+(s/t) );\n\t\tif ( x >= 0.0 && x <= 1.0 ) {\n\t\t\tu = randu();\n\t\t\ts4 = pow( s, 4.0 );\n\t\t\ty = (8.0*alpha) - 12.0;\n\t\t\ty = 1.0 - (s4 / y);\n\t\t\tif ( u <= y ) {\n\t\t\t\tflg = false;\n\t\t\t} else {\n\t\t\t\ty += 0.5 * pow( s4/((8.0*alpha)-8.0), 2.0 );\n\t\t\t\tif ( u < y ) {\n\t\t\t\t\ty = A * ln( 4.0*x*(1.0-x) );\n\t\t\t\t\ty += s*s / 2.0;\n\t\t\t\t\tif ( y >= ln( u ) ) {\n\t\t\t\t\t\tflg = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar pow = require( '@stdlib/math/base/special/pow' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Handles case where both `alpha` and `beta` are greater than `1.0`.\n*\n* @private\n* @param {PRNG} randu - PRNG for uniformly distributed numbers\n* @param {PRNG} randn - PRNG for normally distributed numbers\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {Probability} pseudorandom number\n*/\nfunction sample( randu, randn, alpha, beta ) {\n\tvar sigma;\n\tvar flg;\n\tvar mu;\n\tvar A;\n\tvar B;\n\tvar C;\n\tvar L;\n\tvar s;\n\tvar u;\n\tvar x;\n\tvar y;\n\n\tA = alpha - 1.0;\n\tB = beta - 1.0;\n\tC = A + B;\n\tL = C * ln( C );\n\tmu = A / C;\n\tsigma = 0.5 / pow( C, 0.5 );\n\n\tflg = true;\n\twhile ( flg === true ) {\n\t\ts = randn();\n\t\tx = mu + (s*sigma);\n\t\tif ( x >= 0.0 && x <= 1.0 ) {\n\t\t\tu = randu();\n\t\t\ty = A * ln( x/A );\n\t\t\ty += B * ln((1.0-x) / B);\n\t\t\ty += L + (0.5*s*s);\n\t\t\tif ( y >= ln( u ) ) {\n\t\t\t\tflg = false;\n\t\t\t}\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar exp = require( '@stdlib/math/base/special/exp' );\nvar pow = require( '@stdlib/math/base/special/pow' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Handles general case.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {Probability} pseudorandom number\n*/\nfunction sample( rand, alpha, beta ) {\n\tvar lx;\n\tvar ly;\n\tvar xy;\n\tvar u;\n\tvar v;\n\tvar x;\n\tvar y;\n\twhile ( true ) {\n\t\tu = rand();\n\t\tv = rand();\n\t\tx = pow( u, 1.0/alpha );\n\t\ty = pow( v, 1.0/beta );\n\t\txy = x + y;\n\t\tif ( xy <= 1.0 ) {\n\t\t\tif ( xy > 0.0 ) {\n\t\t\t\treturn x / ( xy );\n\t\t\t}\n\t\t\tlx = ln( u ) / alpha;\n\t\t\tly = ln( v ) / beta;\n\t\t\tif ( lx > ly ) {\n\t\t\t\tly -= lx;\n\t\t\t\tlx = 0.0;\n\t\t\t} else {\n\t\t\t\tlx -= ly;\n\t\t\t\tly = 0.0;\n\t\t\t}\n\t\t\treturn exp( lx - ln( exp(lx) + exp(ly) ) );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar standardGamma = require( './standard_gamma.js' );\nvar sample1 = require( './sample1.js' );\nvar sample2 = require( './sample2.js' );\nvar sample3 = require( './sample3.js' );\n\n\n// MAIN //\n\n/**\n* Returns a random number drawn from a beta distribution.\n*\n* @private\n* @param {PRNG} randu - pseudorandom number generator for uniformly distributed numbers\n* @param {PRNG} randn - pseudorandom number generator for normally distributed numbers\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {Probability} pseudorandom number\n*/\nfunction sample( randu, randn, alpha, beta ) {\n\tvar ga;\n\tvar gb;\n\tif ( alpha === beta && alpha > 1.5 ) {\n\t\treturn sample1( randu, randn, alpha );\n\t}\n\tif ( alpha > 1.0 && beta > 1.0 ) {\n\t\treturn sample2( randu, randn, alpha, beta );\n\t}\n\tif ( alpha < 1.0 && beta < 1.0 ) {\n\t\treturn sample3( randu, alpha, beta );\n\t}\n\t// General case of using two gamma random variates:\n\tga = standardGamma( randu, randn, alpha );\n\tgb = standardGamma( randu, randn, beta );\n\treturn ga / ( ga + gb );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar assign = require( '@stdlib/object/assign' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar beta0 = require( './beta.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating beta distributed random numbers.\n*\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var beta = factory( 2.0, 1.0 );\n* var v = beta();\n* // returns \n*\n* @example\n* var beta = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = beta();\n* // returns \n*/\nfunction factory() {\n\tvar STATE;\n\tvar rnorm;\n\tvar alpha;\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar FLG;\n\tvar err;\n\n\tFLG = true;\n\tif ( arguments.length === 0 ) {\n\t\topts = {\n\t\t\t'copy': false\n\t\t};\n\t\trand = randu( opts );\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t\topts = assign( {}, opts );\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tFLG = false;\n\t\t\t} else if ( opts.state ) {\n\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t}\n\t\t\topts.copy = false;\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( alpha, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t\t}\n\t\t\t\topts = assign( {}, opts );\n\t\t\t\tif ( opts.copy === false ) {\n\t\t\t\t\tFLG = false;\n\t\t\t\t} else if ( opts.state ) {\n\t\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\topts.copy = false;\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\topts = {\n\t\t\t\t'copy': false\n\t\t\t};\n\t\t\trand = randu( opts );\n\t\t}\n\t}\n\tif ( opts && opts.prng ) {\n\t\trnorm = randn({\n\t\t\t'prng': opts.prng\n\t\t});\n\t} else {\n\t\tif ( opts.state ) {\n\t\t\tSTATE = opts.state;\n\t\t} else {\n\t\t\tSTATE = rand.state;\n\t\t\trand.state = STATE; // updates the underlying PRNG to point to a shared state\n\t\t}\n\t\trnorm = randn({\n\t\t\t'state': STATE,\n\t\t\t'copy': false\n\t\t});\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = beta2;\n\t} else {\n\t\tprng = beta1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'beta' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {TypeError} must provide a `Uint32Array`\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\tif ( !isUint32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a Uint32Array. Value: `%s`.', s ) );\n\t\t}\n\t\tif ( FLG ) {\n\t\t\ts = gcopy( s.length, s, 1, new Uint32Array( s.length ), 1 );\n\t\t}\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a beta distribution with bound parameter values.\n\t*\n\t* @private\n\t* @returns {Probability} pseudorandom number\n\t*\n\t* @example\n\t* var v = beta1();\n\t* // returns \n\t*/\n\tfunction beta1() {\n\t\treturn beta0( rand, rnorm, alpha, beta );\n\t}\n\n\t/**\n\t* Returns a random number drawn from a beta distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - first shape parameter\n\t* @param {PositiveNumber} beta - second shape parameter\n\t* @returns {Probability} pseudorandom number\n\t*\n\t* @example\n\t* var v = beta2( 2.0, 3.0 );\n\t* // returns \n\t*/\n\tfunction beta2( alpha, beta ) {\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( beta ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn beta0( rand, rnorm, alpha, beta );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Generates a beta distributed random number.\n*\n* ## References\n*\n* - Ahrens, J.H., and U. Dieter. 1974. \"Computer methods for sampling from gamma, beta, poisson and bionomial distributions.\" _Computing_ 12 (3): 223\u201346. doi:[10.1007/BF02293108](http://dx.doi.org/10.1007/BF02293108).\n* - J\u00F6hnk, M.D. 1964. \"Erzeugung von Betaverteilten Und Gammaverteilten Zufallszahlen.\" _Metrika_ 8: 5\u201315. .\n*\n* @name beta\n* @type {PRNG}\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {Probability} pseudorandom number\n*\n* @example\n* var r = beta( 2.0, 5.0 );\n* // returns \n*\n* @example\n* var r = beta( -2.0, 5.0 );\n* // returns NaN\n*/\nvar beta = factory();\n\n\n// EXPORTS //\n\nmodule.exports = beta;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Beta distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/beta\n*\n* @example\n* var beta = require( '@stdlib/random/base/beta' );\n*\n* var v = beta( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/beta' ).factory;\n*\n* var beta = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = beta();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/beta' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a beta distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var beta = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = beta( 10 );\n* // returns \n*\n* @example\n* var beta = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = beta( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a beta distribution.\n*\n* @name beta\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = beta( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = beta( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar beta = factory();\n\n\n// EXPORTS //\n\nmodule.exports = beta;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a beta distribution.\n*\n* @module @stdlib/random/array/beta\n*\n* @example\n* var beta = require( '@stdlib/random/array/beta' );\n*\n* var arr = beta( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var beta = require( '@stdlib/random/array/beta' );\n*\n* var arr = beta( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var beta = require( '@stdlib/random/array/beta' );\n*\n* var rand = beta.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var beta = require( '@stdlib/random/array/beta' );\n*\n* var rand = beta.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, beta ) {\n\tif ( !isPositive( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a gamma distribution.\n*\n* @private\n* @param {PRNG} randu - PRNG for uniformly distributed numbers\n* @param {PRNG} randn - PRNG for standard normally distributed numbers\n* @param {PositiveNumber} beta - rate parameter\n* @param {PositiveNumber} d - `alpha + 2/3` or `alpha - 1/3`\n* @param {PositiveNumber} c - `1.0 / sqrt( 9.0*d )`\n* @returns {PositiveNumber} pseudorandom number\n*/\nfunction gamma( randu, randn, beta, d, c ) {\n\tvar flg;\n\tvar x2;\n\tvar v0;\n\tvar v1;\n\tvar x;\n\tvar u;\n\tvar v;\n\n\tflg = true;\n\twhile ( flg ) {\n\t\tdo {\n\t\t\tx = randn();\n\t\t\tv = 1.0 + (c*x);\n\t\t} while ( v <= 0.0 );\n\t\tv *= v * v;\n\t\tx2 = x * x;\n\t\tv0 = 1.0 - (0.331*x2*x2);\n\t\tv1 = (0.5*x2) + (d*( 1.0-v+ln(v) ));\n\t\tu = randu();\n\t\tif ( u < v0 || ln( u ) < v1 ) {\n\t\t\tflg = false;\n\t\t}\n\t}\n\treturn (1.0/beta) * d * v;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar pow = require( '@stdlib/math/base/special/pow' );\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar gamma0 = require( './gamma.js' );\n\n\n// VARIABLES //\n\nvar ONE_THIRD = 1.0 / 3.0;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating gamma distributed random numbers.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var gamma = factory( 2.0, 1.0 );\n* var v = gamma();\n* // returns \n*\n* @example\n* var gamma = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = gamma();\n* // returns \n*/\nfunction factory() {\n\tvar STATE;\n\tvar alpha;\n\tvar rnorm;\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar FLG;\n\tvar err;\n\tvar c;\n\tvar d;\n\n\tFLG = true;\n\tif ( arguments.length === 0 ) {\n\t\topts = {\n\t\t\t'copy': false\n\t\t};\n\t\trand = randu( opts );\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t\topts = assign( {}, opts );\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tFLG = false;\n\t\t\t} else if ( opts.state ) {\n\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t}\n\t\t\topts.copy = false;\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( alpha, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t\t}\n\t\t\t\topts = assign( {}, opts );\n\t\t\t\tif ( opts.copy === false ) {\n\t\t\t\t\tFLG = false;\n\t\t\t\t} else if ( opts.state ) {\n\t\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\topts.copy = false;\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\topts = {\n\t\t\t\t'copy': false\n\t\t\t};\n\t\t\trand = randu( opts );\n\t\t}\n\t}\n\tif ( opts && opts.prng ) {\n\t\trnorm = randn({\n\t\t\t'prng': opts.prng\n\t\t});\n\t} else {\n\t\tif ( opts.state ) {\n\t\t\tSTATE = opts.state;\n\t\t} else {\n\t\t\tSTATE = rand.state;\n\t\t\trand.state = STATE; // updates the underlying PRNG to point to a shared state\n\t\t}\n\t\trnorm = randn({\n\t\t\t'state': STATE,\n\t\t\t'copy': false\n\t\t});\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = gamma2;\n\t} else {\n\t\tif ( alpha >= 1.0 ) {\n\t\t\tprng = gamma1a;\n\t\t\td = alpha - ONE_THIRD;\n\t\t} else {\n\t\t\tprng = gamma1b;\n\t\t\td = alpha + 1.0 - ONE_THIRD;\n\t\t}\n\t\tc = 1.0 / sqrt( 9.0*d );\n\t}\n\tsetReadOnly( prng, 'NAME', 'gamma' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {TypeError} must provide a `Uint32Array`\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\tif ( !isUint32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a Uint32Array. Value: `%s`.', s ) );\n\t\t}\n\t\tif ( FLG ) {\n\t\t\ts = gcopy( s.length, s, 1, new Uint32Array( s.length ), 1 );\n\t\t}\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a gamma distribution with bound parameters when `alpha >= 1`.\n\t*\n\t* @private\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = gamma1a();\n\t* // returns \n\t*/\n\tfunction gamma1a() {\n\t\treturn gamma0( rand, rnorm, beta, d, c );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a gamma distribution with bound parameters when `alpha < 1`.\n\t*\n\t* @private\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = gamma1b();\n\t* // returns \n\t*/\n\tfunction gamma1b() {\n\t\treturn gamma0( rand, rnorm, beta, d, c ) * pow( rand(), 1.0/alpha );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a gamma distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - rate parameter\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = gamma2( 2.0, 4.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = gamma2( 3.0, 0.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = gamma2( 0.0, 2.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = gamma2( NaN, NaN );\n\t* // returns NaN\n\t*/\n\tfunction gamma2( alpha, beta ) {\n\t\tvar c;\n\t\tvar d;\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( beta ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\tif ( alpha < 1.0 ) {\n\t\t\td = alpha + 1.0 - ONE_THIRD;\n\t\t\tc = 1.0 / sqrt( 9.0*d );\n\t\t\treturn gamma0( rand, rnorm, beta, d, c ) * pow( rand(), 1.0/alpha );\n\t\t}\n\t\td = alpha - ONE_THIRD;\n\t\tc = 1.0 / sqrt( 9.0*d );\n\t\treturn gamma0( rand, rnorm, beta, d, c );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a gamma distribution.\n*\n* ## References\n*\n* - Marsaglia, George, and Wai Wan Tsang. 2000. \"A Simple Method for Generating Gamma Variables.\" _ACM Transactions on Mathematical Software_ 26 (3). New York, NY, USA: ACM: 363\u201372. doi:[10.1145/358407.358414](http://dx.doi.org/10.1145/358407.358414).\n*\n* @name gamma\n* @type {PRNG}\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @returns {PositiveNumber} pseudorandom number\n*\n* @example\n* var v = gamma( 2.0, 4.0 );\n* // returns \n*\n* @example\n* var v = gamma( -2.0, 4.0 );\n* // returns NaN\n*/\nvar gamma = factory();\n\n\n// EXPORTS //\n\nmodule.exports = gamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Gamma distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/gamma\n*\n* @example\n* var gamma = require( '@stdlib/random/base/gamma' );\n*\n* var v = gamma( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/gamma' ).factory;\n*\n* var gamma = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = gamma();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, beta ) {\n\tif ( !isPositive( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a random number drawn from a beta prime distribution.\n*\n* @private\n* @param {PRNG} rgamma - pseudorandom number generator for gamma distributed numbers\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {PositiveNumber} pseudorandom number\n*/\nfunction sample( rgamma, alpha, beta ) {\n\treturn rgamma( alpha, 1.0 ) / rgamma( beta, 1.0 );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar gammaFactory = require( './../../../base/gamma' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar betaprime0 = require( './betaprime.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating beta prime distributed random numbers.\n*\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var betaprime = factory( 2.0, 1.0 );\n* var v = betaprime();\n* // returns \n*\n* @example\n* var betaprime = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = betaprime();\n* // returns \n*/\nfunction factory() {\n\tvar rgamma;\n\tvar alpha;\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\tif ( arguments.length === 0 ) {\n\t\trgamma = gammaFactory();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\trgamma = gammaFactory( opts );\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( alpha, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\trgamma = gammaFactory( opts );\n\t\t} else {\n\t\t\trgamma = gammaFactory();\n\t\t}\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = betaprime2;\n\t} else {\n\t\tprng = betaprime1;\n\t}\n\trand = rgamma.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'betaprime' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a beta prime distribution with bound parameter values.\n\t*\n\t* @private\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = betaprime1();\n\t* // returns \n\t*/\n\tfunction betaprime1() {\n\t\treturn betaprime0( rgamma, alpha, beta );\n\t}\n\n\t/**\n\t* Returns a random number drawn from a beta prime distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - first shape parameter\n\t* @param {PositiveNumber} beta - second shape parameter\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = betaprime2( 2.0, 3.0 );\n\t* // returns \n\t*/\n\tfunction betaprime2( alpha, beta ) {\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( beta ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn betaprime0( rgamma, alpha, beta );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Generates a beta prime distributed random number.\n*\n* @name betaprime\n* @type {PRNG}\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {PositiveNumber} pseudorandom number\n*\n* @example\n* var r = betaprime( 2.0, 5.0 );\n* // returns \n*\n* @example\n* var r = betaprime( -2.0, 5.0 );\n* // returns NaN\n*/\nvar betaprime = factory();\n\n\n// EXPORTS //\n\nmodule.exports = betaprime;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Beta prime distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/betaprime\n*\n* @example\n* var betaprime = require( '@stdlib/random/base/betaprime' );\n*\n* var v = betaprime( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/betaprime' ).factory;\n*\n* var betaprime = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = betaprime();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/betaprime' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a beta prime distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var betaprime = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = betaprime( 10 );\n* // returns \n*\n* @example\n* var betaprime = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = betaprime( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a beta prime distribution.\n*\n* @name betaprime\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = betaprime( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = betaprime( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar betaprime = factory();\n\n\n// EXPORTS //\n\nmodule.exports = betaprime;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a beta prime distribution.\n*\n* @module @stdlib/random/array/betaprime\n*\n* @example\n* var betaprime = require( '@stdlib/random/array/betaprime' );\n*\n* var arr = betaprime( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var betaprime = require( '@stdlib/random/array/betaprime' );\n*\n* var arr = betaprime( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var betaprime = require( '@stdlib/random/array/betaprime' );\n*\n* var rand = betaprime.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var betaprime = require( '@stdlib/random/array/betaprime' );\n*\n* var rand = betaprime.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 10, 0.5 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( n, p ) {\n\tif ( !isPositiveInteger( n ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', p ) );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a probability. Value: `%s`.', p ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Generates a binomially distributed pseudorandom number by computing the sum of Bernoulli random variables.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction sample( rand, n, p ) {\n\tvar sum = 0;\n\tvar i;\n\tfor ( i = 0; i < n; i++ ) {\n\t\tif ( rand() <= p ) {\n\t\t\tsum += 1;\n\t\t}\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar pow = require( '@stdlib/math/base/special/pow' );\n\n\n// VARIABLES //\n\nvar ONE_12 = 1.0 / 12.0;\nvar ONE_360 = 1.0 / 360.0;\nvar ONE_1260 = 1.0 / 1260.0;\n\n\n// MAIN //\n\n/**\n* Returns a correction for Stirling's approximation.\n*\n* @private\n* @param {NonNegativeInteger} k - input argument\n* @returns {number} correction term\n*\n* @example\n* var c = correction( 0 );\n* // returns 0.08106146679532726\n*/\nfunction correction( k ) {\n\tvar v;\n\tswitch ( k ) {\n\tcase 0:\n\t\treturn 0.08106146679532726;\n\tcase 1:\n\t\treturn 0.04134069595540929;\n\tcase 2:\n\t\treturn 0.02767792568499834;\n\tcase 3:\n\t\treturn 0.02079067210376509;\n\tcase 4:\n\t\treturn 0.01664469118982119;\n\tcase 5:\n\t\treturn 0.01387612882307075;\n\tcase 6:\n\t\treturn 0.01189670994589177;\n\tcase 7:\n\t\treturn 0.01041126526197209;\n\tcase 8:\n\t\treturn 0.009255462182712733;\n\tcase 9:\n\t\treturn 0.008330563433362871;\n\tdefault:\n\t\tk += 1;\n\t\tv = pow( k, 2 );\n\t\treturn (ONE_12 - ((ONE_360 - (ONE_1260/v)) / v)) / k;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = correction;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar sign = require( '@stdlib/math/base/special/signum' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar ln = require( '@stdlib/math/base/special/ln' );\nvar correction = require( './correction.js' );\n\n\n// VARIABLES //\n\nvar ONE_SIXTH = 1.0 / 6.0;\n\n\n// MAIN //\n\n/**\n* Generates a binomially distributed pseudorandom number.\n*\n* ## References\n*\n* - H\u00F6rmann, Wolfgang. 1993. \"The generation of binomial random variates.\" _Journal of Statistical Computation and Simulation_ 46 (1-2): 101\u201310. doi:[10.1080/00949659308811496][@hormann:1993a].\n*\n* [@hormann:1993a]: http://dx.doi.org/10.1080/00949659308811496\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction sample( rand, n, p ) {\n\tvar alpha;\n\tvar urvr;\n\tvar snpq;\n\tvar npq;\n\tvar rho;\n\tvar tmp;\n\tvar nm;\n\tvar nr;\n\tvar us;\n\tvar km;\n\tvar nk;\n\tvar vr;\n\tvar a;\n\tvar b;\n\tvar c;\n\tvar f;\n\tvar h;\n\tvar i;\n\tvar k;\n\tvar m;\n\tvar q;\n\tvar r;\n\tvar t;\n\tvar u;\n\tvar v;\n\tvar x;\n\n\tm = floor( (n + 1) * p );\n\tnm = n - m + 1;\n\n\tq = 1.0 - p;\n\n\tr = p / q;\n\tnr = (n + 1) * r;\n\n\tnpq = n * p * q;\n\tsnpq = sqrt( npq );\n\n\tb = 1.15 + (2.53 * snpq);\n\ta = -0.0873 + (0.0248*b) + (0.01*p);\n\tc = (n*p) + 0.5;\n\n\talpha = (2.83 + (5.1/b)) * snpq;\n\n\tvr = 0.92 - (4.2/b);\n\turvr = 0.86 * vr;\n\n\th = (m + 0.5) * ln( (m+1) / (r*nm) );\n\th += correction( m ) + correction( n-m );\n\n\twhile ( true ) {\n\t\tv = rand();\n\t\tif ( v <= urvr ) {\n\t\t\tu = (v/vr) - 0.43;\n\t\t\tr = (u * ( (2.0*a / (0.5 - abs(u))) + b )) + c;\n\t\t\treturn floor( r );\n\t\t}\n\t\tif ( v >= vr ) {\n\t\t\tu = rand() - 0.5;\n\t\t} else {\n\t\t\tu = (v/vr) - 0.93;\n\t\t\tu = (sign( u ) * 0.5) - u;\n\t\t\tv = vr * rand();\n\t\t}\n\t\tus = 0.5 - abs(u);\n\t\tk = floor( (u * ( (2.0*a/us) + b )) + c );\n\t\tif ( k < 0 || k > n ) {\n\t\t\t// Try again...\n\t\t\tcontinue;\n\t\t}\n\t\tv = v * alpha / ( (a/(us*us)) + b );\n\t\tkm = abs( k - m );\n\t\tif ( km > 15 ) {\n\t\t\tv = ln( v );\n\t\t\trho = km / npq;\n\t\t\ttmp = ( (km/3) + 0.625 ) * km;\n\t\t\ttmp += ONE_SIXTH;\n\t\t\ttmp /= npq;\n\t\t\trho *= tmp + 0.5;\n\t\t\tt = -(km * km) / (2.0 * npq);\n\t\t\tif ( v < t - rho ) {\n\t\t\t\treturn k;\n\t\t\t}\n\t\t\tif ( v <= t + rho ) {\n\t\t\t\tnk = n - k + 1;\n\t\t\t\tx = h + ( (n+1)*ln( nm/nk ) );\n\t\t\t\tx += (k+0.5) * ln( nk*r/(k+1) );\n\t\t\t\tx += -(correction( k ) + correction( n-k ));\n\t\t\t\tif ( v <= x ) {\n\t\t\t\t\treturn k;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tf = 1.0;\n\t\t\tif ( m < k ) {\n\t\t\t\tfor ( i = m; i <= k; i++ ) {\n\t\t\t\t\tf *= (nr/i) - r;\n\t\t\t\t}\n\t\t\t} else if ( m > k ) {\n\t\t\t\tfor ( i = k; i <= m; i++ ) {\n\t\t\t\t\tv *= (nr/i) - r;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( v <= f ) {\n\t\t\t\treturn k;\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sample1 = require( './sample1.js' );\nvar sample2 = require( './sample2.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a binomial distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - probability of success\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction sample( rand, n, p ) {\n\tif ( p > 0.5 ) {\n\t\treturn n - sample( rand, n, 1.0-p );\n\t}\n\tif ( n*p < 10.0 ) {\n\t\treturn sample1( rand, n, p );\n\t}\n\treturn sample2( rand, n, p );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isPositiveInteger = require( '@stdlib/math/base/assert/is-positive-integer' );\nvar isProbability = require( '@stdlib/math/base/assert/is-probability' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar binomial0 = require( './binomial.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating binomially distributed random numbers.\n*\n* @param {PositiveInteger} [n] - number of trials\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `n` must be a positive integer\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var binomial = factory( 17, 0.5 );\n* var v = binomial();\n* // returns \n*\n* @example\n* var binomial = factory( 8, 0.8, {\n* 'seed': 297\n* });\n* var v = binomial();\n* // returns \n*\n* @example\n* var binomial = factory();\n* var v = binomial( 20, 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar n;\n\tvar p;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tn = arguments[ 0 ];\n\t\tp = arguments[ 1 ];\n\t\terr = validate( n, p );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( n === void 0 ) {\n\t\tprng = binomial2;\n\t}\n\telse {\n\t\tprng = binomial1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'binomial' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( n === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ n, p ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a binomial distribution with bound parameter values.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var r = binomial1();\n\t* // returns \n\t*/\n\tfunction binomial1() {\n\t\treturn binomial0( rand, n, p );\n\t}\n\n\t/**\n\t* Returns a random number drawn from a binomial distribution.\n\t*\n\t* @private\n\t* @param {PositiveInteger} n - number of trials\n\t* @param {Probability} p - success probability\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var r = binomial2( 20, 0.8 );\n\t* // returns \n\t*/\n\tfunction binomial2( n, p ) {\n\t\tif (\n\t\t\tisnan( n ) ||\n\t\t\tisnan( p ) ||\n\t\t\t!isPositiveInteger( n ) ||\n\t\t\t!isProbability( p )\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn binomial0( rand, n, p );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Generates a binomially distributed random number.\n*\n* ## Method\n*\n* - For \\\\(np < 10\\\\), the function generates Bernoulli random variates and returns their sum.\n* - For \\\\(np \\geq 10\\\\), the function uses the [BTRD algorithm][@hormann:1993a].\n*\n* ## References\n*\n* - H\u00F6rmann, Wolfgang. 1993. \"The generation of binomial random variates.\" _Journal of Statistical Computation and Simulation_ 46 (1-2): 101\u201310. doi:[10.1080/00949659308811496][@hormann:1993a].\n*\n* [@hormann:1993a]: http://dx.doi.org/10.1080/00949659308811496\n*\n* @name binomial\n* @type {PRNG}\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @throws {TypeError} `n` must be a positive integer\n* @throws {TypeError} `p` must be a probability\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var r = binomial( 20, 0.8 );\n* // returns \n*/\nvar binomial = factory();\n\n\n// EXPORTS //\n\nmodule.exports = binomial;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Binomial distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/binomial\n*\n* @example\n* var binomial = require( '@stdlib/random/base/binomial' );\n*\n* var v = binomial( 20, 0.4 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/binomial' ).factory;\n*\n* var binomial = factory( 90, 0.8, {\n* 'seed': 297\n* });\n*\n* var v = binomial();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/binomial' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a binomial distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveInteger} [n] - number of trials\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `n` must be a positive integer\n* @throws {TypeError} `p` must be a probability (i.e., a number on the interval [0,1])\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var binomial = factory( 17, 0.5 );\n* // returns \n*\n* var arr = binomial( 10 );\n* // returns \n*\n* @example\n* var binomial = factory( 17, 0.5 );\n* // returns \n*\n* var arr = binomial( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a binomial distribution.\n*\n* @name binomial\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = binomial( 10, 17, 0.5 );\n* // returns \n*\n* @example\n* var arr = binomial( 10, 17, 0.5, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar binomial = factory();\n\n\n// EXPORTS //\n\nmodule.exports = binomial;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a binomial distribution.\n*\n* @module @stdlib/random/array/binomial\n*\n* @example\n* var binomial = require( '@stdlib/random/array/binomial' );\n*\n* var arr = binomial( 10, 17, 0.5 );\n* // returns \n*\n* @example\n* var binomial = require( '@stdlib/random/array/binomial' );\n*\n* var arr = binomial( 10, 17, 0.5, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var binomial = require( '@stdlib/random/array/binomial' );\n*\n* var rand = binomial.factory( 17, 0.5 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var binomial = require( '@stdlib/random/array/binomial' );\n*\n* var rand = binomial.factory( 17, 0.5 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.5 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( x0, gamma ) {\n\tif ( !isNumber( x0 ) || isnan( x0 ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', x0 ) );\n\t}\n\tif ( !isPositive( gamma ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', gamma ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar tan = require( '@stdlib/math/base/special/tan' );\nvar PI = require( '@stdlib/constants/float64/pi' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Cauchy distribution.\n*\n* @private\n* @param {PRNG} randn - PRNG for normally distributed numbers\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction cauchy( randn, x0, gamma ) {\n\treturn x0 + ( gamma*tan( PI*( randn()-0.5 ) ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = cauchy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar cauchy0 = require( './cauchy.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a Cauchy distribution.\n*\n* @param {number} [x0] - location parameter\n* @param {PositiveNumber} [gamma] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `x0` must be a number\n* @throws {TypeError} `gamma` argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var cauchy = factory( 0.0, 1.0 );\n* var v = cauchy();\n* // returns \n*\n* @example\n* var cauchy = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = cauchy();\n* // returns \n*/\nfunction factory() {\n\tvar gamma;\n\tvar rnorm;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar x0;\n\n\tif ( arguments.length === 0 ) {\n\t\trnorm = randn();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trnorm = randn({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trnorm = randn( opts );\n\t\t}\n\t} else {\n\t\tx0 = arguments[ 0 ];\n\t\tgamma = arguments[ 1 ];\n\t\terr = validate( x0, gamma );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trnorm = randn({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trnorm = randn( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trnorm = randn();\n\t\t}\n\t}\n\tif ( x0 === void 0 ) {\n\t\tprng = cauchy2;\n\t} else {\n\t\tprng = cauchy1;\n\t}\n\trand = rnorm.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'cauchy' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( x0 === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ x0, gamma ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a Cauchy distribution with bound parameters `x0` and `gamma`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = cauchy1();\n\t* // returns \n\t*/\n\tfunction cauchy1() {\n\t\treturn cauchy0( rnorm, x0, gamma );\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a Cauchy distribution.\n\t*\n\t* @private\n\t* @param {number} x0 - location parameter\n\t* @param {PositiveNumber} gamma - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = cauchy2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var r = cauchy2( 1.0, -1.5 );\n\t* // returns NaN\n\t*/\n\tfunction cauchy2( x0, gamma ) {\n\t\tif (\n\t\t\tisnan( x0 ) ||\n\t\t\tisnan( gamma ) ||\n\t\t\tgamma <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn cauchy0( rnorm, x0, gamma );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a Cauchy distribution.\n*\n* @name cauchy\n* @type {PRNG}\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = cauchy( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = cauchy( 0.0, -1.0 );\n* // returns NaN\n*/\nvar cauchy = factory();\n\n\n// EXPORTS //\n\nmodule.exports = cauchy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Cauchy distribution pseudorandom numbers.\n*\n* @module @stdlib/random/base/cauchy\n*\n* @example\n* var cauchy = require( '@stdlib/random/base/cauchy' );\n*\n* var v = cauchy( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/cauchy' ).factory;\n*\n* var cauchy = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = cauchy();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/cauchy' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [x0] - location parameter\n* @param {PositiveNumber} [gamma] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `x0` must be a number\n* @throws {TypeError} `gamma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var cauchy = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = cauchy( 10 );\n* // returns \n*\n* @example\n* var cauchy = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = cauchy( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @name cauchy\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = cauchy( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = cauchy( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar cauchy = factory();\n\n\n// EXPORTS //\n\nmodule.exports = cauchy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @module @stdlib/random/array/cauchy\n*\n* @example\n* var cauchy = require( '@stdlib/random/array/cauchy' );\n*\n* var arr = cauchy( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var cauchy = require( '@stdlib/random/array/cauchy' );\n*\n* var arr = cauchy( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var cauchy = require( '@stdlib/random/array/cauchy' );\n*\n* var rand = cauchy.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var cauchy = require( '@stdlib/random/array/cauchy' );\n*\n* var rand = cauchy.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar gamma = require( './../../../base/gamma' ).factory;\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating chi-square distributed random numbers.\n*\n* @param {PositiveNumber} [k] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var chisquare = factory( 2 );\n* var v = chisquare();\n* // returns \n*\n* @example\n* var chisquare = factory( 2, {\n* 'seed': 297\n* });\n* var v = chisquare();\n* // returns \n*/\nfunction factory() {\n\tvar rgamma;\n\tvar rand;\n\tvar opts;\n\tvar prng;\n\tvar k;\n\tif ( arguments.length === 0 ) {\n\t\trgamma = gamma();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trgamma = gamma({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trgamma = gamma( opts );\n\t\t}\n\t} else {\n\t\tk = arguments[ 0 ];\n\t\tif ( !isPositive( k ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trgamma = gamma( k/2.0, 0.5, {\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trgamma = gamma( k/2.0, 0.5, opts );\n\t\t\t}\n\t\t} else {\n\t\t\trgamma = gamma( k/2.0, 0.5 );\n\t\t}\n\t}\n\tif ( k === void 0 ) {\n\t\tprng = chisquare2;\n\t} else {\n\t\tprng = chisquare1;\n\t}\n\trand = rgamma.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'chisquare' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( k === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ k ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a chi-square distribution with bound `k`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = chisquare1();\n\t* // returns \n\t*/\n\tfunction chisquare1() {\n\t\treturn rgamma();\n\t}\n\n\t/**\n\t* Returns a random number drawn from a chi-square distribution with degrees of freedom `k`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - degrees of freedom\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = chisquare2( 2 );\n\t* // returns \n\t*/\n\tfunction chisquare2( k ) {\n\t\tif (\n\t\t\tisnan( k ) ||\n\t\t\tk <= 0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn rgamma( k/2.0, 0.5 );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a chi-square distribution with degrees of freedom `k`.\n*\n* @function chisquare\n* @type {PRNG}\n* @param {PositiveNumber} k - degrees of freedom\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = chisquare( 2 );\n* // returns \n*\n* @example\n* var v = chisquare( 0 );\n* // returns NaN\n*\n* @example\n* var v = chisquare( NaN );\n* // returns NaN\n*/\nvar chisquare = factory();\n\n\n// EXPORTS //\n\nmodule.exports = chisquare;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Chi-square distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/chisquare\n*\n* @example\n* var chisquare = require( '@stdlib/random/base/chisquare' );\n*\n* var v = chisquare( 6 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/chisquare' ).factory;\n*\n* var chisquare = factory( 3, {\n* 'seed': 297\n* });\n*\n* var v = chisquare();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar chisquare = require( './../../../base/chisquare' ).factory;\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating chi distributed random numbers.\n*\n* @param {PositiveNumber} [k] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var chi = factory( 2 );\n* var v = chi();\n* // returns \n*\n* @example\n* var chi = factory( 2, {\n* 'seed': 297\n* });\n* var v = chi();\n* // returns \n*/\nfunction factory() {\n\tvar rchisq;\n\tvar rand;\n\tvar opts;\n\tvar prng;\n\tvar k;\n\tif ( arguments.length === 0 ) {\n\t\trchisq = chisquare();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trchisq = chisquare({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trchisq = chisquare( opts );\n\t\t}\n\t} else {\n\t\tk = arguments[ 0 ];\n\t\tif ( !isPositive( k ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trchisq = chisquare( k, {\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trchisq = chisquare( k, opts );\n\t\t\t}\n\t\t} else {\n\t\t\trchisq = chisquare( k );\n\t\t}\n\t}\n\tif ( k === void 0 ) {\n\t\tprng = chi2;\n\t} else {\n\t\tprng = chi1;\n\t}\n\trand = rchisq.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'chi' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( k === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ k ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a chi distribution with bound `k`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = chi1();\n\t* // returns \n\t*/\n\tfunction chi1() {\n\t\treturn sqrt( rchisq() );\n\t}\n\n\t/**\n\t* Returns a random number drawn from a chi distribution with degrees of freedom `k`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - degrees of freedom\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = chi2( 2 );\n\t* // returns \n\t*/\n\tfunction chi2( k ) {\n\t\tif (\n\t\t\tisnan( k ) ||\n\t\t\tk <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn sqrt( rchisq( k ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a chi distribution with degrees of freedom `k`.\n*\n* @name chi\n* @type {PRNG}\n* @param {PositiveNumber} k - degrees of freedom\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = chi( 2 );\n* // returns \n*\n* @example\n* var v = chi( 0 );\n* // returns NaN\n*\n* @example\n* var v = chi( NaN );\n* // returns NaN\n*/\nvar chi = factory();\n\n\n// EXPORTS //\n\nmodule.exports = chi;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Chi distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/chi\n*\n* @example\n* var chi = require( '@stdlib/random/base/chi' );\n*\n* var v = chi( 6 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/chi' ).factory;\n*\n* var chi = factory( 3, {\n* 'seed': 297\n* });\n*\n* var v = chi();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar unaryFactory = require( './../../../array/tools/unary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/chi' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a chi distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [k] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var chi = factory( 2.0 );\n* // returns \n*\n* var arr = chi( 10 );\n* // returns \n*\n* @example\n* var chi = factory( 2.0 );\n* // returns \n*\n* var arr = chi( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = unaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a chi distribution.\n*\n* @name chi\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = chi( 10, 2.0 );\n* // returns \n*\n* @example\n* var arr = chi( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar chi = factory();\n\n\n// EXPORTS //\n\nmodule.exports = chi;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a chi distribution.\n*\n* @module @stdlib/random/array/chi\n*\n* @example\n* var chi = require( '@stdlib/random/array/chi' );\n*\n* var arr = chi( 10, 2.0 );\n* // returns \n*\n* @example\n* var chi = require( '@stdlib/random/array/chi' );\n*\n* var arr = chi( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var chi = require( '@stdlib/random/array/chi' );\n*\n* var rand = chi.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var chi = require( '@stdlib/random/array/chi' );\n*\n* var rand = chi.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar unaryFactory = require( './../../../array/tools/unary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/chisquare' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a chi-square distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [k] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var chisquare = factory( 2.0 );\n* // returns \n*\n* var arr = chisquare( 10 );\n* // returns \n*\n* @example\n* var chisquare = factory( 2.0 );\n* // returns \n*\n* var arr = chisquare( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = unaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a chi-square distribution.\n*\n* @name chisquare\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = chisquare( 10, 2.0 );\n* // returns \n*\n* @example\n* var arr = chisquare( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar chisquare = factory();\n\n\n// EXPORTS //\n\nmodule.exports = chisquare;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a chi-square distribution.\n*\n* @module @stdlib/random/array/chisquare\n*\n* @example\n* var chisquare = require( '@stdlib/random/array/chisquare' );\n*\n* var arr = chisquare( 10, 2.0 );\n* // returns \n*\n* @example\n* var chisquare = require( '@stdlib/random/array/chisquare' );\n*\n* var arr = chisquare( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var chisquare = require( '@stdlib/random/array/chisquare' );\n*\n* var rand = chisquare.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var chisquare = require( '@stdlib/random/array/chisquare' );\n*\n* var rand = chisquare.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - location parameter\n* @param {PositiveNumber} s - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, s ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( s ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar quantile = require( '@stdlib/stats/base/dists/cosine/quantile' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a raised cosine distribution using inverse transform sampling.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction sample( rand, mu, s ) {\n\treturn quantile( rand(), mu, s );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar cosine0 = require( './cosine.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a raised cosine distribution.\n*\n* @param {number} [mu] - mean parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var cosine = factory( 0.0, 1.0 );\n* var v = cosine();\n* // returns \n*\n* @example\n* var cosine = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = cosine();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\tvar s;\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\ts = arguments[ 1 ];\n\t\terr = validate( mu, s );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = cosine2;\n\t} else {\n\t\tprng = cosine1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'cosine' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, s ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a raised cosine distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = cosine1();\n\t* // returns \n\t*/\n\tfunction cosine1() {\n\t\treturn cosine0( rand, mu, s );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a raised cosine distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} s - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = cosine2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = cosine2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction cosine2( mu, s ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( s ) ||\n\t\t\ts <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn cosine0( rand, mu, s );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a raised cosine distribution.\n*\n* @name cosine\n* @type {PRNG}\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = cosine( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = cosine( 0.0, -1.0 );\n* // returns NaN\n*/\nvar cosine = factory();\n\n\n// EXPORTS //\n\nmodule.exports = cosine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Raised cosine distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/cosine\n*\n* @example\n* var cosine = require( '@stdlib/random/base/cosine' );\n*\n* var v = cosine( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/cosine' ).factory;\n* var cosine = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = cosine();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/cosine' ).factory;\n* var cosine = factory({\n* 'seed': 297\n* });\n*\n* var v = cosine( 3.0, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/cosine' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [s] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var cosine = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = cosine( 10 );\n* // returns \n*\n* @example\n* var cosine = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = cosine( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @name cosine\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = cosine( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = cosine( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar cosine = factory();\n\n\n// EXPORTS //\n\nmodule.exports = cosine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @module @stdlib/random/array/cosine\n*\n* @example\n* var cosine = require( '@stdlib/random/array/cosine' );\n*\n* var arr = cosine( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var cosine = require( '@stdlib/random/array/cosine' );\n*\n* var arr = cosine( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var cosine = require( '@stdlib/random/array/cosine' );\n*\n* var rand = cosine.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var cosine = require( '@stdlib/random/array/cosine' );\n*\n* var rand = cosine.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates values provided for minimum and maximum support.\n*\n* @private\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1, 20 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( a, b ) {\n\tif ( !isInteger( a ) || isnan( a ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be an integer and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isInteger( b ) || isnan( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be an integer and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a > b ) {\n\t\treturn new RangeError( format( 'invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d, %d]`.', a, b ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The original C++ code and copyright notice are from the [Boost library]{http://www.boost.org/doc/libs/1_65_1/doc/html/boost/random/uniform_int_distribution.html}. The implementation has been modified for JavaScript.\n*\n* ```text\n* (C) Copyright John Maddock 2006.\n* (C) Copyright Steven Watanabe 2011.\n*\n* Use, modification and distribution are subject to the\n* Boost Software License, Version 1.0. (See accompanying file\n* LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a discrete uniform distribution with minimum support `a` and maximum support `b`.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator which outputs integer values\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @returns {integer} pseudorandom number\n*/\nfunction discreteUniform( rand, a, b ) {\n\tvar result;\n\tvar RANGE;\n\tvar range;\n\tvar limit;\n\tvar bsize;\n\tvar mult;\n\tvar MIN;\n\tvar MAX;\n\tvar inc;\n\n\trange = b - a;\n\tif ( range === 0 ) {\n\t\treturn a;\n\t}\n\tMIN = rand.MIN;\n\tMAX = rand.MAX;\n\tRANGE = MAX - MIN;\n\tif ( RANGE === range ) {\n\t\treturn ( rand()-MIN ) + a;\n\t}\n\tif ( RANGE < range ) {\n\t\tlimit = 0;\n\t\twhile ( true ) {\n\t\t\t// Avoid overflow...\n\t\t\tif ( range === MAX_SAFE_INTEGER ) { // in JavaScript, we only explicitly have doubles\n\t\t\t\tlimit = floor( range / (RANGE+1) );\n\t\t\t\tif ( range%(RANGE+1) === RANGE ) { // e.g., 5%(2+1) == 2\n\t\t\t\t\tlimit += 1;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlimit = floor( (range+1) / (RANGE+1) );\n\t\t\t}\n\t\t\t// We consider `result` as expressed base `(RANGE+1)`:\n\t\t\tresult = 0;\n\n\t\t\t// For every power of `(RANGE+1)`, we determine a random factor:\n\t\t\tmult = 1;\n\n\t\t\t// Loop invariants: result < mult && mult <= range\n\t\t\twhile ( mult <= limit ) {\n\t\t\t\t// Note: see first and second post-conditions.\n\t\t\t\tresult += (rand() - MIN) * mult;\n\n\t\t\t\t// Equivalent to (mult * (RANGE+1)) == range+1, but avoids overflow...\n\t\t\t\tif ( mult*RANGE === range-mult+1 ) {\n\t\t\t\t\t// The destination range is an integer power of the generator's range...\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t\t// Note: see third post-condition.\n\t\t\t\tmult *= RANGE + 1;\n\t\t\t}\n\t\t\t// range/mult < RANGE+1 (no endless loop)\n\t\t\tinc = discreteUniform( rand, 0, floor( range/mult ) );\n\t\t\tif ( inc > MAX_SAFE_INTEGER/mult ) {\n\t\t\t\t// The multiplication would overflow, so reject immediately...\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tinc *= mult;\n\t\t\tresult += inc;\n\n\t\t\t// NOTE: if we were working with unsigned integers, we would need to check that `result` is NOT less than `inc`, as unsigned integers wrap on overflow. In which case, we would need to reject.\n\n\t\t\tif ( result > range ) {\n\t\t\t\t// Result is too big, so reject...\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn result + a;\n\t\t}\n\t}\n\t// Case: RANGE > range\n\n\t// When determining the bucket size, avoid overflow...\n\tif ( RANGE === MAX_SAFE_INTEGER ) { // in JavaScript, we only explicitly have doubles\n\t\tbsize = floor( RANGE / (range+1) );\n\t\tif ( RANGE%(range+1) === range ) { // e.g., 5%(2+1) == 2\n\t\t\tbsize += 1;\n\t\t}\n\t} else {\n\t\tbsize = floor( (RANGE+1) / (range+1) );\n\t}\n\twhile ( true ) {\n\t\tresult = rand() - MIN;\n\t\tresult = floor( result / bsize );\n\t\tif ( result <= range ) {\n\t\t\treturn result + a;\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randi = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isInteger = require( '@stdlib/math/base/assert/is-integer' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar discreteUniform0 = require( './discrete_uniform.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers draw from a discrete uniform distribution.\n*\n* @param {integer} [a] - minimum support\n* @param {integer} [b] - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom integers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `a` must be an integer\n* @throws {TypeError} `b` must be an integer\n* @throws {RangeError} `a` must be less than or equal to `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} provided PRNG must have a valid `MIN` property\n* @throws {TypeError} provided PRNG must have a valid `MAX` property\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var discreteUniform = factory( 1, 10 );\n* var v = discreteUniform();\n* // returns \n*\n* @example\n* var discreteUniform = factory( -30, -1, {\n* 'seed': 297\n* });\n* var v = discreteUniform();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar a;\n\tvar b;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randi();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t\tif ( !isInteger( rand.MIN ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must have a `MIN` property specifying the minimum possible pseudorandom integer value.', 'prng' ) );\n\t\t\t}\n\t\t\tif ( !isInteger( rand.MAX ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must have a `MAX` property specifying the maximum possible pseudorandom integer value.', 'prng' ) );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randi( opts );\n\t\t}\n\t} else {\n\t\ta = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\terr = validate( a, b );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t\tif ( !isInteger( rand.MIN ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must have a `MIN` property specifying the minimum possible pseudorandom integer value.', 'prng' ) );\n\t\t\t\t}\n\t\t\t\tif ( !isInteger( rand.MAX ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must have a `MAX` property specifying the maximum possible pseudorandom integer value.', 'prng' ) );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\trand = randi( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randi();\n\t\t}\n\t}\n\tif ( a === void 0 ) {\n\t\tprng = discreteUniform2;\n\t} else {\n\t\tprng = discreteUniform1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'discrete-uniform' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( a === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ a, b ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a discrete uniform distribution with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @returns {integer} pseudorandom number\n\t*\n\t* @example\n\t* var v = discreteUniform1();\n\t* // returns \n\t*/\n\tfunction discreteUniform1() {\n\t\treturn discreteUniform0( rand, a, b );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a discrete uniform distribution with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @param {integer} a - minimum support\n\t* @param {integer} b - maximum support\n\t* @returns {integer} pseudorandom number\n\t*\n\t* @example\n\t* var v = discreteUniform2( 1, 10 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = discreteUniform2( 1, 0 );\n\t* // returns NaN\n\t*/\n\tfunction discreteUniform2( a, b ) {\n\t\tif (\n\t\t\tisnan( a ) ||\n\t\t\tisnan( b ) ||\n\t\t\t!isInteger( a ) ||\n\t\t\t!isInteger( b ) ||\n\t\t\ta > b\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn discreteUniform0( rand, a, b );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a discrete uniform distribution with minimum support `a` and maximum support `b`.\n*\n* ## Method\n*\n* - Let \\\\( R \\\\) be a pseudorandom generator (PRNG) which yields integers on the interval \\\\( \\[ A, B ] \\\\).\n*\n* - If \\\\( a = b \\\\), then \\\\( rv = a \\\\).\n*\n* - Let \\\\( r1 = b - a \\\\) and \\\\( r2 = B - A \\\\). If \\\\( r2 = r1 \\\\) (likely a rare occurrence), then\n*\n* ```tex\n* rv = ( R() - B ) + a\n* ```\n*\n* where, for real integer types, operation order is important in order to avoid overflow.\n*\n* - If \\\\( r2 < r1 \\\\), use rejection sampling to map random variates from \\\\( R \\\\) to a larger domain (e.g., \\\\( {0,1,2,3} \\rightarrow {0,1,2,3,4} \\\\)). For real integer types (and floating-point integer values), we must take extra care to avoid overflow. During sampling, the following conditions will hold:\n*\n* - First, consider the post-condition: \\\\( \\textrm{result} \\leq r2 \\\\), thus avoiding overflow.\n*\n* - Begin with definition of \\\\( \\textrm{limit} \\\\)\n*\n* ```tex\n* \\textrm{limit} = \\lfloor{\\frac{r2+1}{r1+1}\\rfloor\n* ```\n*\n* thus,\n*\n* ```tex\n* \\textrm{limit}\\ \\cdot (r1+1) \\leq r2+1\n* ```\n*\n* - Let \\\\( m \\\\) be a random factor where the loop condition is defined as\n*\n* ```tex\n* m \\leq \\textrm{limit}\n* ```\n*\n* - Let \\\\( \\textrm{result} \\\\) be the generator output, which is expressed base \\\\( r2+1 \\\\) and obeys the loop invariant \\\\( \\textrm{result} < m \\\\).\n*\n* - Let \\\\( rv \\\\) be a realization of the PRNG. Then,\n*\n* ```tex\n* rv-A \\leq r1\n* ```\n*\n* and, by the loop condition, \\\\( m \\leq \\textrm{limit} \\\\).\n*\n* - Therefore,\n*\n* ```tex\n* m \\cdot (rv - A + 1) \\leq r2+1\n* ```\n*\n* - Rearranging terms,\n*\n* ```tex\n* m + m \\cdot (rv - A) \\leq r2+1\n* ```\n*\n* - Since \\\\( \\textrm{result} < m \\\\),\n*\n* ```tex\n* \\textrm{result} + m \\cdot (rv - A) < r2+1\n* ```\n*\n* - Next, consider the post-condition: \\\\( \\textrm{result} < m \\cdot (r2+1) \\\\).\n*\n* - Since \\\\( \\textrm{result} < m \\\\) and \\\\( rv - A \\leq r1 \\\\),\n*\n* ```tex\n* \\textrm{result} + m \\cdot (rv - A) < m + m \\cdot (rv - A)\n* ```\n*\n* - Therefore,\n*\n* ```tex\n* \\textrm{result} + m \\cdot (rv - A) < m + m \\cdot r1\n* ```\n*\n* - Therefore,\n*\n* ```tex\n* \\textrm{result} + m \\cdot (rv - A) < m \\cdot (r1+1)\n* ```\n*\n* - Next, consider the post-condition: \\\\( m \\leq r2 \\\\).\n*\n* - According to the definition of \\\\( \\textrm{limit} \\\\) and the loop condition \\\\( m \\leq \\textrm{limit} \\\\),\n*\n* ```tex\n* m \\cdot (r1+1) \\leq r2+1\n* ```\n*\n* - If \\\\( r2 \\\\) is **not** an integer power of the generator range \\\\( r1 \\\\), i.e.,\n*\n* ```tex\n* m \\cdot (r1+1) \\neq r2+1\n* ```\n*\n* then\n*\n* ```tex\n* m \\cdot (r1+1) < r2+1\n* ```\n*\n* - Thus, \\\\( \\textrm{result} < m \\\\).\n*\n* - Next, consider the post-condition: \\\\( r2/m < r1+1 \\\\).\n*\n* - To show this is true, let us try to prove its opposite. Given the loop condition \\\\( m > \\textrm{limit} \\\\), assume\n*\n* ```tex\n* r2/m > r1+1\n* ```\n*\n* - Accordingly,\n*\n* ```tex\n* r2 \\geq m \\cdot (r1+1)\n* ```\n*\n* - Hence,\n*\n* ```tex\n* r2+1 > m \\cdot (r1+1)\n* ```\n*\n* - Using the loop condition,\n*\n* ```tex\n* r2+1 > (\\textrm{limit}+1) \\cdot (r1+1)\n* ```\n*\n* - Rearranging terms,\n*\n* ```tex\n* \\frac{r2+1}{r1+1} > \\textrm{limit} + 1\n* ```\n*\n* - Hence,\n*\n* ```tex\n* \\textrm{limit} < \\lfloor{\\frac{r2+1}{r1+1}} \\rfloor\n* ```\n*\n* - But the definition of \\\\( \\textrm{limit} \\\\) is\n*\n* ```tex\n* \\textrm{limit} = \\lfloor{\\frac{r2+1}{r1+1}}\n* ```\n*\n* - Thus, our assumption cannot be true, providing the post-condition by reductio ad absurdum.\n*\n* - Next, consider the post-condition\n*\n* ```tex\n* r2 \\leq \\frac{r2}{m} \\cdot m + (m - 1)\n* ```\n*\n* - Recall the identity\n*\n* ```tex\n* r2 = \\frac{r2}{m} \\cdot m + r2 \\mod m\n* ```\n*\n* - By the definition of the modulus\n*\n* ```tex\n* r2 \\mod m < m\n* ```\n*\n* - Therefore,\n*\n* ```tex\n* r2 < \\frac{r2}{m} \\cdot m + m\n* ```\n*\n* - Hence,\n*\n* ```tex\n* r2 \\leq \\frac{r2}{m} \\cdot m + (m - 1)\n* ```\n*\n* At this point, the maximum value \\\\( \\textrm{result} \\\\) is \\\\( m-1 \\\\). Hence, we can generate numbers that can be at least as large as \\\\( r2 \\\\), but we must be careful to avoid overflow during addition and in the sampling rejection. Anything which overflows is larger than \\\\( r2 \\\\) and can thus be rejected.\n*\n* - If \\\\( r1 > r2 \\\\), use rejection sampling to map random variates from \\\\( R \\\\) to a smaller domain (e.g., \\\\( {0,1,2,3,4} \\rightarrow {0,1,2,3} \\\\)) by defining \"buckets\" in which multiple random variates in \\\\( R \\\\) map to a single random variate in the smaller domain. We are safe in adding 1 to \\\\( r2 \\\\); however, we need to be careful to not cause overflow when adding 1 to \\\\( r1 \\\\).\n*\n* @name discreteUniform\n* @type {PRNG}\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @returns {integer} pseudorandom number\n*\n* @example\n* var v = discreteUniform( 1, 10 );\n* // returns \n*/\nvar discreteUniform = factory();\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Discrete uniform distribution pseudorandom numbers.\n*\n* @module @stdlib/random/base/discrete-uniform\n*\n* @example\n* var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );\n*\n* var v = discreteUniform( 1, 10 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/discrete-uniform' ).factory;\n* var discreteUniform = factory( -5, 5, {\n* 'seed': 297\n* });\n*\n* var v = discreteUniform();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/discrete-uniform' ).factory;\n* var discreteUniform = factory({\n* 'seed': 297\n* });\n*\n* var v = discreteUniform( -5, 5 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/discrete-uniform' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @name factory\n* @type {Function}\n* @param {integer} [a] - minimum support\n* @param {integer} [b] - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `a` must be an integer\n* @throws {TypeError} `b` must be an integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var discreteUniform = factory( -10, 10 );\n* // returns \n*\n* var arr = discreteUniform( 10 );\n* // returns \n*\n* @example\n* var discreteUniform = factory( -10, 10 );\n* // returns \n*\n* var arr = discreteUniform( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @name discreteUniform\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = discreteUniform( 10, -10, 10 );\n* // returns \n*\n* @example\n* var arr = discreteUniform( 10, -10, 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar discreteUniform = factory();\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @module @stdlib/random/array/discrete-uniform\n*\n* @example\n* var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );\n*\n* var arr = discreteUniform( 10, -10, 10 );\n* // returns \n*\n* @example\n* var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );\n*\n* var arr = discreteUniform( 10, -10, 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );\n*\n* var rand = discreteUniform.factory( -10, 10 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );\n*\n* var rand = discreteUniform.factory( -10, 10 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1, 2.5 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( k, lambda ) {\n\tif ( !isPositiveInteger( k ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositive( lambda ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from an Erlang distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = erlang();\n* // returns \n*/\nfunction erlang( rand, k, lambda ) {\n\tvar prod;\n\tvar i;\n\tprod = 1.0;\n\tfor ( i = 0; i < k; i++ ) {\n\t\tprod *= rand();\n\t}\n\treturn -(1.0/lambda) * ln( prod );\n}\n\n\n// EXPORTS //\n\nmodule.exports = erlang;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isPositiveInteger = require( '@stdlib/math/base/assert/is-positive-integer' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar erlang0 = require( './erlang.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Erlang distributed random numbers.\n*\n* @param {PositiveInteger} [k] - shape parameter\n* @param {PositiveNumber} [lambda] - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `k` must be a positive integer\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var erlang = factory( 2, 1.0 );\n* var v = erlang();\n* // returns \n*\n* @example\n* var erlang = factory( 2, 2.0, {\n* 'seed': 297\n* });\n* var v = erlang();\n* // returns \n*/\nfunction factory() {\n\tvar lambda;\n\tvar rand;\n\tvar opts;\n\tvar prng;\n\tvar err;\n\tvar k;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tk = arguments[ 0 ];\n\t\tlambda = arguments[ 1 ];\n\t\terr = validate( k, lambda );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( k === void 0 ) {\n\t\tprng = erlang2;\n\t} else {\n\t\tprng = erlang1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'erlang' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( k === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ k, lambda ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an Erlang distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = erlang1();\n\t* // returns \n\t*/\n\tfunction erlang1() {\n\t\treturn erlang0( rand, k, lambda );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an Erlang distribution.\n\t*\n\t* @private\n\t* @param {PositiveInteger} k - shape parameter\n\t* @param {PositiveNumber} lambda - rate parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = erlang2( 2, 1.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = erlang2( NaN, 1.0 );\n\t* // returns NaN\n\t*\n\t* v = erlang2( 2, NaN );\n\t* // returns NaN\n\t*\n\t* v = erlang2( 3.14, 1.0 );\n\t* // returns NaN\n\t*\n\t* v = erlang2( 2, 0.0 );\n\t* // returns NaN\n\t*/\n\tfunction erlang2( k, lambda ) {\n\t\tif (\n\t\t\tisnan( k ) ||\n\t\t\tisnan( lambda ) ||\n\t\t\t!isPositiveInteger( k ) ||\n\t\t\tlambda <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn erlang0( rand, k, lambda );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from an Erlang distribution.\n*\n* @name erlang\n* @type {PRNG}\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = erlang( 2, 1.0 );\n* // returns \n*\n* @example\n* var v = erlang( NaN, 1.0 );\n* // returns NaN\n*\n* v = erlang( 2, NaN );\n* // returns NaN\n*\n* v = erlang( 3.14, 1.0 );\n* // returns NaN\n*\n* v = erlang( 3, 0.0 );\n* // returns NaN\n*/\nvar erlang = factory();\n\n\n// EXPORTS //\n\nmodule.exports = erlang;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Erlang distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/erlang\n*\n* @example\n* var erlang = require( '@stdlib/random/base/erlang' );\n*\n* var v = erlang( 3, 2.5 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/erlang' ).factory;\n*\n* var erlang = factory( 8, 5.9, {\n* 'seed': 297\n* });\n*\n* var v = erlang();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/erlang' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from an Erlang distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveInteger} [k] - shape parameter\n* @param {PositiveNumber} [lambda] - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `k` must be a positive integer\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var erlang = factory( 2, 5.0 );\n* // returns \n*\n* var arr = erlang( 10 );\n* // returns \n*\n* @example\n* var erlang = factory( 2, 5.0 );\n* // returns \n*\n* var arr = erlang( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from an Erlang distribution.\n*\n* @name erlang\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = erlang( 10, 2, 5.0 );\n* // returns \n*\n* @example\n* var arr = erlang( 10, 2, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar erlang = factory();\n\n\n// EXPORTS //\n\nmodule.exports = erlang;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from an Erlang distribution.\n*\n* @module @stdlib/random/array/erlang\n*\n* @example\n* var erlang = require( '@stdlib/random/array/erlang' );\n*\n* var arr = erlang( 10, 2, 5.0 );\n* // returns \n*\n* @example\n* var erlang = require( '@stdlib/random/array/erlang' );\n*\n* var arr = erlang( 10, 2, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var erlang = require( '@stdlib/random/array/erlang' );\n*\n* var rand = erlang.factory( 2, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var erlang = require( '@stdlib/random/array/erlang' );\n*\n* var rand = erlang.factory( 2, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from an exponential distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveNumber} lambda - rate parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*/\nfunction exponential( rand, lambda ) {\n\treturn -ln( 1.0 - rand() ) / lambda;\n}\n\n\n// EXPORTS //\n\nmodule.exports = exponential;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar exponential0 = require( './exponential.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating exponentially distributed random numbers.\n*\n* @param {PositiveNumber} [lambda] - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var exponential = factory( 0.5 );\n* var v = exponential();\n* // returns \n*\n* @example\n* var exponential = factory( 0.8, {\n* 'seed': 297\n* });\n* var v = exponential();\n* // returns ~3.735\n*\n* @example\n* var exponential = factory();\n* var v = exponential( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar lambda;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tlambda = arguments[ 0 ];\n\t\tif ( !isPositive( lambda ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( lambda === void 0 ) {\n\t\tprng = exponential2;\n\t} else {\n\t\tprng = exponential1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'exponential' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( lambda === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ lambda ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an exponential distribution with bound parameter `lambda`.\n\t*\n\t* @private\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = exponential1();\n\t* // returns \n\t*/\n\tfunction exponential1() {\n\t\treturn exponential0( rand, lambda );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an exponential distribution with parameter `lambda`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} lambda - rate parameter\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = exponential2( 4.8 );\n\t* // returns \n\t*/\n\tfunction exponential2( lambda ) {\n\t\tif (\n\t\t\tisnan( lambda ) ||\n\t\t\tlambda <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn exponential0( rand, lambda );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from an exponential distribution with parameter `lambda`.\n*\n* @name exponential\n* @type {PRNG}\n* @param {PositiveNumber} lambda - rate parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*\n* @example\n* var v = exponential( 4.8 );\n* // returns \n*\n* @example\n* var v = exponential( 0.0 );\n* // returns NaN\n*\n* @example\n* var v = exponential( NaN );\n* // returns NaN\n*/\nvar exponential = factory();\n\n\n// EXPORTS //\n\nmodule.exports = exponential;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Exponentially distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/exponential\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var v = exponential( 4.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/exponential' ).factory;\n*\n* var exponential = factory( 4.0, {\n* 'seed': 297\n* });\n*\n* var v = exponential();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar unaryFactory = require( './../../../array/tools/unary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/exponential' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from an exponential distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [lambda] - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var exponential = factory( 2.0 );\n* // returns \n*\n* var arr = exponential( 10 );\n* // returns \n*\n* @example\n* var exponential = factory( 2.0 );\n* // returns \n*\n* var arr = exponential( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = unaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from an exponential distribution.\n*\n* @name exponential\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = exponential( 10, 2.0 );\n* // returns \n*\n* @example\n* var arr = exponential( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar exponential = factory();\n\n\n// EXPORTS //\n\nmodule.exports = exponential;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from an exponential distribution.\n*\n* @module @stdlib/random/array/exponential\n*\n* @example\n* var exponential = require( '@stdlib/random/array/exponential' );\n*\n* var arr = exponential( 10, 2.0 );\n* // returns \n*\n* @example\n* var exponential = require( '@stdlib/random/array/exponential' );\n*\n* var arr = exponential( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var exponential = require( '@stdlib/random/array/exponential' );\n*\n* var rand = exponential.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var exponential = require( '@stdlib/random/array/exponential' );\n*\n* var rand = exponential.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( d1, d2 ) {\n\tif ( !isPositive( d1 ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', d1 ) );\n\t}\n\tif ( !isPositive( d2 ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', d2 ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns a pseudorandom number from an F distribution with parameters `d1` and `d2`.\n*\n* @private\n* @param {PRNG} rchisq - PRNG for chi-square distributed numbers\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @returns {NonNegativeNumber} pseudorandom number\n*/\nfunction f( rchisq, d1, d2 ) {\n\tvar x1 = rchisq( d1 ) / d1;\n\tvar x2 = rchisq( d2 ) / d2;\n\treturn x1 / x2;\n}\n\n\n// EXPORTS //\n\nmodule.exports = f;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar chisquare = require( './../../../base/chisquare' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar f0 = require( './f.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating F distributed random numbers.\n*\n* @param {PositiveNumber} [d1] - degrees of freedom\n* @param {PositiveNumber} [d2] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `d1` must be a positive number\n* @throws {TypeError} `d2` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var f = factory( 1.0, 2.0 );\n* var v = f();\n* // returns \n*\n* @example\n* var f = factory( 0.5, 3.0, {\n* 'seed': 297\n* });\n* var v = f();\n* // returns \n*/\nfunction factory() {\n\tvar rchisq;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar d1;\n\tvar d2;\n\n\tif ( arguments.length === 0 ) {\n\t\trchisq = chisquare();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trchisq = chisquare({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trchisq = chisquare( opts );\n\t\t}\n\t} else {\n\t\td1 = arguments[ 0 ];\n\t\td2 = arguments[ 1 ];\n\t\terr = validate( d1, d2 );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trchisq = chisquare({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trchisq = chisquare( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trchisq = chisquare();\n\t\t}\n\t}\n\tif ( d1 === void 0 ) {\n\t\tprng = f2;\n\t} else {\n\t\tprng = f1;\n\t}\n\trand = rchisq.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'f' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( d1 === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ d1, d2 ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number from an F distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = f1();\n\t* // returns \n\t*/\n\tfunction f1() {\n\t\treturn f0( rchisq, d1, d2 );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number from an F distribution with parameters `d1` and `d2`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} d1 - degrees of freedom\n\t* @param {PositiveNumber} d2 - degrees of freedom\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = f2( 3.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = f2( 3.0, 0.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = f2( 0.0, 2.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = f2( NaN, NaN );\n\t* // returns NaN\n\t*/\n\tfunction f2( d1, d2 ) {\n\t\tif (\n\t\t\tisnan( d1 ) ||\n\t\t\tisnan( d2 ) ||\n\t\t\td1 <= 0.0 ||\n\t\t\td2 <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn f0( rchisq, d1, d2 );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number from an F distribution with parameters `d1` and `d2`.\n*\n* @name f\n* @type {PRNG}\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @returns {NonNegativeNumber} pseudorandom number\n*\n* @example\n* var v = f( 3.0, 2.0 );\n* // returns \n*\n* @example\n* var r = f( -2.0, 5.0 );\n* // returns NaN\n*/\nvar f = factory();\n\n\n// EXPORTS //\n\nmodule.exports = f;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* F distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/f\n*\n* @example\n* var f = require( '@stdlib/random/base/f' );\n*\n* var v = f( 5.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/f' ).factory;\n*\n* var f = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = f();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/f' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from an F distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [d1] - degrees of freedom\n* @param {PositiveNumber} [d2] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `d1` must be a positive number\n* @throws {TypeError} `d2` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var f = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = f( 10 );\n* // returns \n*\n* @example\n* var f = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = f( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from an F distribution.\n*\n* @name f\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = f( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = f( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar f = factory();\n\n\n// EXPORTS //\n\nmodule.exports = f;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from an F distribution.\n*\n* @module @stdlib/random/array/f\n*\n* @example\n* var f = require( '@stdlib/random/array/f' );\n*\n* var arr = f( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var f = require( '@stdlib/random/array/f' );\n*\n* var arr = f( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var f = require( '@stdlib/random/array/f' );\n*\n* var rand = f.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var f = require( '@stdlib/random/array/f' );\n*\n* var rand = f.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar contains = require( '@stdlib/array/base/assert/contains' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Array} dtypes - list of supported output data types\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, dtypes, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, dtypes, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( !contains( dtypes, opts.dtype ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', dtypes.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar contains = require( '@stdlib/array/base/assert/contains' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar ternary = require( '@stdlib/strided/base/ternary' );\nvar ctors = require( '@stdlib/array/ctors' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Constructor for creating arrays filled with pseudorandom values drawn from a ternary PRNG.\n*\n* @constructor\n* @param {Function} prng - ternary pseudorandom value generator\n* @param {StringArray} dtypes - list of supported output data types\n* @param {string} dtype - default output data type\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be an array of strings\n* @throws {TypeError} third argument must be a supported data type\n* @returns {Random} instance\n*\n* @example\n* var triangular = require( '@stdlib/random/base/triangular' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( triangular, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0, 5.0, 3.33 );\n* // returns \n*/\nfunction Random( prng, dtypes, dtype ) {\n\tif ( !( this instanceof Random ) ) {\n\t\treturn new Random( prng, dtypes, dtype );\n\t}\n\tif ( !isFunction( prng ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) );\n\t}\n\t// TODO: tighten this up by actually validating that `dtypes` contains only recognized/supported dtype strings\n\tif ( !isStringArray( dtypes ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array of strings. Value: `%s`.', dtypes ) );\n\t}\n\t// Require that the default output array data type be a member of the list of supported output array data types...\n\tif ( !contains( dtypes, dtype ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a supported data type. Value: `%s`.', dtype ) );\n\t}\n\tthis._prng = prng;\n\tthis._dtypes = dtypes;\n\tthis._dtype = dtype;\n\treturn this;\n}\n\n/**\n* Returns an array filled with pseudorandom values drawn from a ternary PRNG.\n*\n* @name generate\n* @memberof Random.prototype\n* @type {Function}\n* @param {NonNegativeInteger} len - number of elements\n* @param {*} param1 - first PRNG parameter\n* @param {*} param2 - second PRNG parameter\n* @param {*} param3 - third PRNG parameter\n* @param {Options} [options] - function options\n* @param {string} [options.dtype] - array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Collection} output array\n*\n* @example\n* var triangular = require( '@stdlib/random/base/triangular' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( triangular, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0, 5.0, 3.33 );\n* // returns \n*/\nsetReadOnly( Random.prototype, 'generate', function generate( len, param1, param2, param3, options ) {\n\tvar ctor;\n\tvar opts;\n\tvar prng;\n\tvar out;\n\tvar err;\n\tvar dt;\n\tif ( !isNonNegativeInteger( len ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t}\n\topts = {};\n\tif ( arguments.length > 4 ) {\n\t\terr = validate( opts, this._dtypes, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// NOTE: we could alternatively use the PRNG factory function to create a nullary PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. The decision made here avoids this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom value. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in, e.g., a return value of `NaN` (however, realization of this benefit depends on the output array being a floating-point array).\n\tprng = this._prng;\n\tdt = opts.dtype || this._dtype;\n\tif ( dt === 'generic' ) {\n\t\treturn filledBy( len, wrapper );\n\t}\n\tctor = ctors( dt );\n\tout = new ctor( len );\n\tternary( [ [ param1 ], [ param2 ], [ param3 ], out ], [ len ], [ 0, 0, 0, 1 ], prng ); // eslint-disable-line max-len\n\treturn out;\n\n\t/**\n\t* Applies parameters to a pseudorandom value generator function.\n\t*\n\t* @private\n\t* @returns {*} pseudorandom value\n\t*/\n\tfunction wrapper() {\n\t\treturn prng( param1, param2, param3 );\n\t}\n});\n\n/**\n* Fills an array with pseudorandom values drawn from a ternary PRNG.\n*\n* @name assign\n* @memberof Random.prototype\n* @type {Function}\n* @param {*} param1 - first PRNG parameter\n* @param {*} param2 - second PRNG parameter\n* @param {*} param3 - third PRNG parameter\n* @param {Collection} out - output array\n* @throws {TypeError} fourth argument must be a collection\n* @returns {Collection} output array\n*\n* @example\n* var triangular = require( '@stdlib/random/base/triangular' );\n* var zeros = require( '@stdlib/array/zeros' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( triangular, dtypes, defaultDType );\n*\n* var out = zeros( 10, 'float64' );\n* // returns \n*\n* var v = rand.assign( 2.0, 5.0, 3.33, out );\n* // returns \n*\n* var bool = ( v === out );\n* // returns true\n*/\nsetReadOnly( Random.prototype, 'assign', function assign( param1, param2, param3, out ) {\n\tif ( !isCollection( out ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an array-like object. Value: `%s`.', out ) );\n\t}\n\t// NOTE: we could alternatively use the PRNG factory function to create a nullary PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when filling small arrays. The decision made here avoids this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom value. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in, e.g., a return value of `NaN` (however, realization of this benefit depends on the output array being a floating-point array).\n\tternary( [ [ param1 ], [ param2 ], [ param3 ], out ], [ out.length ], [ 0, 0, 0, 1 ], this._prng ); // eslint-disable-line max-len\n\treturn out;\n});\n\n\n// EXPORTS //\n\nmodule.exports = Random;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Constructor for creating arrays filled with pseudorandom values drawn from a ternary PRNG.\n*\n* @module @stdlib/random/array/tools/ternary\n*\n* @example\n* var triangular = require( '@stdlib/random/base/triangular' );\n* var Random = require( '@stdlib/random/array/tools/ternary' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( triangular, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0, 5.0, 3.33 );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isMethodIn = require( '@stdlib/assert/is-method-in' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar contains = require( '@stdlib/array/base/assert/contains' ).factory;\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar TernaryRandom = require( './../../../../array/tools/ternary' );\nvar NullaryRandom = require( './../../../../array/tools/nullary' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a factory function for generating pseudorandom values drawn from a ternary PRNG.\n*\n* @param {Function} prng - ternary pseudorandom value generator\n* @param {Function} prng.factory - method which returns a new ternary pseudorandom value generator\n* @param {StringArray} dtypes - list of supported output array data types\n* @param {string} dtype - default output array data type\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} first argument must have a `factory` method\n* @throws {TypeError} second argument must be an array of strings\n* @throws {TypeError} third argument must be a supported output array data type\n* @returns {Function} function which returns a function for creating arrays\n*\n* @example\n* var triangular = require( '@stdlib/random/base/triangular' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = createFactory( triangular, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 2.0, 5.0, 3.33 );\n* // returns \n*\n* @example\n* var triangular = require( '@stdlib/random/base/triangular' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = createFactory( triangular, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 2.0, 5.0, 3.33, {\n* 'dtype': 'float32'\n* });\n* // returns \n*/\nfunction createFactory( prng, dtypes, dtype ) {\n\tvar isValidDataType;\n\tif ( !isFunction( prng ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) );\n\t}\n\tif ( !isMethodIn( prng, 'factory' ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must have a `%s` method.', 'factory' ) );\n\t}\n\t// TODO: tighten this up by actually validating that `dtypes` contains only recognized/supported dtype strings\n\tif ( !isStringArray( dtypes ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must an array of strings. Value: `%s`.', dtypes ) );\n\t}\n\t// Require that the default output array data type be a member of the list of supported output array data types...\n\tif ( !contains( dtypes, dtype ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a supported data type. Value: `%s`.', dtype ) );\n\t}\n\tisValidDataType = contains( dtypes );\n\treturn factory;\n\n\t/**\n\t* Returns a function for generating pseudorandom values drawn from a PRNG.\n\t*\n\t* @private\n\t* @param {*} [param1] - first PRNG parameter\n\t* @param {*} [param2] - second PRNG parameter\n\t* @param {*} [param3] - third PRNG parameter\n\t* @param {Options} [options] - function options\n\t* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n\t* @param {*} [options.seed] - pseudorandom value generator seed\n\t* @param {*} [options.state] - pseudorandom value generator state\n\t* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom value generator state\n\t* @param {string} [options.dtype] - default output array data type\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {Function} function for creating arrays\n\t*/\n\tfunction factory() {\n\t\tvar Random;\n\t\tvar random;\n\t\tvar param1;\n\t\tvar param2;\n\t\tvar param3;\n\t\tvar assign;\n\t\tvar nargs;\n\t\tvar base;\n\t\tvar opts;\n\t\tvar rand;\n\t\tvar dt;\n\n\t\tnargs = arguments.length;\n\t\tif ( nargs < 1 ) { // e.g., factory()\n\t\t\topts = {};\n\t\t\tbase = prng;\n\t\t\trand = rand1;\n\t\t} else if ( nargs === 1 ) { // e.g., factory( {} )\n\t\t\topts = arguments[ 0 ];\n\t\t\tbase = prng.factory( opts );\n\t\t\trand = rand1;\n\t\t} else if ( nargs === 3 ) { // e.g., factory( param1, param2, param3 )\n\t\t\tparam1 = arguments[ 0 ];\n\t\t\tparam2 = arguments[ 1 ];\n\t\t\tparam3 = arguments[ 2 ];\n\t\t\topts = {};\n\t\t\tbase = prng.factory( param1, param2, param3 );\n\t\t\trand = rand2;\n\t\t} else { // e.g., factory( param1, param2, param3, {} )\n\t\t\tparam1 = arguments[ 0 ];\n\t\t\tparam2 = arguments[ 1 ];\n\t\t\tparam3 = arguments[ 2 ];\n\t\t\topts = arguments[ 3 ];\n\t\t\tbase = prng.factory( param1, param2, param3, opts );\n\t\t\trand = rand2;\n\t\t}\n\t\tif ( hasOwnProp( opts, 'dtype' ) ) {\n\t\t\tdt = opts.dtype;\n\t\t\tif ( !isValidDataType( dt ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', dtypes.join( '\", \"' ), dt ) );\n\t\t\t}\n\t\t} else {\n\t\t\tdt = dtype;\n\t\t}\n\t\tif ( rand === rand1 ) {\n\t\t\tassign = assign1;\n\t\t\tRandom = TernaryRandom;\n\t\t} else {\n\t\t\tassign = assign2;\n\t\t\tRandom = NullaryRandom;\n\t\t}\n\t\trandom = new Random( base, dtypes, dt );\n\t\tif ( opts && opts.prng ) {\n\t\t\tsetReadOnly( rand, 'seed', null );\n\t\t\tsetReadOnly( rand, 'seedLength', null );\n\t\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\t\tsetReadOnly( rand, 'stateLength', null );\n\t\t\tsetReadOnly( rand, 'byteLength', null );\n\t\t} else {\n\t\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t\t}\n\t\tsetReadOnly( rand, 'PRNG', base.PRNG );\n\t\tsetReadOnly( rand, 'assign', assign );\n\t\treturn rand;\n\n\t\t/**\n\t\t* Returns an array of pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} len - output array length\n\t\t* @param {*} param1 - first PRNG parameter\n\t\t* @param {*} param2 - second PRNG parameter\n\t\t* @param {*} param3 - third PRNG parameter\n\t\t* @param {Options} [options] - function options\n\t\t* @param {string} [options.dtype] - output array data type\n\t\t* @throws {TypeError} first argument must be a nonnegative integer\n\t\t* @throws {TypeError} options argument must be an object\n\t\t* @throws {TypeError} must provide valid options\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction rand1( len, param1, param2, param3, options ) {\n\t\t\tif ( arguments.length < 5 ) {\n\t\t\t\treturn random.generate( len, param1, param2, param3 );\n\t\t\t}\n\t\t\treturn random.generate( len, param1, param2, param3, options );\n\t\t}\n\n\t\t/**\n\t\t* Returns an array of pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} len - output array length\n\t\t* @param {Options} [options] - function options\n\t\t* @param {string} [options.dtype] - output array data type\n\t\t* @throws {TypeError} first argument must be a nonnegative integer\n\t\t* @throws {TypeError} options argument must be an object\n\t\t* @throws {TypeError} must provide valid options\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction rand2( len, options ) {\n\t\t\tif ( arguments.length < 2 ) {\n\t\t\t\treturn random.generate( len );\n\t\t\t}\n\t\t\treturn random.generate( len, options );\n\t\t}\n\n\t\t/**\n\t\t* Fills an array with pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {*} param1 - first PRNG parameter\n\t\t* @param {*} param2 - second PRNG parameter\n\t\t* @param {*} param3 - third PRNG parameter\n\t\t* @param {Collection} out - output array\n\t\t* @throws {TypeError} third argument must be a collection\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction assign1( param1, param2, param3, out ) {\n\t\t\treturn random.assign( param1, param2, param3, out );\n\t\t}\n\n\t\t/**\n\t\t* Fills an array with pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {Collection} out - output array\n\t\t* @throws {TypeError} first argument must be a collection\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction assign2( out ) {\n\t\t\treturn random.assign( out );\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG seed.\n\t\t*\n\t\t* @private\n\t\t* @returns {*} seed\n\t\t*/\n\t\tfunction getSeed() {\n\t\t\treturn rand.PRNG.seed;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG seed length.\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} seed length\n\t\t*/\n\t\tfunction getSeedLength() {\n\t\t\treturn rand.PRNG.seedLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG state length.\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} state length\n\t\t*/\n\t\tfunction getStateLength() {\n\t\t\treturn rand.PRNG.stateLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG state size (in bytes).\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} state size (in bytes)\n\t\t*/\n\t\tfunction getStateSize() {\n\t\t\treturn rand.PRNG.byteLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the current pseudorandom number generator state.\n\t\t*\n\t\t* @private\n\t\t* @returns {*} current state\n\t\t*/\n\t\tfunction getState() {\n\t\t\treturn rand.PRNG.state;\n\t\t}\n\n\t\t/**\n\t\t* Sets the pseudorandom number generator state.\n\t\t*\n\t\t* @private\n\t\t* @param {*} s - generator state\n\t\t* @throws {Error} must provide a valid state\n\t\t*/\n\t\tfunction setState( s ) {\n\t\t\trand.PRNG.state = s;\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = createFactory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a factory function for generating pseudorandom values drawn from a ternary PRNG.\n*\n* @module @stdlib/random/array/tools/ternary-factory\n*\n* @example\n* var triangular = require( '@stdlib/random/base/triangular' );\n* var ternaryFactory = require( '@stdlib/random/array/tools/ternary-factory' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = ternaryFactory( triangular, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 2.0, 5.0, 3.33 );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/assert/is-nan' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {number} m - location parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0, 1.3 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, s, m ) {\n\tif ( !isPositiveNumber( alpha ) || isnan( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number and not NaN. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( s ) || isnan( s ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number and not NaN. Value: `%s`.', s ) );\n\t}\n\tif ( !isNumber( m ) || isnan( m ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Third argument must be a number and not NaN. Value: `%s`.', m ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar pow = require( '@stdlib/math/base/special/pow' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Fr\u00E9chet distribution with shape `alpha`, scale `s`, and location `m`.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {number} m - location parameter\n* @returns {number} pseudorandom number\n*/\nfunction frechet( rand, alpha, s, m ) {\n\treturn m + ( s * ( pow( -ln( rand() ), -1.0/alpha ) ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = frechet;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar frechet0 = require( './frechet.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers drawn from a Fr\u00E9chet distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {number} [m] - location parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} `m` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var frechet = factory( 1.0, 1.0, 0.8 );\n* var v = frechet();\n* // returns \n*\n* @example\n* var frechet = factory( 1.0, 1.0, -2.0, {\n* 'seed': 297\n* });\n* var v = frechet();\n* // returns \n*/\nfunction factory() {\n\tvar alpha;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar s;\n\tvar m;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\ts = arguments[ 1 ];\n\t\tm = arguments[ 2 ];\n\t\terr = validate( alpha, s, m );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 3 ) {\n\t\t\topts = arguments[ 3 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = frechet2;\n\t} else {\n\t\tprng = frechet1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'frechet' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, s, m ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Fr\u00E9chet distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = frechet1();\n\t* // returns \n\t*/\n\tfunction frechet1() {\n\t\treturn frechet0( rand, alpha, s, m );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Fr\u00E9chet distribution with shape `alpha`, scale `s`, and location `m`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} s - scale parameter\n\t* @param {number} m - location parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = frechet2( 2.0, 1.0, 0.5 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = frechet2( 1.0, 1.0, 0.5 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = frechet2( 1.0, 2.0, NaN );\n\t* // returns NaN\n\t*/\n\tfunction frechet2( alpha, s, m ) {\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( s ) ||\n\t\t\tisnan( m ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\ts <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn frechet0( rand, alpha, s, m );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Fr\u00E9chet distribution with shape `alpha`, scale `s`, and location `m`.\n*\n* @name frechet\n* @type {PRNG}\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {number} m - location parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = frechet( 1.0, 1.0, 0.5 );\n* // returns \n*/\nvar frechet = factory();\n\n\n// EXPORTS //\n\nmodule.exports = frechet;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fr\u00E9chet distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/frechet\n*\n* @example\n* var frechet = require( '@stdlib/random/base/frechet' );\n*\n* var v = frechet( 10.0, 10.0, 7.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/frechet' ).factory;\n*\n* var frechet = factory( 5.0, 5.0, 3.0, {\n* 'seed': 643361677\n* });\n*\n* var v = frechet();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/frechet' ).factory;\n*\n* var frechet = factory({\n* 'seed': 643361677\n* });\n*\n* var v = frechet( 5.0, 5.0, 3.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ternaryFactory = require( './../../../array/tools/ternary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/frechet' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {number} [m] - location parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} `m` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var frechet = factory( 2.0, 5.0, 3.0 );\n* // returns \n*\n* var arr = frechet( 10 );\n* // returns \n*\n* @example\n* var frechet = factory( 2.0, 5.0, 3.0 );\n* // returns \n*\n* var arr = frechet( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = ternaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @name frechet\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {number} m - location parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = frechet( 10, 2.0, 5.0, 3.0 );\n* // returns \n*\n* @example\n* var arr = frechet( 10, 2.0, 5.0, 3.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar frechet = factory();\n\n\n// EXPORTS //\n\nmodule.exports = frechet;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @module @stdlib/random/array/frechet\n*\n* @example\n* var frechet = require( '@stdlib/random/array/frechet' );\n*\n* var arr = frechet( 10, 2.0, 5.0, 3.0 );\n* // returns \n*\n* @example\n* var frechet = require( '@stdlib/random/array/frechet' );\n*\n* var arr = frechet( 10, 2.0, 5.0, 3.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var frechet = require( '@stdlib/random/array/frechet' );\n*\n* var rand = frechet.factory( 2.0, 5.0, 3.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var frechet = require( '@stdlib/random/array/frechet' );\n*\n* var rand = frechet.factory( 2.0, 5.0, 3.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/gamma' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a gamma distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var gamma = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = gamma( 10 );\n* // returns \n*\n* @example\n* var gamma = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = gamma( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a gamma distribution.\n*\n* @name gamma\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = gamma( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = gamma( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar gamma = factory();\n\n\n// EXPORTS //\n\nmodule.exports = gamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a gamma distribution.\n*\n* @module @stdlib/random/array/gamma\n*\n* @example\n* var gamma = require( '@stdlib/random/array/gamma' );\n*\n* var arr = gamma( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var gamma = require( '@stdlib/random/array/gamma' );\n*\n* var arr = gamma( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var gamma = require( '@stdlib/random/array/gamma' );\n*\n* var rand = gamma.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var gamma = require( '@stdlib/random/array/gamma' );\n*\n* var rand = gamma.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a geometric distribution.\n*\n* ## Proof\n*\n* Consider\n*\n* ```tex\n* N = \\left \\lfloor \\ln (U) / \\ln (1-p) \\right \\rfloor\n* ```\n*\n* where \\\\( U \\\\) is uniform on the interval \\\\((0,1)\\\\). Accordingly, \\\\(N\\\\) must be a nonnegative integer, and, for every \\\\( n \\geq 0\\\\), the event \\\\(A_n = \\left \\{ N = n \\right \\}\\\\) is\n*\n* ```tex\n* A_n = \\left \\{(n+1) \\ln (1-p) < \\ln (U) \\leq n \\ln (1-p) \\right \\}\n* ```\n*\n* where \\\\(\\ln (1-p) < 0\\\\). Thus,\n*\n* ```tex\n* A_n = \\left \\{(1-p)^{n+1} < U \\leq (1-p)^n \\right \\}\n* ```\n*\n* For every \\\\(u < v\\\\) on the interval \\\\((0,1)\\\\),\n*\n* ```tex\n* P\\left \\[u < U \\leq v\\right \\] = v - u\n* ```\n*\n* Hence,\n*\n* ```tex\n* P\\left \\[N = n \\right \\] = P\\left \\[A_n\\right \\] = (1-p)^n - (1-p)^{n+1} = (1-p)^n(1-(1-p)) = p(1-p)^n\n* ```\n*\n* which proves that \\\\(N\\\\) is a geometric random variable.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {Probability} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction geometric( rand, p ) {\n\tvar u = rand();\n\tif ( u === 0.0 ) {\n\t\t// Drawing random variates from a PRNG (with period > 1) is effectively sampling without replacement. Thus, should not be possible to draw `0` twice in a row.\n\t\tu = rand();\n\t}\n\treturn floor( ln( u ) / ln( 1.0-p ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = geometric;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar geometric0 = require( './geometric.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating geometric distributed random numbers.\n*\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var geometric = factory( 0.5 );\n* var v = geometric();\n* // returns \n*\n* @example\n* var geometric = factory( 0.8, {\n* 'seed': 297\n* });\n* var v = geometric();\n* // returns \n*\n* @example\n* var geometric = factory();\n* var v = geometric( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar p;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tp = arguments[ 0 ];\n\t\tif ( !isProbability( p ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( p === void 0 ) {\n\t\tprng = geometric2;\n\t} else {\n\t\tprng = geometric1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'geometric' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( p === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ p ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a geometric distribution with bound parameter `p`.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = geometric1();\n\t* // returns \n\t*/\n\tfunction geometric1() {\n\t\treturn geometric0( rand, p );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a geometric distribution with parameter `p`.\n\t*\n\t* @private\n\t* @param {Probability} p - success probability\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = geometric2( 0.5 );\n\t* // returns \n\t*/\n\tfunction geometric2( p ) {\n\t\tif (\n\t\t\tisnan( p ) ||\n\t\t\tp < 0.0 ||\n\t\t\tp > 1.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn geometric0( rand, p );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom random number drawn from a geometric distribution with parameter `p`.\n*\n* @name geometric\n* @type {PRNG}\n* @param {Probability} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var v = geometric( 0.5 );\n* // returns \n*\n* @example\n* var v = geometric( 3.14 );\n* // returns NaN\n*\n* @example\n* var v = geometric( -1.0 );\n* // returns NaN\n*\n* @example\n* var v = geometric( NaN );\n* // returns NaN\n*/\nvar geometric = factory();\n\n\n// EXPORTS //\n\nmodule.exports = geometric;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Geometric distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/geometric\n*\n* @example\n* var geometric = require( '@stdlib/random/base/geometric' );\n*\n* var v = geometric( 0.5 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/geometric' ).factory;\n*\n* var geometric = factory( 0.3, {\n* 'seed': 297\n* });\n*\n* var v = geometric();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/geometric' ).factory;\n*\n* var geometric = factory({\n* 'seed': 297\n* });\n*\n* var v = geometric( 0.5 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar unaryFactory = require( './../../../array/tools/unary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/geometric' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a geometric distribution.\n*\n* @name factory\n* @type {Function}\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `p` must be a probability (i.e., a number on the interval [0,1])\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var geometric = factory( 0.01 );\n* // returns \n*\n* var arr = geometric( 10 );\n* // returns \n*\n* @example\n* var geometric = factory( 0.01 );\n* // returns \n*\n* var arr = geometric( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = unaryFactory( base, DTYPES, defaults.get( 'dtypes.real' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a geometric distribution.\n*\n* @name geometric\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {Probability} p - success probability\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = geometric( 10, 0.01 );\n* // returns \n*\n* @example\n* var arr = geometric( 10, 0.01, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar geometric = factory();\n\n\n// EXPORTS //\n\nmodule.exports = geometric;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a geometric distribution.\n*\n* @module @stdlib/random/array/geometric\n*\n* @example\n* var geometric = require( '@stdlib/random/array/geometric' );\n*\n* var arr = geometric( 10, 0.01 );\n* // returns \n*\n* @example\n* var geometric = require( '@stdlib/random/array/geometric' );\n*\n* var arr = geometric( 10, 0.01, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var geometric = require( '@stdlib/random/array/geometric' );\n*\n* var rand = geometric.factory( 0.01 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var geometric = require( '@stdlib/random/array/geometric' );\n*\n* var rand = geometric.factory( 0.01 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - shape parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, beta ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a Gumbel distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction gumbel( rand, mu, beta ) {\n\treturn mu - ( beta*ln( -ln( rand() ) ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gumbel;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar gumbel0 = require( './gumbel.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a Gumbel distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var gumbel = factory( 0.0, 1.0 );\n* var v = gumbel();\n* // returns \n*\n* @example\n* var gumbel = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = gumbel();\n* // returns \n*/\nfunction factory() {\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( mu, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = gumbel2;\n\t} else {\n\t\tprng = gumbel1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'gumbel' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a Gumbel distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = gumbel1();\n\t* // returns \n\t*/\n\tfunction gumbel1() {\n\t\treturn gumbel0( rand, mu, beta );\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a Gumbel distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = gumbel2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = gumbel2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction gumbel2( mu, beta ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( beta ) ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn gumbel0( rand, mu, beta );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a Gumbel distribution.\n*\n* @name gumbel\n* @type {PRNG}\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = gumbel( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = gumbel( 0.0, -1.0 );\n* // returns NaN\n*/\nvar gumbel = factory();\n\n\n// EXPORTS //\n\nmodule.exports = gumbel;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Gumbel distribution pseudorandom numbers.\n*\n* @module @stdlib/random/base/gumbel\n*\n* @example\n* var gumbel = require( '@stdlib/random/base/gumbel' );\n*\n* var v = gumbel( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/gumbel' ).factory;\n*\n* var gumbel = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = gumbel();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/gumbel' ).factory;\n*\n* var gumbel = factory({\n* 'seed': 297\n* });\n*\n* var v = gumbel( 2.0, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/gumbel' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var gumbel = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = gumbel( 10 );\n* // returns \n*\n* @example\n* var gumbel = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = gumbel( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @name gumbel\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = gumbel( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = gumbel( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar gumbel = factory();\n\n\n// EXPORTS //\n\nmodule.exports = gumbel;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @module @stdlib/random/array/gumbel\n*\n* @example\n* var gumbel = require( '@stdlib/random/array/gumbel' );\n*\n* var arr = gumbel( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var gumbel = require( '@stdlib/random/array/gumbel' );\n*\n* var arr = gumbel( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var gumbel = require( '@stdlib/random/array/gumbel' );\n*\n* var rand = gumbel.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var gumbel = require( '@stdlib/random/array/gumbel' );\n*\n* var rand = gumbel.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {NonNegativeInteger} N - population size\n* @param {NonNegativeInteger} K - subpopulation size\n* @param {NonNegativeInteger} n - number of draws\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1, 2, 3 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( N, K, n ) {\n\tif ( !isNonNegativeInteger( N ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', N ) );\n\t}\n\tif ( !isNonNegativeInteger( K ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', K ) );\n\t}\n\tif ( !isNonNegativeInteger( n ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%s`.', n ) );\n\t}\n\tif ( n > N ) {\n\t\treturn new RangeError( format( 'invalid argument. Third argument must be less than or equal to the first argument. Value: `%u`.', n ) );\n\t}\n\tif ( K > N ) {\n\t\treturn new RangeError( format( 'invalid argument. Second argument must be less than or equal to the first argument. Value: `%u`.', K ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factorial = require( '@stdlib/math/base/special/factorial' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a hypergeometric distribution using the HIN algorithm, which is based on an inverse transformation method.\n*\n* ## References\n*\n* - Fishman, George S. 1973. _Concepts and methods in discrete event digital simulation_. A Wiley-Interscience Publication. New York, NY, USA: Wiley.\n* - Kachitvichyanukul, Voratas., and Burce Schmeiser. 1985. \"Computer generation of hypergeometric random variates.\" _Journal of Statistical Computation and Simulation_ 22 (2): 127\u201345. doi:[10.1080/00949658508810839][@kachitvichyanukul:1985].\n*\n* [@kachitvichyanukul:1985]: http://dx.doi.org/10.1080/00949658508810839\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {NonNegativeInteger} n1 - number of successes in population\n* @param {NonNegativeInteger} n2 - number of failures in population\n* @param {NonNegativeInteger} k - number of draws\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction hin( rand, n1, n2, k ) {\n\tvar p;\n\tvar u;\n\tvar x;\n\tif ( k < n2 ) {\n\t\tp = ( factorial( n2 ) * factorial( n1 + n2 - k ) ) /\n\t\t\t( factorial( n1 + n2 ) * factorial( n2 - k ) );\n\t\tx = 0;\n\t} else {\n\t\tp = ( factorial( n1 ) * factorial( k ) ) /\n\t\t\t( factorial( k - n2 ) * factorial( n1 + n2 ) );\n\t\tx = k - n2;\n\t}\n\tu = rand();\n\twhile ( u > p ) {\n\t\tu -= p;\n\t\tp *= ( n1 - x ) * ( k - x ) / ( ( x + 1 ) * ( n2 - k + 1 + x ) );\n\t\tx += 1;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = hin;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hin = require( './hin.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a hypergeometric distribution.\n*\n* ## References\n*\n* - Kachitvichyanukul, Voratas., and Burce Schmeiser. 1985. \"Computer generation of hypergeometric random variates.\" _Journal of Statistical Computation and Simulation_ 22 (2): 127\u201345. doi:[10.1080/00949658508810839][@kachitvichyanukul:1985].\n*\n* [@kachitvichyanukul:1985]: http://dx.doi.org/10.1080/00949658508810839\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {NonNegativeInteger} N - population size\n* @param {NonNegativeInteger} K - subpopulation size\n* @param {NonNegativeInteger} n - number of draws\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction hypergeometric( rand, N, K, n ) {\n\tvar n1;\n\tvar n2;\n\tvar k;\n\tvar x;\n\n\tif ( n > N/2 ) {\n\t\tk = N - n;\n\t\tif ( 2*K <= N ) {\n\t\t\tn1 = K;\n\t\t\tn2 = N - K;\n\t\t\tx = hin( rand, n1, n2, k );\n\t\t\treturn K - x;\n\t\t}\n\t\tn2 = K;\n\t\tn1 = N - K;\n\t\tx = hin( rand, n1, n2, k );\n\t\treturn n - N + K + x;\n\t}\n\tk = n;\n\tif ( 2*K <= N ) {\n\t\tn1 = K;\n\t\tn2 = N - K;\n\t\tx = hin( rand, n1, n2, k );\n\t\treturn x;\n\t}\n\tn1 = N - K;\n\tn2 = K;\n\tx = hin( rand, n1, n2, k );\n\treturn n - x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = hypergeometric;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isNonNegativeInteger = require( '@stdlib/math/base/assert/is-nonnegative-integer' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar hypergeometric0 = require( './hypergeometric.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating hypergeometric distributed random numbers.\n*\n* @param {NonNegativeInteger} [N] - population size\n* @param {NonNegativeInteger} [K] - subpopulation size\n* @param {NonNegativeInteger} [n] - number of draws\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `N` must be a nonnegative integer\n* @throws {TypeError} `K` must be a nonnegative integer\n* @throws {TypeError} `n` must be a nonnegative integer\n* @throws {RangeError} `n` must be less than or equal to `N`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var hypergeometric = factory( 5, 3, 2 );\n* var v = hypergeometric();\n* // returns \n*\n* @example\n* var hypergeometric = factory( 10, 10, 10, {\n* 'seed': 297\n* });\n* var v = hypergeometric();\n* // returns \n*\n* @example\n* var hypergeometric = factory();\n* var v = hypergeometric( 5, 3, 2 );\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar N;\n\tvar K;\n\tvar n;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tN = arguments[ 0 ];\n\t\tK = arguments[ 1 ];\n\t\tn = arguments[ 2 ];\n\t\terr = validate( N, K, n );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 3 ) {\n\t\t\topts = arguments[ 3 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( N === void 0 ) {\n\t\tprng = hypergeometric2;\n\t} else {\n\t\tprng = hypergeometric1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'hypergeometric' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( N === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ N, K, n ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a hypergeometric distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = hypergeometric1();\n\t* // returns \n\t*/\n\tfunction hypergeometric1() {\n\t\treturn hypergeometric0( rand, N, K, n );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a hypergeometric distribution.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} N - population size\n\t* @param {NonNegativeInteger} K - subpopulation size\n\t* @param {NonNegativeInteger} n - number of draws\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = hypergeometric2( 5, 3, 2 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = hypergeometric2( NaN, NaN, NaN );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = hypergeometric2( 5.21, 3.14, 2.76 );\n\t* // returns NaN\n\t*/\n\tfunction hypergeometric2( N, K, n ) {\n\t\tif (\n\t\t\tN === PINF ||\n\t\t\tK === PINF ||\n\t\t\t!isNonNegativeInteger( N ) ||\n\t\t\t!isNonNegativeInteger( K ) ||\n\t\t\t!isNonNegativeInteger( n ) ||\n\t\t\tn > N\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn hypergeometric0( rand, N, K, n );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a hypergeometric distribution.\n*\n* @name hypergeometric\n* @type {PRNG}\n* @param {NonNegativeInteger} N - population size\n* @param {NonNegativeInteger} K - subpopulation size\n* @param {NonNegativeInteger} n - number of draws\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var v = hypergeometric( 5, 3, 2 );\n* // returns \n*\n* @example\n* var v = hypergeometric( -5, 3, 2 );\n* // returns NaN\n*\n* @example\n* var v = hypergeometric( 5, 3.14, 2 );\n* // returns NaN\n*\n* @example\n* var v = hypergeometric( 5, 3, 1.5 );\n* // returns NaN\n*\n* @example\n* var v = hypergeometric( NaN, NaN, NaN );\n* // returns NaN\n*/\nvar hypergeometric = factory();\n\n\n// EXPORTS //\n\nmodule.exports = hypergeometric;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Hypergeometric distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/hypergeometric\n*\n* @example\n* var hypergeometric = require( '@stdlib/random/base/hypergeometric' );\n*\n* var v = hypergeometric( 10, 10, 10 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/hypergeometric' ).factory;\n* var hypergeometric = factory( 5, 3, 2, {\n* 'seed': 297\n* });\n*\n* var v = hypergeometric();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/hypergeometric' ).factory;\n* var hypergeometric = factory();\n*\n* var v = hypergeometric( 10, 2, 2 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/hypergeometric' ).factory;\n* var hypergeometric = factory({\n* 'seed': 297\n* });\n*\n* var v = hypergeometric( 5, 3, 2 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ternaryFactory = require( './../../../array/tools/ternary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/hypergeometric' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @name factory\n* @type {Function}\n* @param {NonNegativeInteger} [N] - population size\n* @param {NonNegativeInteger} [K] - subpopulation size\n* @param {NonNegativeInteger} [n] - number of draws\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `N` must be a nonnegative integer\n* @throws {TypeError} `K` must be a nonnegative integer\n* @throws {TypeError} `n` must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var hypergeometric = factory( 20, 10, 7 );\n* // returns \n*\n* var arr = hypergeometric( 10 );\n* // returns \n*\n* @example\n* var hypergeometric = factory( 20, 10, 7 );\n* // returns \n*\n* var arr = hypergeometric( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = ternaryFactory( base, DTYPES, defaults.get( 'dtypes.real' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @name hypergeometric\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {NonNegativeInteger} N - population size\n* @param {NonNegativeInteger} K - subpopulation size\n* @param {NonNegativeInteger} n - number of draws\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = hypergeometric( 10, 20, 10, 7 );\n* // returns \n*\n* @example\n* var arr = hypergeometric( 10, 20, 10, 7, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar hypergeometric = factory();\n\n\n// EXPORTS //\n\nmodule.exports = hypergeometric;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @module @stdlib/random/array/hypergeometric\n*\n* @example\n* var hypergeometric = require( '@stdlib/random/array/hypergeometric' );\n*\n* var arr = hypergeometric( 10, 20, 10, 7 );\n* // returns \n*\n* @example\n* var hypergeometric = require( '@stdlib/random/array/hypergeometric' );\n*\n* var arr = hypergeometric( 10, 20, 10, 7, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var hypergeometric = require( '@stdlib/random/array/hypergeometric' );\n*\n* var rand = hypergeometric.factory( 20, 10, 7 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var hypergeometric = require( '@stdlib/random/array/hypergeometric' );\n*\n* var rand = hypergeometric.factory( 20, 10, 7 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, beta ) {\n\tif ( !isPositive( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar gamma = require( './../../../base/gamma' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating inverse gamma distributed random numbers.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var invgamma = factory( 2.0, 1.0 );\n* var v = invgamma();\n* // returns \n*\n* @example\n* var invgamma = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = invgamma();\n* // returns \n*/\nfunction factory() {\n\tvar rgamma;\n\tvar alpha;\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\tif ( arguments.length === 0 ) {\n\t\trgamma = gamma();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trgamma = gamma({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trgamma = gamma( opts );\n\t\t}\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( alpha, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trgamma = gamma( alpha, beta, {\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trgamma = gamma( alpha, beta, opts );\n\t\t\t}\n\t\t} else {\n\t\t\trgamma = gamma( alpha, beta );\n\t\t}\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = invgamma2;\n\t} else {\n\t\tprng = invgamma1;\n\t}\n\trand = rgamma.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'invgamma' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an inverse gamma distribution.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = invgamma1();\n\t* // returns \n\t*/\n\tfunction invgamma1() {\n\t\treturn 1.0 / rgamma();\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an inverse gamma distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = invgamma2( 2.0, 1.0 );\n\t* // returns \n\t*/\n\tfunction invgamma2( alpha, beta ) {\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( beta ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn 1.0 / rgamma( alpha, beta );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a random number drawn from an inverse gamma distribution.\n*\n* ## Method\n*\n* When\n*\n* ```tex\n* X \\sim \\operatorname{Gamma}( \\alpha, \\beta )\n* ```\n*\n* then\n*\n* ```tex\n* \\frac{1}{X} \\sim \\operatorname{InvGamma}\\left( \\alpha, \\tfrac{1}{beta} \\right)\n* ```\n*\n* Hence, to generate a draw from an inverse gamma distribution with parameters \\\\( \\alpha \\\\) and \\\\( \\beta \\\\), sample `X` from a \\\\( \\operatorname{Gamma}\\left( \\alpha, \\tfrac{1}{\\beta} \\right) \\\\) distribution and return `1/X`.\n*\n* @name invgamma\n* @type {PRNG}\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = invgamma( 2.0, 1.0 );\n* // returns \n*\n* @example\n* var v = invgamma( -2.0, 5.0 );\n* // returns NaN\n*/\nvar invgamma = factory();\n\n\n// EXPORTS //\n\nmodule.exports = invgamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Inverse gamma distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/invgamma\n*\n* @example\n* var invgamma = require( '@stdlib/random/base/invgamma' );\n*\n* var v = invgamma( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/invgamma' ).factory;\n* var invgamma = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = invgamma();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/invgamma' ).factory;\n* var invgamma = factory({\n* 'seed': 297\n* });\n*\n* var v = invgamma( 3.0, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/invgamma' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var invgamma = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = invgamma( 10 );\n* // returns \n*\n* @example\n* var invgamma = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = invgamma( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @name invgamma\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = invgamma( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = invgamma( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar invgamma = factory();\n\n\n// EXPORTS //\n\nmodule.exports = invgamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @module @stdlib/random/array/invgamma\n*\n* @example\n* var invgamma = require( '@stdlib/random/array/invgamma' );\n*\n* var arr = invgamma( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var invgamma = require( '@stdlib/random/array/invgamma' );\n*\n* var arr = invgamma( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var invgamma = require( '@stdlib/random/array/invgamma' );\n*\n* var rand = invgamma.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var invgamma = require( '@stdlib/random/array/invgamma' );\n*\n* var rand = invgamma.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( a, b ) {\n\tif ( !isPositive( a ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', a ) );\n\t}\n\tif ( !isPositive( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar pow = require( '@stdlib/math/base/special/pow' );\n\n\n// MAIN //\n\n/**\n* Returns a random number drawn from Kumaraswamy's double bounded distribution.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator for uniformly distributed numbers\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @returns {Probability} pseudorandom number\n*/\nfunction sample( rand, a, b ) {\n\tvar u = rand();\n\treturn pow( 1.0 - pow( 1.0-u, 1.0/b ), 1.0/a );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar kumaraswamy0 = require( './kumaraswamy.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Kumaraswamy's double bounded distributed random numbers.\n*\n* @param {PositiveNumber} [a] - first shape parameter\n* @param {PositiveNumber} [b] - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `a` must be a positive number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var kumaraswamy = factory( 2.0, 1.0 );\n* var v = kumaraswamy();\n* // returns \n*\n* @example\n* var kumaraswamy = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = kumaraswamy();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar a;\n\tvar b;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\ta = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\terr = validate( a, b );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( a === void 0 ) {\n\t\tprng = kumaraswamy2;\n\t} else {\n\t\tprng = kumaraswamy1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'kumaraswamy' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( a === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ a, b ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a Kumaraswamy's double bounded distribution with bound parameter values.\n\t*\n\t* @private\n\t* @returns {Probability} pseudorandom number\n\t*\n\t* @example\n\t* var v = beta1();\n\t* // returns \n\t*/\n\tfunction kumaraswamy1() {\n\t\treturn kumaraswamy0( rand, a, b );\n\t}\n\n\t/**\n\t* Returns a random number drawn from a Kumaraswamy's double bounded distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} a - first shape parameter\n\t* @param {PositiveNumber} b - second shape parameter\n\t* @returns {Probability} pseudorandom number\n\t*\n\t* @example\n\t* var v = kumaraswamy2( 2.0, 3.0 );\n\t* // returns \n\t*/\n\tfunction kumaraswamy2( a, b ) {\n\t\tif (\n\t\t\tisnan( a ) ||\n\t\t\tisnan( b ) ||\n\t\t\ta <= 0.0 ||\n\t\t\tb <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn kumaraswamy0( rand, a, b );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Generates a Kumaraswamy's double bounded distributed random number.\n*\n* @name kumaraswamy\n* @type {PRNG}\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @returns {Probability} pseudorandom number\n*\n* @example\n* var r = kumaraswamy( 2.0, 5.0 );\n* // returns \n*\n* @example\n* var r = kumaraswamy( -2.0, 5.0 );\n* // returns NaN\n*/\nvar kumaraswamy = factory();\n\n\n// EXPORTS //\n\nmodule.exports = kumaraswamy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Kumaraswamy's double bounded distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/kumaraswamy\n*\n* @example\n* var kumaraswamy = require( '@stdlib/random/base/kumaraswamy' );\n*\n* var v = kumaraswamy( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/kumaraswamy' ).factory;\n*\n* var kumaraswamy = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = kumaraswamy();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/kumaraswamy' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from Kumaraswamy's double bounded distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [a] - first shape parameter\n* @param {PositiveNumber} [b] - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `a` must be a positive number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var kumaraswamy = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = kumaraswamy( 10 );\n* // returns \n*\n* @example\n* var kumaraswamy = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = kumaraswamy( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from Kumaraswamy's double bounded distribution.\n*\n* @name kumaraswamy\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = kumaraswamy( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = kumaraswamy( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar kumaraswamy = factory();\n\n\n// EXPORTS //\n\nmodule.exports = kumaraswamy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from Kumaraswamy's double bounded distribution.\n*\n* @module @stdlib/random/array/kumaraswamy\n*\n* @example\n* var kumaraswamy = require( '@stdlib/random/array/kumaraswamy' );\n*\n* var arr = kumaraswamy( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var kumaraswamy = require( '@stdlib/random/array/kumaraswamy' );\n*\n* var arr = kumaraswamy( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var kumaraswamy = require( '@stdlib/random/array/kumaraswamy' );\n*\n* var rand = kumaraswamy.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var kumaraswamy = require( '@stdlib/random/array/kumaraswamy' );\n*\n* var rand = kumaraswamy.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, b ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sign = require( '@stdlib/math/base/special/signum' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Laplace (double exponential) distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction laplace( rand, mu, b ) {\n\tvar u = rand() - 0.5;\n\treturn mu - ( b*sign( u )*ln( 1.0 - (2.0*abs(u)) ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = laplace;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar laplace0 = require( './laplace.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a Laplace (double exponential) distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [b] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var laplace = factory( 0.0, 1.0 );\n* var v = laplace();\n* // returns \n*\n* @example\n* var laplace = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = laplace();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\tvar b;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\terr = validate( mu, b );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = laplace2;\n\t} else {\n\t\tprng = laplace1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'laplace' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, b ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Laplace (double exponential) distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = laplace1();\n\t* // returns \n\t*/\n\tfunction laplace1() {\n\t\treturn laplace0( rand, mu, b );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Laplace (double exponential) distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} b - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = laplace2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = laplace2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction laplace2( mu, b ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( b ) ||\n\t\t\tb <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn laplace0( rand, mu, b );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Laplace (double exponential) distribution.\n*\n* @name laplace\n* @type {PRNG}\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = laplace( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = laplace( 0.0, -1.0 );\n* // returns NaN\n*/\nvar laplace = factory();\n\n\n// EXPORTS //\n\nmodule.exports = laplace;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Laplace (double exponential) distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/laplace\n*\n* @example\n* var laplace = require( '@stdlib/random/base/laplace' );\n*\n* var v = laplace( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/laplace' ).factory;\n* var laplace = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = laplace();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/laplace' ).factory;\n* var laplace = factory({\n* 'seed': 297\n* });\n*\n* var v = laplace( 3.0, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/laplace' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [b] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var laplace = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = laplace( 10 );\n* // returns \n*\n* @example\n* var laplace = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = laplace( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @name laplace\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = laplace( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = laplace( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar laplace = factory();\n\n\n// EXPORTS //\n\nmodule.exports = laplace;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @module @stdlib/random/array/laplace\n*\n* @example\n* var laplace = require( '@stdlib/random/array/laplace' );\n*\n* var arr = laplace( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var laplace = require( '@stdlib/random/array/laplace' );\n*\n* var arr = laplace( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var laplace = require( '@stdlib/random/array/laplace' );\n*\n* var rand = laplace.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var laplace = require( '@stdlib/random/array/laplace' );\n*\n* var rand = laplace.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - mean\n* @param {PositiveNumber} c - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, c ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( c ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', c ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar normalQuantile = require( '@stdlib/stats/base/dists/normal/quantile' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a L\u00E9vy distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {number} mu - location parameter\n* @param {PositiveNumber} c - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction levy( rand, mu, c ) {\n\tvar z = normalQuantile( 1.0 - ( rand() / 2.0 ), 0.0, 1.0 );\n\treturn mu + ( c / ( z*z ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = levy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar levy0 = require( './levy.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a L\u00E9vy distribution.\n*\n* @param {number} [mu] - location parameter\n* @param {PositiveNumber} [c] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `c` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var levy = factory( 0.0, 1.0 );\n* var v = levy();\n* // returns \n*\n* @example\n* var levy = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = levy();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\tvar c;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\tc = arguments[ 1 ];\n\t\terr = validate( mu, c );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = levy2;\n\t} else {\n\t\tprng = levy1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'levy' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, c ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a L\u00E9vy distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = levy1();\n\t* // returns \n\t*/\n\tfunction levy1() {\n\t\treturn levy0( rand, mu, c );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a L\u00E9vy distribution.\n\t*\n\t* @private\n\t* @param {number} mu - location parameter\n\t* @param {PositiveNumber} c - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = levy2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = levy2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction levy2( mu, c ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( c ) ||\n\t\t\tc <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn levy0( rand, mu, c );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a L\u00E9vy distribution.\n*\n* @name levy\n* @type {PRNG}\n* @param {number} mu - location parameter\n* @param {PositiveNumber} c - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = levy( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = levy( 0.0, -1.0 );\n* // returns NaN\n*/\nvar levy = factory();\n\n\n// EXPORTS //\n\nmodule.exports = levy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* L\u00E9vy distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/levy\n*\n* @example\n* var levy = require( '@stdlib/random/base/levy' );\n*\n* var v = levy( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/levy' ).factory;\n* var levy = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = levy();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/levy' ).factory;\n* var levy = factory({\n* 'seed': 297\n* });\n*\n* var v = levy( 3.0, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/levy' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [mu] - location parameter\n* @param {PositiveNumber} [c] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `c` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var levy = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = levy( 10 );\n* // returns \n*\n* @example\n* var levy = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = levy( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @name levy\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} mu - location parameter\n* @param {PositiveNumber} c - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = levy( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = levy( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar levy = factory();\n\n\n// EXPORTS //\n\nmodule.exports = levy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @module @stdlib/random/array/levy\n*\n* @example\n* var levy = require( '@stdlib/random/array/levy' );\n*\n* var arr = levy( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var levy = require( '@stdlib/random/array/levy' );\n*\n* var arr = levy( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var levy = require( '@stdlib/random/array/levy' );\n*\n* var rand = levy.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var levy = require( '@stdlib/random/array/levy' );\n*\n* var rand = levy.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isnan = require( '@stdlib/assert/is-nan' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, s ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( s ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a logistic distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction logistic( rand, mu, s ) {\n\tvar u = rand();\n\treturn mu + ( s*ln( u / (1.0-u) ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = logistic;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar logistic0 = require( './logistic.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a logistic distribution.\n*\n* @param {number} [mu] - mean parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var logistic = factory( 0.0, 1.0 );\n*\n* var v = logistic();\n* // returns \n*\n* @example\n* var logistic = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = logistic();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\tvar s;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\ts = arguments[ 1 ];\n\t\terr = validate( mu, s );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = logistic2;\n\t} else {\n\t\tprng = logistic1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'logistic' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, s ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a logistic distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = logistic1();\n\t* // returns \n\t*/\n\tfunction logistic1() {\n\t\treturn logistic0( rand, mu, s );\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a logistic distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} s - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = logistic2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = logistic2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction logistic2( mu, s ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( s ) ||\n\t\t\ts <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn logistic0( rand, mu, s );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a logistic distribution.\n*\n* @name logistic\n* @type {PRNG}\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = logistic( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = logistic( 0.0, -1.0 );\n* // returns NaN\n*/\nvar logistic = factory();\n\n\n// EXPORTS //\n\nmodule.exports = logistic;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Logistic distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/logistic\n*\n* @example\n* var logistic = require( '@stdlib/random/base/logistic' );\n*\n* var v = logistic( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/logistic' ).factory;\n* var logistic = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = logistic();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/logistic' ).factory;\n* var logistic = factory({\n* 'seed': 297\n* });\n*\n* var v = logistic( 3.0, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/logistic' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a logistic distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [mu] - mean parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var logistic = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = logistic( 10 );\n* // returns \n*\n* @example\n* var logistic = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = logistic( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a logistic distribution.\n*\n* @name logistic\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} mu - mean parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = logistic( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = logistic( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar logistic = factory();\n\n\n// EXPORTS //\n\nmodule.exports = logistic;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a logistic distribution.\n*\n* @module @stdlib/random/array/logistic\n*\n* @example\n* var logistic = require( '@stdlib/random/array/logistic' );\n*\n* var arr = logistic( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var logistic = require( '@stdlib/random/array/logistic' );\n*\n* var arr = logistic( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var logistic = require( '@stdlib/random/array/logistic' );\n*\n* var rand = logistic.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var logistic = require( '@stdlib/random/array/logistic' );\n*\n* var rand = logistic.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale paramter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, sigma ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( sigma ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar exp = require( '@stdlib/math/base/special/exp' );\n\n\n// MAIN //\n\n/**\n* Returns a log-normally distributed pseudorandom number.\n*\n* @private\n* @param {PRNG} randn - PRNG for standard normally distributed numbers\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @returns {PositiveNumber} pseudorandom number\n*/\nfunction lognormal( randn, mu, sigma ) {\n\treturn exp( mu + (sigma*randn()) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = lognormal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar lognormal0 = require( './lognormal.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a lognormal distribution.\n*\n* @param {number} [mu] - location parameter\n* @param {PositiveNumber} [sigma] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var lognormal = factory( 0.0, 1.0 );\n*\n* var v = lognormal();\n* // returns \n*\n* @example\n* var lognormal = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = lognormal();\n* // returns \n*/\nfunction factory() {\n\tvar sigma;\n\tvar rnorm;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\n\tif ( arguments.length === 0 ) {\n\t\trnorm = randn();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trnorm = randn({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trnorm = randn( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\tsigma = arguments[ 1 ];\n\t\terr = validate( mu, sigma );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trnorm = randn({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trnorm = randn( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trnorm = randn();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = lognormal2;\n\t} else {\n\t\tprng = lognormal1;\n\t}\n\trand = rnorm.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'lognormal' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, sigma ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a log-normally distributed pseudorandom number with bound parameters `mu` and `sigma`.\n\t*\n\t* @private\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = lognormal1();\n\t* // returns \n\t*/\n\tfunction lognormal1() {\n\t\treturn lognormal0( rnorm, mu, sigma );\n\t}\n\n\t/**\n\t* Returns a log-normally distributed pseudorandom number with parameters `mu` and `sigma`.\n\t*\n\t* @private\n\t* @param {number} mu - location parameter\n\t* @param {PositiveNumber} sigma - scale parameter\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = lognormal2( -2.0, 4.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = lognormal2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction lognormal2( mu, sigma ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( sigma ) ||\n\t\t\tsigma <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn lognormal0( rnorm, mu, sigma );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a log-normally distributed pseudorandom number with parameters `mu` and `sigma`.\n*\n* @name lognormal\n* @type {PRNG}\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @returns {PositiveNumber} pseudorandom number\n*\n* @example\n* var v = lognormal( -2.0, 4.0 );\n* // returns \n*\n* @example\n* var v = lognormal( 0.0, -1.0 );\n* // returns NaN\n*/\nvar lognormal = factory();\n\n\n// EXPORTS //\n\nmodule.exports = lognormal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Log-normal distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/lognormal\n*\n* @example\n* var lognormal = require( '@stdlib/random/base/lognormal' );\n*\n* var v = lognormal( 0.0, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/lognormal' ).factory;\n* var lognormal = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = lognormal();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/lognormal' ).factory;\n* var lognormal = factory({\n* 'seed': 297\n* });\n*\n* var v = lognormal( 3.0, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/lognormal' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a lognormal distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [mu] - location parameter\n* @param {PositiveNumber} [sigma] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var lognormal = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = lognormal( 10 );\n* // returns \n*\n* @example\n* var lognormal = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = lognormal( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a lognormal distribution.\n*\n* @name lognormal\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = lognormal( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = lognormal( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar lognormal = factory();\n\n\n// EXPORTS //\n\nmodule.exports = lognormal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a lognormal distribution.\n*\n* @module @stdlib/random/array/lognormal\n*\n* @example\n* var lognormal = require( '@stdlib/random/array/lognormal' );\n*\n* var arr = lognormal( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var lognormal = require( '@stdlib/random/array/lognormal' );\n*\n* var arr = lognormal( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var lognormal = require( '@stdlib/random/array/lognormal' );\n*\n* var rand = lognormal.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var lognormal = require( '@stdlib/random/array/lognormal' );\n*\n* var rand = lognormal.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar INT32_MAX = require( '@stdlib/constants/int32/max' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\nvar MAX = INT32_MAX - 1;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom integer on the interval \\\\([1, 2^{31}-1)\\\\).\n*\n* @private\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = randint32();\n* // returns \n*/\nfunction randint32() {\n\tvar v = floor( 1.0 + (MAX*Math.random()) ); // eslint-disable-line stdlib/no-builtin-math\n\treturn v|0; // asm type annotation\n}\n\n\n// EXPORTS //\n\nmodule.exports = randint32;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-len */\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isInt32Array = require( '@stdlib/assert/is-int32array' );\nvar format = require( '@stdlib/string/format' );\nvar INT32_MAX = require( '@stdlib/constants/int32/max' );\nvar Int32Array = require( '@stdlib/array/int32' );\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar randint32 = require( './rand_int32.js' );\n\n\n// VARIABLES //\n\nvar NORMALIZATION_CONSTANT = (INT32_MAX - 1)|0; // asm type annotation\nvar MAX_SEED = (INT32_MAX - 1)|0; // asm type annotation\nvar A = 16807|0; // asm type annotation\n\n// Define the state array schema version:\nvar STATE_ARRAY_VERSION = 1; // NOTE: anytime the state array schema changes, this value should be incremented!!!\n\n// Define the number of sections in the state array:\nvar NUM_STATE_SECTIONS = 2; // state, seed\n\n// Define the index offset of the \"state\" section in the state array:\nvar STATE_SECTION_OFFSET = 2; // | version | num_sections | state_length | ...state | seed_length | ...seed |\n\n// Define the index offset of the seed section in the state array:\nvar SEED_SECTION_OFFSET = 4; // | version | num_sections | state_length | ...state | seed_length | ...seed |\n\n// Define the length of the \"fixed\" length portion of the state array:\nvar STATE_FIXED_LENGTH = 5; // 1 (version) + 1 (num_sections) + 1 (state_length) + 1 (state) + 1 (seed_length)\n\n\n// FUNCTIONS //\n\n/**\n* Verifies state array integrity.\n*\n* @private\n* @param {Int32Array} state - state array\n* @param {boolean} FLG - flag indicating whether the state array was provided as an option (true) or an argument (false)\n* @returns {(Error|null)} an error or `null`\n*/\nfunction verifyState( state, FLG ) {\n\tvar s1;\n\tif ( FLG ) {\n\t\ts1 = 'option';\n\t} else {\n\t\ts1 = 'argument';\n\t}\n\t// The state array must have a minimum length...\n\tif ( state.length < STATE_FIXED_LENGTH+1 ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has insufficient length.', s1 ) );\n\t}\n\t// The first element of the state array must equal the supported state array schema version...\n\tif ( state[ 0 ] !== STATE_ARRAY_VERSION ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible schema version. Expected: `%s`. Actual: `%s`.', s1, STATE_ARRAY_VERSION, state[ 0 ] ) );\n\t}\n\t// The second element of the state array must contain the number of sections...\n\tif ( state[ 1 ] !== NUM_STATE_SECTIONS ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible number of sections. Expected: `%s`. Actual: `%s`.', s1, NUM_STATE_SECTIONS, state[ 1 ] ) );\n\t}\n\t// The length of the \"state\" section must equal `1`...\n\tif ( state[ STATE_SECTION_OFFSET ] !== 1 ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible state length. Expected: `%u`. Actual: `%u`.', s1, 1, state[ STATE_SECTION_OFFSET ] ) );\n\t}\n\t// The length of the \"seed\" section much match the empirical length...\n\tif ( state[ SEED_SECTION_OFFSET ] !== state.length-STATE_FIXED_LENGTH ) {\n\t\treturn new RangeError( format( 'invalid %s. State array length is incompatible with seed section length. Expected: `%u`. Actual: `%u`.', s1, state.length-STATE_FIXED_LENGTH, state[ SEED_SECTION_OFFSET ] ) );\n\t}\n\treturn null;\n}\n\n\n// MAIN //\n\n/**\n* Returns a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @param {Options} [options] - options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} a seed must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integers less than the maximum signed 32-bit integer\n* @throws {RangeError} a numeric seed must be a positive integer less than the maximum signed 32-bit integer\n* @throws {TypeError} state must be an `Int32Array`\n* @throws {Error} must provide a valid state\n* @throws {TypeError} `copy` option must be a boolean\n* @returns {PRNG} LCG PRNG\n*\n* @example\n* var minstd = factory();\n*\n* var v = minstd();\n* // returns \n*\n* @example\n* // Return a seeded LCG:\n* var minstd = factory({\n* 'seed': 1234\n* });\n*\n* var v = minstd();\n* // returns 20739838\n*/\nfunction factory( options ) {\n\tvar STATE;\n\tvar state;\n\tvar opts;\n\tvar seed;\n\tvar slen;\n\tvar err;\n\n\topts = {};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( options.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', options.copy ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'state' ) ) {\n\t\t\tstate = options.state;\n\t\t\topts.state = true;\n\t\t\tif ( !isInt32Array( state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be an Int32Array. Option: `%s`.', 'state', state ) );\n\t\t\t}\n\t\t\terr = verifyState( state, true );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tSTATE = state;\n\t\t\t} else {\n\t\t\t\tSTATE = new Int32Array( state.length );\n\t\t\t\tgcopy( state.length, state, 1, STATE, 1 );\n\t\t\t}\n\t\t\t// Create a state \"view\":\n\t\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t\t// Create a seed \"view\":\n\t\t\tseed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), state[ SEED_SECTION_OFFSET ] );\n\t\t}\n\t\t// If provided a PRNG state, we ignore the `seed` option...\n\t\tif ( seed === void 0 ) {\n\t\t\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\t\t\tseed = options.seed;\n\t\t\t\topts.seed = true;\n\t\t\t\tif ( isPositiveInteger( seed ) ) {\n\t\t\t\t\tif ( seed > MAX_SEED ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid option. `%s` option must be a positive integer less than the maximum signed 32-bit integer. Option: `%u`.', 'seed', seed ) );\n\t\t\t\t\t}\n\t\t\t\t\tseed |= 0; // asm type annotation\n\t\t\t\t} else if ( isCollection( seed ) && seed.length > 0 ) {\n\t\t\t\t\tslen = seed.length;\n\t\t\t\t\tSTATE = new Int32Array( STATE_FIXED_LENGTH+slen );\n\n\t\t\t\t\t// Initialize sections:\n\t\t\t\t\tSTATE[ 0 ] = STATE_ARRAY_VERSION;\n\t\t\t\t\tSTATE[ 1 ] = NUM_STATE_SECTIONS;\n\t\t\t\t\tSTATE[ STATE_SECTION_OFFSET ] = 1;\n\t\t\t\t\tSTATE[ SEED_SECTION_OFFSET ] = slen;\n\n\t\t\t\t\t// Copy the provided seed array to prevent external mutation, as mutation would lead to an inability to reproduce PRNG values according to the PRNG's stated seed:\n\t\t\t\t\tgcopy.ndarray( slen, seed, 1, 0, STATE, 1, SEED_SECTION_OFFSET+1 );\n\n\t\t\t\t\t// Create a state \"view\":\n\t\t\t\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t\t\t\t// Create a seed \"view\":\n\t\t\t\t\tseed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), slen );\n\n\t\t\t\t\t// Initialize the internal PRNG state:\n\t\t\t\t\tstate[ 0 ] = seed[ 0 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integer values less than the maximum signed 32-bit integer. Option: `%s`.', 'seed', seed ) );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tseed = randint32()|0; // asm type annotation\n\t\t\t}\n\t\t}\n\t} else {\n\t\tseed = randint32()|0; // asm type annotation\n\t}\n\tif ( state === void 0 ) {\n\t\tSTATE = new Int32Array( STATE_FIXED_LENGTH+1 );\n\n\t\t// Initialize sections:\n\t\tSTATE[ 0 ] = STATE_ARRAY_VERSION;\n\t\tSTATE[ 1 ] = NUM_STATE_SECTIONS;\n\t\tSTATE[ STATE_SECTION_OFFSET ] = 1;\n\t\tSTATE[ SEED_SECTION_OFFSET ] = 1;\n\t\tSTATE[ SEED_SECTION_OFFSET+1 ] = seed;\n\n\t\t// Create a state \"view\":\n\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t// Create a seed \"view\":\n\t\tseed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t// Initialize the internal PRNG state:\n\t\tstate[ 0 ] = seed[ 0 ];\n\t}\n\tsetReadOnly( minstd, 'NAME', 'minstd' );\n\tsetReadOnlyAccessor( minstd, 'seed', getSeed );\n\tsetReadOnlyAccessor( minstd, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( minstd, 'state', getState, setState );\n\tsetReadOnlyAccessor( minstd, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( minstd, 'byteLength', getStateSize );\n\tsetReadOnly( minstd, 'toJSON', toJSON );\n\tsetReadOnly( minstd, 'MIN', 1 );\n\tsetReadOnly( minstd, 'MAX', INT32_MAX-1 );\n\tsetReadOnly( minstd, 'normalized', normalized );\n\n\tsetReadOnly( normalized, 'NAME', minstd.NAME );\n\tsetReadOnlyAccessor( normalized, 'seed', getSeed );\n\tsetReadOnlyAccessor( normalized, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( normalized, 'state', getState, setState );\n\tsetReadOnlyAccessor( normalized, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( normalized, 'byteLength', getStateSize );\n\tsetReadOnly( normalized, 'toJSON', toJSON );\n\tsetReadOnly( normalized, 'MIN', (minstd.MIN-1.0) / NORMALIZATION_CONSTANT );\n\tsetReadOnly( normalized, 'MAX', (minstd.MAX-1.0) / NORMALIZATION_CONSTANT );\n\n\treturn minstd;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMINSTD} seed\n\t*/\n\tfunction getSeed() {\n\t\tvar len = STATE[ SEED_SECTION_OFFSET ];\n\t\treturn gcopy( len, seed, 1, new Int32Array( len ), 1 );\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn STATE[ SEED_SECTION_OFFSET ];\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn STATE.length;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn STATE.byteLength;\n\t}\n\n\t/**\n\t* Returns the current PRNG state.\n\t*\n\t* ## Notes\n\t*\n\t* - The PRNG state array is comprised of a preamble followed by `2` sections:\n\t*\n\t* 0. preamble (version + number of sections)\n\t* 1. internal PRNG state\n\t* 2. PRNG seed\n\t*\n\t* - The first element of the PRNG state array preamble is the state array schema version.\n\t*\n\t* - The second element of the PRNG state array preamble is the number of state array sections (i.e., `2`).\n\t*\n\t* - The first element of each section following the preamble specifies the section length. The remaining section elements comprise the section contents.\n\t*\n\t* @private\n\t* @returns {PRNGStateMINSTD} current state\n\t*/\n\tfunction getState() {\n\t\tvar len = STATE.length;\n\t\treturn gcopy( len, STATE, 1, new Int32Array( len ), 1 );\n\t}\n\n\t/**\n\t* Sets the PRNG state.\n\t*\n\t* ## Notes\n\t*\n\t* - If PRNG state is \"shared\" (meaning a state array was provided during PRNG creation and **not** copied) and one sets the generator state to a state array having a different length, the PRNG does **not** update the existing shared state and, instead, points to the newly provided state array. In order to synchronize PRNG output according to the new shared state array, the state array for **each** relevant PRNG must be **explicitly** set.\n\t* - If PRNG state is \"shared\" and one sets the generator state to a state array of the same length, the PRNG state is updated (along with the state of all other PRNGs sharing the PRNG's state array).\n\t*\n\t* @private\n\t* @param {PRNGStateMINSTD} s - generator state\n\t* @throws {TypeError} must provide an `Int32Array`\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\tvar err;\n\t\tif ( !isInt32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an Int32Array. Value: `%s`.', s ) );\n\t\t}\n\t\terr = verifyState( s, false );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( opts.copy === false ) {\n\t\t\tif ( opts.state && s.length === STATE.length ) {\n\t\t\t\tgcopy( s.length, s, 1, STATE, 1 ); // update current shared state\n\t\t\t} else {\n\t\t\t\tSTATE = s; // point to new shared state\n\t\t\t\topts.state = true; // setting this flag allows updating a shared state even if a state array was not provided at PRNG creation\n\t\t\t}\n\t\t} else {\n\t\t\t// Check if we can reuse allocated memory...\n\t\t\tif ( s.length !== STATE.length ) {\n\t\t\t\tSTATE = new Int32Array( s.length ); // reallocate\n\t\t\t}\n\t\t\tgcopy( s.length, s, 1, STATE, 1 );\n\t\t}\n\t\t// Create a new state \"view\":\n\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t// Create a new seed \"view\":\n\t\tseed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), STATE[ SEED_SECTION_OFFSET ] );\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = minstd.NAME;\n\t\tout.state = typedarray2json( STATE );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n\n\t/**\n\t* Generates a pseudorandom integer on the interval \\\\( [1,2^{31}-1) \\\\).\n\t*\n\t* @private\n\t* @returns {integer32} pseudorandom integer\n\t*/\n\tfunction minstd() {\n\t\tvar s = state[ 0 ]|0; // asm type annotation\n\t\ts = ( (A*s)%INT32_MAX )|0; // asm type annotation\n\t\tstate[ 0 ] = s;\n\t\treturn s|0; // asm type annotation\n\t}\n\n\t/**\n\t* Generates a pseudorandom number on the interval \\\\( [0,1) \\\\).\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*/\n\tfunction normalized() {\n\t\treturn (minstd()-1) / NORMALIZATION_CONSTANT;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\nvar randint32 = require( './rand_int32.js' );\n\n\n// MAIN //\n\n/**\n* Generates a pseudorandom integer on the interval \\\\( [1,2^{31}-1) \\\\).\n*\n* ## Method\n*\n* Linear congruential generators (LCGs) use the recurrence relation\n*\n* ```tex\n* X_{n+1} = ( a \\cdot X_n + c ) \\operatorname{mod}(m)\n* ```\n*\n* where the modulus \\\\( m \\\\) is a prime number or power of a prime number and \\\\( a \\\\) is a primitive root modulo \\\\( m \\\\).\n*\n* \n*\n* For an LCG to be a Lehmer RNG, the seed \\\\( X_0 \\\\) must be coprime to \\\\( m \\\\).\n*\n* \n*\n* In this implementation, the constants \\\\( a \\\\), \\\\( c \\\\), and \\\\( m \\\\) have the values\n*\n* ```tex\n* \\begin{align*}\n* a &= 7^5 = 16807 \\\\\n* c &= 0 \\\\\n* m &= 2^{31} - 1 = 2147483647\n* \\end{align*}\n* ```\n*\n* \n*\n* The constant \\\\( m \\\\) is a Mersenne prime (modulo \\\\(31\\\\)).\n*\n* \n*\n* \n*\n* The constant \\\\( a \\\\) is a primitive root (modulo \\\\(31\\\\)).\n*\n* \n*\n* Accordingly, the maximum possible product is\n*\n* ```tex\n* 16807 \\cdot (m - 1) \\approx 2^{46}\n* ```\n*\n* The values for \\\\( a \\\\), \\\\( c \\\\), and \\\\( m \\\\) are taken from Park and Miller, \"Random Number Generators: Good Ones Are Hard To Find\". Park's and Miller's article is also the basis for a recipe in the second edition of _Numerical Recipes in C_.\n*\n*\n* ## Notes\n*\n* - The generator has a period of approximately \\\\(2.1\\mbox{e}9\\\\) (see [Numerical Recipes in C, 2nd Edition](#references), p. 279).\n*\n*\n* ## References\n*\n* - Park, S. K., and K. W. Miller. 1988. \"Random Number Generators: Good Ones Are Hard to Find.\" _Communications of the ACM_ 31 (10). New York, NY, USA: ACM: 1192\u20131201. doi:[10.1145/63039.63042](http://dx.doi.org/10.1145/63039.63042).\n* - Press, William H., Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. 1992. _Numerical Recipes in C: The Art of Scientific Computing, Second Edition_. Cambridge University Press.\n*\n*\n* @function minstd\n* @type {PRNG}\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = minstd();\n* // returns \n*/\nvar minstd = factory({\n\t'seed': randint32()\n});\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* A linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @module @stdlib/random/base/minstd\n*\n* @example\n* var minstd = require( '@stdlib/random/base/minstd' );\n*\n* var v = minstd();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/minstd' ).factory;\n*\n* var minstd = factory({\n* 'seed': 1234\n* });\n*\n* var v = minstd();\n* // returns 20739838\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"idtype\": \"float64\",\n \"ndtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar fdtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar rdtypes = require( '@stdlib/array/typed-real-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar RDTYPES = rdtypes();\nvar FDTYPES = fdtypes();\nRDTYPES.push( 'generic' );\nFDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* ## Notes\n*\n* - Validation modes:\n*\n* - `0`: factory validation\n* - `1`: integer PRNG validation\n* - `2`: normalized PRNG validation\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @param {string} [options.idtype] - output array data type when generating integers\n* @param {string} [options.rdtype] - output array data type when generating normalized numbers\n* @param {integer} mode - validation mode\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options, 0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options, mode ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( mode === 0 ) {\n\t\tif ( hasOwnProp( options, 'idtype' ) ) {\n\t\t\topts.idtype = options.idtype;\n\t\t\tif ( RDTYPES.indexOf( opts.idtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'idtype', RDTYPES.join( '\", \"' ), opts.idtype ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'ndtype' ) ) {\n\t\t\topts.ndtype = options.ndtype;\n\t\t\tif ( FDTYPES.indexOf( opts.ndtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'ndtype', FDTYPES.join( '\", \"' ), opts.ndtype ) );\n\t\t\t}\n\t\t}\n\t} else if ( mode === 1 && hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( RDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', RDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t} else if ( hasOwnProp( options, 'dtype' ) ) { // mode === 2\n\t\topts.dtype = options.dtype;\n\t\tif ( FDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', FDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar base = require( './../../../base/minstd' );\nvar ctors = require( '@stdlib/array/typed-real-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG).\n*\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.idtype=\"float64\"] - default data type when generating integers\n* @param {string} [options.ndtype=\"float64\"] - default data type when generating normalized numbers\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd.normalized( 10 );\n* // returns \n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'idtype': defaults.idtype,\n\t\t'ndtype': defaults.ndtype\n\t};\n\n\tnargs = arguments.length;\n\trand = minstd;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options, 0 );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\tsetReadOnly( rand, 'PRNG', prng );\n\tsetReadOnly( rand, 'normalized', normalized );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom integers on the interval `[1, 2147483646]`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction minstd( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 1 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.idtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers on the interval `[0, 1)`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction normalized( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 2 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.ndtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng.normalized );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng.normalized );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {Int32Array} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {Int32Array} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {Int32Array} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @name minstd\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var arr = minstd.normalized( 10 );\n* // returns \n*\n* @example\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar minstd = factory();\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG).\n*\n* @module @stdlib/random/array/minstd\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var arr = minstd.normalized( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var arr = minstd.normalized( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var rand = minstd.factory();\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var rand = minstd.factory();\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"normalized\": \"main.normalized\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// VARIABLES //\n\nvar NUM_WARMUPS = 8;\n\n\n// MAIN //\n\n/**\n* Initializes a shuffle table.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator\n* @param {Int32Array} table - table\n* @param {PositiveInteger} N - table size\n* @throws {Error} PRNG returned `NaN`\n* @returns {NumberArray} shuffle table\n*/\nfunction createTable( rand, table, N ) {\n\tvar v;\n\tvar i;\n\n\t// \"warm-up\" the PRNG...\n\tfor ( i = 0; i < NUM_WARMUPS; i++ ) {\n\t\tv = rand();\n\n\t\t// Prevent the above loop from being discarded by the compiler...\n\t\tif ( isnan( v ) ) {\n\t\t\tthrow new Error( 'unexpected error. PRNG returned NaN.' );\n\t\t}\n\t}\n\t// Initialize the shuffle table...\n\tfor ( i = N-1; i >= 0; i-- ) {\n\t\ttable[ i ] = rand();\n\t}\n\treturn table;\n}\n\n\n// EXPORTS //\n\nmodule.exports = createTable;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar INT32_MAX = require( '@stdlib/constants/int32/max' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\nvar MAX = INT32_MAX - 1;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom integer on the interval \\\\([1, 2^{31}-1)\\\\).\n*\n* @private\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = randint32();\n* // returns \n*/\nfunction randint32() {\n\tvar v = floor( 1.0 + (MAX*Math.random()) ); // eslint-disable-line stdlib/no-builtin-math\n\treturn v|0; // asm type annotation\n}\n\n\n// EXPORTS //\n\nmodule.exports = randint32;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-len */\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isInt32Array = require( '@stdlib/assert/is-int32array' );\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar Int32Array = require( '@stdlib/array/int32' );\nvar INT32_MAX = require( '@stdlib/constants/int32/max' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar createTable = require( './create_table.js' );\nvar randint32 = require( './rand_int32.js' );\n\n\n// VARIABLES //\n\nvar NORMALIZATION_CONSTANT = (INT32_MAX - 1)|0; // asm type annotation\nvar MAX_SEED = (INT32_MAX - 1)|0; // asm type annotation\nvar A = 16807|0; // asm type annotation\n\n// Define the number of elements in the shuffle table:\nvar TABLE_LENGTH = 32;\n\n// Define the state array schema version:\nvar STATE_ARRAY_VERSION = 1; // NOTE: anytime the state array schema changes, this value should be incremented!!!\n\n// Define the number of sections in the state array:\nvar NUM_STATE_SECTIONS = 3; // table, other, seed\n\n// Define the index offset of the \"table\" section in the state array:\nvar TABLE_SECTION_OFFSET = 2; // | version | num_sections | table_length | ...table | other_length | shuffle_state | prng_state | seed_length | ...seed |\n\n// Define the index offset of the \"state\" section in the state array:\nvar STATE_SECTION_OFFSET = TABLE_LENGTH + 3; // | version | num_sections | table_length | ...table | state_length | shuffle_state | prng_state | seed_length | ...seed |\n\n// Define the index offset of the seed section in the state array:\nvar SEED_SECTION_OFFSET = TABLE_LENGTH + 6; // | version | num_sections | table_length | ...table | state_length | shuffle_state | prng_state | seed_length | ...seed |\n\n// Define the length of the \"fixed\" length portion of the state array:\nvar STATE_FIXED_LENGTH = TABLE_LENGTH + 7; // 1 (version) + 1 (num_sections) + 1 (table_length) + TABLE_LENGTH (table) + 1 (state_length) + 1 (shuffle_state) + 1 (prng_state) + 1 (seed_length)\n\n// Define the indices for the shuffle table and PRNG states:\nvar SHUFFLE_STATE = STATE_SECTION_OFFSET + 1;\nvar PRNG_STATE = STATE_SECTION_OFFSET + 2;\n\n\n// FUNCTIONS //\n\n/**\n* Verifies state array integrity.\n*\n* @private\n* @param {Int32Array} state - state array\n* @param {boolean} FLG - flag indicating whether the state array was provided as an option (true) or an argument (false)\n* @returns {(Error|null)} an error or `null`\n*/\nfunction verifyState( state, FLG ) {\n\tvar s1;\n\tif ( FLG ) {\n\t\ts1 = 'option';\n\t} else {\n\t\ts1 = 'argument';\n\t}\n\t// The state array must have a minimum length...\n\tif ( state.length < STATE_FIXED_LENGTH+1 ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has insufficient length.', s1 ) );\n\t}\n\t// The first element of the state array must equal the supported state array schema version...\n\tif ( state[ 0 ] !== STATE_ARRAY_VERSION ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible schema version. Expected: `%s`. Actual: `%s`.', s1, STATE_ARRAY_VERSION, state[ 0 ] ) );\n\t}\n\t// The second element of the state array must contain the number of sections...\n\tif ( state[ 1 ] !== NUM_STATE_SECTIONS ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible number of sections. Expected: `%s`. Actual: `%s`.', s1, NUM_STATE_SECTIONS, state[ 1 ] ) );\n\t}\n\t// The length of the \"table\" section must equal `TABLE_LENGTH`...\n\tif ( state[ TABLE_SECTION_OFFSET ] !== TABLE_LENGTH ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible table length. Expected: `%s`. Actual: `%s`.', s1, TABLE_LENGTH, state[ TABLE_SECTION_OFFSET ] ) );\n\t}\n\t// The length of the \"state\" section must equal `2`...\n\tif ( state[ STATE_SECTION_OFFSET ] !== 2 ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible state length. Expected: `%u`. Actual: `%u`.', s1, 2, state[ STATE_SECTION_OFFSET ] ) );\n\t}\n\t// The length of the \"seed\" section much match the empirical length...\n\tif ( state[ SEED_SECTION_OFFSET ] !== state.length-STATE_FIXED_LENGTH ) {\n\t\treturn new RangeError( format( 'invalid %s. State array length is incompatible with seed section length. Expected: `%u`. Actual: `%u`.', s1, state.length-STATE_FIXED_LENGTH, state[ SEED_SECTION_OFFSET ] ) );\n\t}\n\treturn null;\n}\n\n\n// MAIN //\n\n/**\n* Returns a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @param {Options} [options] - options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} a seed must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integers less than the maximum signed 32-bit integer\n* @throws {RangeError} a numeric seed must be a positive integer less than the maximum signed 32-bit integer\n* @throws {TypeError} state must be an `Int32Array`\n* @throws {Error} must provide a valid state\n* @throws {TypeError} `copy` option must be a boolean\n* @returns {PRNG} shuffled LCG PRNG\n*\n* @example\n* var minstd = factory();\n*\n* var v = minstd();\n* // returns \n*\n* @example\n* // Return a seeded LCG:\n* var minstd = factory({\n* 'seed': 1234\n* });\n*\n* var v = minstd();\n* // returns 1421600654\n*/\nfunction factory( options ) {\n\tvar STATE;\n\tvar state;\n\tvar opts;\n\tvar seed;\n\tvar slen;\n\tvar err;\n\n\topts = {};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( options.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', options.copy ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'state' ) ) {\n\t\t\tstate = options.state;\n\t\t\topts.state = true;\n\t\t\tif ( !isInt32Array( state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be an Int32Array. Option: `%s`.', 'state', state ) );\n\t\t\t}\n\t\t\terr = verifyState( state, true );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tSTATE = state;\n\t\t\t} else {\n\t\t\t\tSTATE = new Int32Array( state.length );\n\t\t\t\tgcopy( state.length, state, 1, STATE, 1 );\n\t\t\t}\n\t\t\t// Create a state (table) \"view\":\n\t\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((TABLE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), TABLE_LENGTH );\n\n\t\t\t// Create a seed \"view\":\n\t\t\tseed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), state[ SEED_SECTION_OFFSET ] );\n\t\t}\n\t\t// If provided a PRNG state, we ignore the `seed` option...\n\t\tif ( seed === void 0 ) {\n\t\t\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\t\t\tseed = options.seed;\n\t\t\t\topts.seed = true;\n\t\t\t\tif ( isPositiveInteger( seed ) ) {\n\t\t\t\t\tif ( seed > MAX_SEED ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid option. `%s` option must be a positive integer less than the maximum signed 32-bit integer. Option: `%u`.', 'seed', seed ) );\n\t\t\t\t\t}\n\t\t\t\t\tseed |= 0; // asm type annotation\n\t\t\t\t} else if ( isCollection( seed ) && seed.length > 0 ) {\n\t\t\t\t\tslen = seed.length;\n\t\t\t\t\tSTATE = new Int32Array( STATE_FIXED_LENGTH+slen );\n\n\t\t\t\t\t// Initialize sections:\n\t\t\t\t\tSTATE[ 0 ] = STATE_ARRAY_VERSION;\n\t\t\t\t\tSTATE[ 1 ] = NUM_STATE_SECTIONS;\n\t\t\t\t\tSTATE[ TABLE_SECTION_OFFSET ] = TABLE_LENGTH;\n\t\t\t\t\tSTATE[ STATE_SECTION_OFFSET ] = 2;\n\t\t\t\t\tSTATE[ PRNG_STATE ] = seed[ 0 ];\n\t\t\t\t\tSTATE[ SEED_SECTION_OFFSET ] = slen;\n\n\t\t\t\t\t// Copy the provided seed array to prevent external mutation, as mutation would lead to an inability to reproduce PRNG values according to the PRNG's stated seed:\n\t\t\t\t\tgcopy.ndarray( slen, seed, 1, 0, STATE, 1, SEED_SECTION_OFFSET+1 );\n\n\t\t\t\t\t// Create a state (table) \"view\":\n\t\t\t\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((TABLE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), TABLE_LENGTH );\n\n\t\t\t\t\t// Create a seed \"view\":\n\t\t\t\t\tseed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), slen );\n\n\t\t\t\t\t// Initialize the internal PRNG state:\n\t\t\t\t\tstate = createTable( minstd, state, TABLE_LENGTH );\n\t\t\t\t\tSTATE[ SHUFFLE_STATE ] = state[ 0 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integer values less than the maximum signed 32-bit integer. Option: `%s`.', 'seed', seed ) );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tseed = randint32()|0; // asm type annotation\n\t\t\t}\n\t\t}\n\t} else {\n\t\tseed = randint32()|0; // asm type annotation\n\t}\n\tif ( state === void 0 ) {\n\t\tSTATE = new Int32Array( STATE_FIXED_LENGTH+1 );\n\n\t\t// Initialize sections:\n\t\tSTATE[ 0 ] = STATE_ARRAY_VERSION;\n\t\tSTATE[ 1 ] = NUM_STATE_SECTIONS;\n\t\tSTATE[ TABLE_SECTION_OFFSET ] = TABLE_LENGTH;\n\t\tSTATE[ STATE_SECTION_OFFSET ] = 2;\n\t\tSTATE[ PRNG_STATE ] = seed;\n\t\tSTATE[ SEED_SECTION_OFFSET ] = 1;\n\t\tSTATE[ SEED_SECTION_OFFSET+1 ] = seed;\n\n\t\t// Create a state (table) \"view\":\n\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((TABLE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), TABLE_LENGTH );\n\n\t\t// Create a seed \"view\":\n\t\tseed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t// Initialize the internal PRNG state:\n\t\tstate = createTable( minstd, state, TABLE_LENGTH );\n\t\tSTATE[ SHUFFLE_STATE ] = state[ 0 ];\n\t}\n\tsetReadOnly( minstdShuffle, 'NAME', 'minstd-shuffle' );\n\tsetReadOnlyAccessor( minstdShuffle, 'seed', getSeed );\n\tsetReadOnlyAccessor( minstdShuffle, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( minstdShuffle, 'state', getState, setState );\n\tsetReadOnlyAccessor( minstdShuffle, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( minstdShuffle, 'byteLength', getStateSize );\n\tsetReadOnly( minstdShuffle, 'toJSON', toJSON );\n\tsetReadOnly( minstdShuffle, 'MIN', 1 );\n\tsetReadOnly( minstdShuffle, 'MAX', INT32_MAX-1 );\n\tsetReadOnly( minstdShuffle, 'normalized', normalized );\n\n\tsetReadOnly( normalized, 'NAME', minstdShuffle.NAME );\n\tsetReadOnlyAccessor( normalized, 'seed', getSeed );\n\tsetReadOnlyAccessor( normalized, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( normalized, 'state', getState, setState );\n\tsetReadOnlyAccessor( normalized, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( normalized, 'byteLength', getStateSize );\n\tsetReadOnly( normalized, 'toJSON', toJSON );\n\tsetReadOnly( normalized, 'MIN', (minstdShuffle.MIN-1.0) / NORMALIZATION_CONSTANT );\n\tsetReadOnly( normalized, 'MAX', (minstdShuffle.MAX-1.0) / NORMALIZATION_CONSTANT );\n\n\treturn minstdShuffle;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMINSTD} seed\n\t*/\n\tfunction getSeed() {\n\t\tvar len = STATE[ SEED_SECTION_OFFSET ];\n\t\treturn gcopy( len, seed, 1, new Int32Array( len ), 1 );\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn STATE[ SEED_SECTION_OFFSET ];\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn STATE.length;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn STATE.byteLength;\n\t}\n\n\t/**\n\t* Returns the current PRNG state.\n\t*\n\t* ## Notes\n\t*\n\t* - The PRNG state array is comprised of a preamble followed by `3` sections:\n\t*\n\t* 0. preamble (version + number of sections)\n\t* 1. shuffle table\n\t* 2. internal PRNG state\n\t* 3. PRNG seed\n\t*\n\t* - The first element of the PRNG state array preamble is the state array schema version.\n\t*\n\t* - The second element of the PRNG state array preamble is the number of state array sections (i.e., `3`).\n\t*\n\t* - The first element of each section following the preamble specifies the section length. The remaining section elements comprise the section contents.\n\t*\n\t* @private\n\t* @returns {PRNGStateMINSTD} current state\n\t*/\n\tfunction getState() {\n\t\tvar len = STATE.length;\n\t\treturn gcopy( len, STATE, 1, new Int32Array( len ), 1 );\n\t}\n\n\t/**\n\t* Sets the PRNG state.\n\t*\n\t* ## Notes\n\t*\n\t* - If PRNG state is \"shared\" (meaning a state array was provided during PRNG creation and **not** copied) and one sets the generator state to a state array having a different length, the PRNG does **not** update the existing shared state and, instead, points to the newly provided state array. In order to synchronize PRNG output according to the new shared state array, the state array for **each** relevant PRNG must be **explicitly** set.\n\t* - If PRNG state is \"shared\" and one sets the generator state to a state array of the same length, the PRNG state is updated (along with the state of all other PRNGs sharing the PRNG's state array).\n\t*\n\t* @private\n\t* @param {PRNGStateMINSTD} s - generator state\n\t* @throws {TypeError} must provide an `Int32Array`\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\tvar err;\n\t\tif ( !isInt32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an Int32Array. Value: `%s`.', s ) );\n\t\t}\n\t\terr = verifyState( s, false );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( opts.copy === false ) {\n\t\t\tif ( opts.state && s.length === STATE.length ) {\n\t\t\t\tgcopy( s.length, s, 1, STATE, 1 ); // update current shared state\n\t\t\t} else {\n\t\t\t\tSTATE = s; // point to new shared state\n\t\t\t\topts.state = true; // setting this flag allows updating a shared state even if a state array was not provided at PRNG creation\n\t\t\t}\n\t\t} else {\n\t\t\t// Check if we can reuse allocated memory...\n\t\t\tif ( s.length !== STATE.length ) {\n\t\t\t\tSTATE = new Int32Array( s.length ); // reallocate\n\t\t\t}\n\t\t\tgcopy( s.length, s, 1, STATE, 1 );\n\t\t}\n\t\t// Create a new state (table) \"view\":\n\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((TABLE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), TABLE_LENGTH );\n\n\t\t// Create a new seed \"view\":\n\t\tseed = new Int32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), STATE[ SEED_SECTION_OFFSET ] );\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = minstdShuffle.NAME;\n\t\tout.state = typedarray2json( STATE );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n\n\t/**\n\t* Generates a pseudorandom integer on the interval \\\\( [1,2^{31}-1) \\\\).\n\t*\n\t* @private\n\t* @returns {integer32} pseudorandom integer\n\t*/\n\tfunction minstd() {\n\t\tvar s = STATE[ PRNG_STATE ]|0; // asm type annotation\n\t\ts = ( (A*s)%INT32_MAX )|0; // asm type annotation\n\t\tSTATE[ PRNG_STATE ] = s;\n\t\treturn s|0; // asm type annotation\n\t}\n\n\t/**\n\t* Generates a pseudorandom integer on the interval \\\\( [1,2^{31}-1) \\\\).\n\t*\n\t* @private\n\t* @returns {integer32} pseudorandom integer\n\t*\n\t* @example\n\t* var v = minstd();\n\t* // returns \n\t*/\n\tfunction minstdShuffle() {\n\t\tvar s;\n\t\tvar i;\n\n\t\ts = STATE[ SHUFFLE_STATE ];\n\t\ti = floor( TABLE_LENGTH * (s/INT32_MAX) );\n\n\t\t// Pull a state from the table:\n\t\ts = state[ i ];\n\n\t\t// Update the PRNG state:\n\t\tSTATE[ SHUFFLE_STATE ] = s;\n\n\t\t// Replace the pulled state:\n\t\tstate[ i ] = minstd();\n\n\t\treturn s;\n\t}\n\n\t/**\n\t* Generates a pseudorandom number on the interval \\\\( [0,1) \\\\).\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = normalized();\n\t* // returns \n\t*/\n\tfunction normalized() {\n\t\treturn (minstdShuffle()-1) / NORMALIZATION_CONSTANT;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\nvar randint32 = require( './rand_int32.js' );\n\n\n// MAIN //\n\n/**\n* Generates a pseudorandom integer on the interval \\\\( [1,2^{31}-1) \\\\).\n*\n* ## Method\n*\n* Linear congruential generators (LCGs) use the recurrence relation\n*\n* ```tex\n* X_{n+1} = ( a \\cdot X_n + c ) \\operatorname{mod}(m)\n* ```\n*\n* where the modulus \\\\( m \\\\) is a prime number or power of a prime number and \\\\( a \\\\) is a primitive root modulo \\\\( m \\\\).\n*\n* \n*\n* For an LCG to be a Lehmer RNG, the seed \\\\( X_0 \\\\) must be coprime to \\\\( m \\\\).\n*\n* \n*\n* In this implementation, the constants \\\\( a \\\\), \\\\( c \\\\), and \\\\( m \\\\) have the values\n*\n* ```tex\n* \\begin{align*}\n* a &= 7^5 = 16807 \\\\\n* c &= 0 \\\\\n* m &= 2^{31} - 1 = 2147483647\n* \\end{align*}\n* ```\n*\n* \n*\n* The constant \\\\( m \\\\) is a Mersenne prime (modulo \\\\(31\\\\)).\n*\n* \n*\n* \n*\n* The constant \\\\( a \\\\) is a primitive root (modulo \\\\(31\\\\)).\n*\n* \n*\n* Accordingly, the maximum possible product is\n*\n* ```tex\n* 16807 \\cdot (m - 1) \\approx 2^{46}\n* ```\n*\n* The values for \\\\( a \\\\), \\\\( c \\\\), and \\\\( m \\\\) are taken from Park and Miller, \"Random Number Generators: Good Ones Are Hard To Find\". Park's and Miller's article is also the basis for a recipe in the second edition of _Numerical Recipes in C_.\n*\n* This implementation subsequently shuffles the output of a linear congruential pseudorandom number generator (LCG) using a shuffle table in accordance with the Bays-Durham algorithm.\n*\n* ## Notes\n*\n* - The generator has a period of approximately \\\\(2.1\\mbox{e}9\\\\) (see [Numerical Recipes in C, 2nd Edition](#references), p. 279).\n*\n* ## References\n*\n* - Bays, Carter, and S. D. Durham. 1976. \"Improving a Poor Random Number Generator.\" _ACM Transactions on Mathematical Software_ 2 (1). New York, NY, USA: ACM: 59\u201364. doi:[10.1145/355666.355670](http://dx.doi.org/10.1145/355666.355670).\n* - Herzog, T.N., and G. Lord. 2002. _Applications of Monte Carlo Methods to Finance and Insurance_. ACTEX Publications. [https://books.google.com/books?id=vC7I\\\\\\_gdX-A0C](https://books.google.com/books?id=vC7I\\_gdX-A0C).\n* - Press, William H., Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. 1992. _Numerical Recipes in C: The Art of Scientific Computing, Second Edition_. Cambridge University Press.\n*\n* @function minstd\n* @type {PRNG}\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = minstd();\n* // returns \n*/\nvar minstd = factory({\n\t'seed': randint32()\n});\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* A linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @module @stdlib/random/base/minstd-shuffle\n*\n* @example\n* var minstd = require( '@stdlib/random/base/minstd-shuffle' );\n*\n* var v = minstd();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/minstd-shuffle' ).factory;\n*\n* var minstd = factory({\n* 'seed': 1234\n* });\n*\n* var v = minstd();\n* // returns 1421600654\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"idtype\": \"float64\",\n \"ndtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar fdtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar rdtypes = require( '@stdlib/array/typed-real-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar RDTYPES = rdtypes();\nvar FDTYPES = fdtypes();\nRDTYPES.push( 'generic' );\nFDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* ## Notes\n*\n* - Validation modes:\n*\n* - `0`: factory validation\n* - `1`: integer PRNG validation\n* - `2`: normalized PRNG validation\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @param {string} [options.idtype] - output array data type when generating integers\n* @param {string} [options.rdtype] - output array data type when generating normalized numbers\n* @param {integer} mode - validation mode\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options, 0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options, mode ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( mode === 0 ) {\n\t\tif ( hasOwnProp( options, 'idtype' ) ) {\n\t\t\topts.idtype = options.idtype;\n\t\t\tif ( RDTYPES.indexOf( opts.idtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'idtype', RDTYPES.join( '\", \"' ), opts.idtype ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'ndtype' ) ) {\n\t\t\topts.ndtype = options.ndtype;\n\t\t\tif ( FDTYPES.indexOf( opts.ndtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'ndtype', FDTYPES.join( '\", \"' ), opts.ndtype ) );\n\t\t\t}\n\t\t}\n\t} else if ( mode === 1 && hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( RDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', RDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t} else if ( hasOwnProp( options, 'dtype' ) ) { // mode === 2\n\t\topts.dtype = options.dtype;\n\t\tif ( FDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', FDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar base = require( './../../../base/minstd-shuffle' );\nvar ctors = require( '@stdlib/array/typed-real-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.idtype=\"float64\"] - default data type when generating integers\n* @param {string} [options.ndtype=\"float64\"] - default data type when generating normalized numbers\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd.normalized( 10 );\n* // returns \n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'idtype': defaults.idtype,\n\t\t'ndtype': defaults.ndtype\n\t};\n\n\tnargs = arguments.length;\n\trand = minstd;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options, 0 );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\tsetReadOnly( rand, 'PRNG', prng );\n\tsetReadOnly( rand, 'normalized', normalized );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom integers on the interval `[1, 2147483646]`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction minstd( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 1 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.idtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers on the interval `[0, 1)`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction normalized( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 2 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.ndtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng.normalized );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng.normalized );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {Int32Array} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {Int32Array} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {Int32Array} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @name minstd\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var arr = minstd.normalized( 10 );\n* // returns \n*\n* @example\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar minstd = factory();\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @module @stdlib/random/array/minstd-shuffle\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var arr = minstd.normalized( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var arr = minstd.normalized( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var rand = minstd.factory();\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var rand = minstd.factory();\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"normalized\": \"main.normalized\" }\n", "{\n\t\"idtype\": \"float64\",\n \"ndtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar fdtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar rdtypes = require( '@stdlib/array/typed-real-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar RDTYPES = rdtypes();\nvar FDTYPES = fdtypes();\nRDTYPES.push( 'generic' );\nFDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* ## Notes\n*\n* - Validation modes:\n*\n* - `0`: factory validation\n* - `1`: integer PRNG validation\n* - `2`: normalized PRNG validation\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @param {string} [options.idtype] - output array data type when generating integers\n* @param {string} [options.rdtype] - output array data type when generating normalized numbers\n* @param {integer} mode - validation mode\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options, 0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options, mode ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( mode === 0 ) {\n\t\tif ( hasOwnProp( options, 'idtype' ) ) {\n\t\t\topts.idtype = options.idtype;\n\t\t\tif ( RDTYPES.indexOf( opts.idtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'idtype', RDTYPES.join( '\", \"' ), opts.idtype ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'ndtype' ) ) {\n\t\t\topts.ndtype = options.ndtype;\n\t\t\tif ( FDTYPES.indexOf( opts.ndtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'ndtype', FDTYPES.join( '\", \"' ), opts.ndtype ) );\n\t\t\t}\n\t\t}\n\t} else if ( mode === 1 && hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( RDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', RDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t} else if ( hasOwnProp( options, 'dtype' ) ) { // mode === 2\n\t\topts.dtype = options.dtype;\n\t\tif ( FDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', FDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar base = require( './../../../base/mt19937' );\nvar ctors = require( '@stdlib/array/typed-real-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers generated using a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @param {Options} [options] - function options\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.idtype=\"float64\"] - default data type when generating integers\n* @param {string} [options.ndtype=\"float64\"] - default data type when generating normalized numbers\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var mt19937 = factory();\n* // returns \n*\n* var arr = mt19937( 10 );\n* // returns \n*\n* @example\n* var mt19937 = factory();\n* // returns \n*\n* var arr = mt19937( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var mt19937 = factory();\n* // returns \n*\n* var arr = mt19937.normalized( 10 );\n* // returns \n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'idtype': defaults.idtype,\n\t\t'ndtype': defaults.ndtype\n\t};\n\n\tnargs = arguments.length;\n\trand = mt19937;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options, 0 );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\tsetReadOnly( rand, 'PRNG', prng );\n\tsetReadOnly( rand, 'normalized', normalized );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom integers on the interval `[0, 4294967295]`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction mt19937( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 1 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.idtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers on the interval `[0, 1)` with 53-bit precision.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction normalized( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 2 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.ndtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng.normalized );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng.normalized );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {Uint32Array} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {Uint32Array} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {Uint32Array} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom integers on the interval `[0, 4294967295]`.\n*\n* @name mt19937\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = mt19937( 10 );\n* // returns \n*\n* @example\n* var arr = mt19937.normalized( 10 );\n* // returns \n*\n* @example\n* var arr = mt19937( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar mt19937 = factory();\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers generated using a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @module @stdlib/random/array/mt19937\n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var arr = mt19937( 10 );\n* // returns \n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var arr = mt19937( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var arr = mt19937.normalized( 10 );\n* // returns \n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var arr = mt19937.normalized( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var rand = mt19937.factory();\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var rand = mt19937.factory();\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"normalized\": \"main.normalized\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar exp = require( '@stdlib/math/base/special/exp' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Poisson distribution.\n*\n* ## Notes\n*\n* - Appropriate for \\\\(lambda < 30\\\\).\n*\n* ## References\n*\n* - Knuth, Donald E. 1997. _The Art of Computer Programming, Volume 2 (3rd Ed.): Seminumerical Algorithms_. Boston, MA, USA: Addison-Wesley Longman Publishing Co., Inc.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveNumber} lambda - mean\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction poisson( rand, lambda ) {\n\tvar p = rand();\n\tvar k = 1;\n\twhile ( p > exp( -lambda ) ) {\n\t\tk += 1;\n\t\tp *= rand();\n\t}\n\treturn k - 1;\n}\n\n\n// EXPORTS //\n\nmodule.exports = poisson;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factorialln = require( '@stdlib/math/base/special/factorialln' );\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar sign = require( '@stdlib/math/base/special/signum' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar ln = require( '@stdlib/math/base/special/ln' );\nvar LN_SQRT_TWO_PI = require( '@stdlib/constants/float64/ln-sqrt-two-pi' );\n\n\n// VARIABLES //\n\nvar ONE_12 = 1.0 / 12.0;\nvar ONE_360 = 1.0 / 360.0;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Poisson distribution with parameter `lambda`.\n*\n* ## References\n*\n* - H\u00F6rmann, W. 1993. \"The transformed rejection method for generating Poisson random variables.\" _Insurance: Mathematics and Economics_ 12 (1): 39\u201345. doi:[10.1016/0167-6687(93)90997-4][@hormann:1993b].\n*\n* [@hormann:1993b]: http://dx.doi.org/10.1016/0167-6687(93)90997-4\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveNumber} lambda - mean\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction poisson( rand, lambda ) {\n\tvar slambda;\n\tvar ainv;\n\tvar urvr;\n\tvar us;\n\tvar vr;\n\tvar a;\n\tvar b;\n\tvar k;\n\tvar u;\n\tvar v;\n\n\tslambda = sqrt( lambda );\n\n\tb = (2.53*slambda) + 0.931;\n\ta = (0.02483*b) - 0.059;\n\n\tainv = (1.1328/(b-3.4)) + 1.1239;\n\tvr = (-3.6224/(b-2.0)) + 0.9277;\n\turvr = 0.86 * vr;\n\n\twhile ( true ) {\n\t\tv = rand();\n\t\tif ( v <= urvr ) {\n\t\t\tu = (v / vr) - 0.43;\n\t\t\tu *= (2.0*a / (0.5-abs(u))) + b;\n\t\t\tu += lambda + 0.445;\n\t\t\treturn floor( u );\n\t\t}\n\t\tif ( v >= vr ) {\n\t\t\tu = rand() - 0.5;\n\t\t} else {\n\t\t\tu = (v / vr) - 0.93;\n\t\t\tu = (sign( u )*0.5) - u;\n\t\t\tv = vr * rand();\n\t\t}\n\t\tus = 0.5 - abs( u );\n\t\tif (\n\t\t\tus >= 0.013 ||\n\t\t\tus >= v\n\t\t) {\n\t\t\tk = floor( (((2.0*a/us) + b)*u) + lambda + 0.445 );\n\t\t\tv *= ainv / ( (a/(us*us)) + b );\n\t\t\tu = (k+0.5) * ln( lambda/k );\n\t\t\tu += -lambda - LN_SQRT_TWO_PI + k;\n\t\t\tu -= ( ONE_12 - (ONE_360/(k*k)) ) / k;\n\t\t\tif (\n\t\t\t\tk >= 10 &&\n\t\t\t\tu >= ln( v*slambda )\n\t\t\t) {\n\t\t\t\treturn k;\n\t\t\t}\n\t\t\tu = (k*ln( lambda )) - lambda - factorialln( k );\n\t\t\tif (\n\t\t\t\tk >= 0 &&\n\t\t\t\tk <= 9 &&\n\t\t\t\tu >= ln( v )\n\t\t\t) {\n\t\t\t\treturn k;\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = poisson;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar knuth = require( './knuth.js' );\nvar rejection = require( './rejection.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Poisson distribution with parameter `lambda`.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveNumber} lambda - mean\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction poisson( rand, lambda ) {\n\tif ( lambda < 30.0 ) {\n\t\treturn knuth( rand, lambda );\n\t}\n\treturn rejection( rand, lambda );\n}\n\n\n// EXPORTS //\n\nmodule.exports = poisson;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar poisson0 = require( './poisson.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Poisson distributed random numbers.\n*\n* @param {PositiveNumber} [lambda] - mean\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var poisson = factory( 5.0 );\n* var v = poisson();\n* // returns \n*\n* @example\n* var poisson = factory( 8.0, {\n* 'seed': 297\n* });\n* var v = poisson();\n* // returns \n*\n* @example\n* var poisson = factory();\n* var v = poisson( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar lambda;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tlambda = arguments[ 0 ];\n\t\tif ( !isPositive( lambda ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( lambda === void 0 ) {\n\t\tprng = poisson2;\n\t} else {\n\t\tprng = poisson1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'poisson' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( lambda === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ lambda ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Poisson distribution.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = poisson1();\n\t* // returns \n\t*/\n\tfunction poisson1() {\n\t\treturn poisson0( rand, lambda );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Poisson distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} lambda - mean\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = poisson2( 0.5 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = poisson2( NaN );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = poisson2( -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction poisson2( lambda ) {\n\t\tif (\n\t\t\tisnan( lambda ) ||\n\t\t\tlambda <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn poisson0( rand, lambda );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Poisson distribution with parameter `lambda`.\n*\n* ## Method\n*\n* - When \\\\(\\lambda < 30\\\\), use Knuth's method.\n* - When \\\\(lambda \\geq 30\\\\), use transformed rejection method as Knuth's method does not scale well with \\\\(\\lambda\\\\).\n*\n* ## References\n*\n* - Knuth, Donald E. 1997. _The Art of Computer Programming, Volume 2 (3rd Ed.): Seminumerical Algorithms_. Boston, MA, USA: Addison-Wesley Longman Publishing Co., Inc.\n* - H\u00F6rmann, W. 1993. \"The transformed rejection method for generating Poisson random variables.\" _Insurance: Mathematics and Economics_ 12 (1): 39\u201345. doi:[10.1016/0167-6687(93)90997-4][@hormann:1993b].\n*\n* [@hormann:1993b]: http://dx.doi.org/10.1016/0167-6687(93)90997-4\n*\n* @name poisson\n* @type {PRNG}\n* @param {PositiveNumber} lambda - mean\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var v = poisson( 0.5 );\n* // returns \n*\n* @example\n* var v = poisson( 0.0 );\n* // returns NaN\n*\n* @example\n* var v = poisson( NaN );\n* // returns NaN\n*/\nvar poisson = factory();\n\n\n// EXPORTS //\n\nmodule.exports = poisson;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Poisson distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/poisson\n*\n* @example\n* var poisson = require( '@stdlib/random/base/poisson' );\n*\n* var v = poisson( 4.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/poisson' ).factory;\n* var poisson = factory( 4.0, {\n* 'seed': 297\n* });\n*\n* var v = poisson();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/poisson' ).factory;\n* var poisson = factory({\n* 'seed': 297\n* });\n*\n* var v = poisson( 3.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} r - number of successes until experiment is stopped\n* @param {number} p - success probability\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 10, 0.5 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( r, p ) {\n\tif ( !isPositive( r ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', r ) );\n\t}\n\tif ( !isNumber( p ) || isnan( p ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', p ) );\n\t}\n\tif ( p <= 0.0 || p >= 1.0 ) {\n\t\treturn new RangeError( format( 'invalid argument. Second argument must be on the interval: (0, 1). Value: `%f`.', p ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar poisson = require( './../../../base/poisson' ).factory;\nvar gamma = require( './../../../base/gamma' ).factory;\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar assign = require( '@stdlib/object/assign' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating negative binomial distributed random numbers.\n*\n* @param {PositiveNumber} [r] - number of successes until experiment is stopped\n* @param {number} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `r` must be a positive number\n* @throws {TypeError} `p` must be number\n* @throws {RangeError} `p` must be a number on the interval `(0,1)`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var negativeBinomial = factory( 10, 0.5 );\n*\n* var v = negativeBinomial();\n* // returns \n*\n* @example\n* var negativeBinomial = factory( 10, 0.8, {\n* 'seed': 297\n* });\n*\n* var v = negativeBinomial();\n* // returns \n*\n* @example\n* var negativeBinomial = factory();\n*\n* var v = negativeBinomial( 10, 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar rgamma;\n\tvar STATE;\n\tvar rpois;\n\tvar opts;\n\tvar prng;\n\tvar rand;\n\tvar FLG;\n\tvar err;\n\tvar p;\n\tvar r;\n\n\tFLG = true;\n\tif ( arguments.length === 0 ) {\n\t\topts = {\n\t\t\t'copy': false\n\t\t};\n\t\trpois = poisson( opts );\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trpois = poisson({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t\topts = assign( {}, opts );\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tFLG = false;\n\t\t\t} else if ( opts.state ) {\n\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t}\n\t\t\topts.copy = false;\n\t\t\trpois = poisson( opts );\n\t\t}\n\t} else {\n\t\tr = arguments[ 0 ];\n\t\tp = arguments[ 1 ];\n\t\terr = validate( r, p );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trpois = poisson({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t\t}\n\t\t\t\topts = assign( {}, opts );\n\t\t\t\tif ( opts.copy === false ) {\n\t\t\t\t\tFLG = false;\n\t\t\t\t} else if ( opts.state ) {\n\t\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\topts.copy = false;\n\t\t\t\trpois = poisson( opts );\n\t\t\t}\n\t\t} else {\n\t\t\topts = {\n\t\t\t\t'copy': false\n\t\t\t};\n\t\t\trpois = poisson( opts );\n\t\t}\n\t}\n\tif ( opts && opts.prng ) {\n\t\tif ( r === void 0 ) {\n\t\t\trgamma = gamma({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trgamma = gamma( r, p/(1-p), {\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t}\n\t} else {\n\t\tif ( opts.state ) {\n\t\t\tSTATE = opts.state;\n\t\t} else {\n\t\t\tSTATE = rpois.state;\n\t\t\trpois.state = STATE; // updates the underlying PRNG to point to a shared state\n\t\t}\n\t\tif ( r === void 0 ) {\n\t\t\trgamma = gamma({\n\t\t\t\t'state': STATE,\n\t\t\t\t'copy': false\n\t\t\t});\n\t\t} else {\n\t\t\trgamma = gamma( r, p/(1-p), {\n\t\t\t\t'state': STATE,\n\t\t\t\t'copy': false\n\t\t\t});\n\t\t}\n\t}\n\tif ( r === void 0 ) {\n\t\tprng = negativeBinomial2;\n\t} else {\n\t\tprng = negativeBinomial1;\n\t}\n\trand = rpois.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'negative-binomial' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {TypeError} must provide a `Uint32Array`\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\tif ( !isUint32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a Uint32Array. Value: `%s`.', s ) );\n\t\t}\n\t\tif ( FLG ) {\n\t\t\ts = gcopy( s.length, s, 1, new Uint32Array( s.length ), 1 );\n\t\t}\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( r === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ r, p ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a negative binomial distribution with bound parameters `r` and `p`.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = negativeBinomial1();\n\t* // returns \n\t*/\n\tfunction negativeBinomial1() {\n\t\treturn rpois( rgamma() );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a negative binomial distribution with parameters `r` and `p`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} r - number of successes until experiment is stopped\n\t* @param {number} p - success probability\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = negativeBinomial2( 10, 0.5 );\n\t* // returns \n\t*/\n\tfunction negativeBinomial2( r, p ) {\n\t\tif (\n\t\t\tisnan( r ) ||\n\t\t\tisnan( p ) ||\n\t\t\tp <= 0.0 ||\n\t\t\tp >= 1.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn rpois( rgamma( r, p/(1-p) ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a negative binomial distribution.\n*\n* @name negativeBinomial\n* @type {PRNG}\n* @param {PositiveNumber} r - number of successes until experiment is stopped\n* @param {number} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var v = negativeBinomial( 10, 0.5 );\n* // returns \n*/\nvar negativeBinomial = factory();\n\n\n// EXPORTS //\n\nmodule.exports = negativeBinomial;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Negative binomial distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/negative-binomial\n*\n* @example\n* var negativeBinomial = require( '@stdlib/random/base/negative-binomial' );\n*\n* var v = negativeBinomial( 20, 0.5 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/negative-binomial' ).factory;\n* var negativeBinomial = factory( 10, 0.3, {\n* 'seed': 297\n* });\n*\n* var v = negativeBinomial();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/negative-binomial' ).factory;\n* var negativeBinomial = factory({\n* 'seed': 297\n* });\n*\n* var v = negativeBinomial( 10, 0.67 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/negative-binomial' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [r] - number of successes until experiment is stopped\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `r` must be a positive number\n* @throws {TypeError} `p` must be a probability (i.e., a number on the interval [0,1])\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var negativeBinomial = factory( 10, 0.5 );\n* // returns \n*\n* var arr = negativeBinomial( 10 );\n* // returns \n*\n* @example\n* var negativeBinomial = factory( 10, 0.5 );\n* // returns \n*\n* var arr = negativeBinomial( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @name negativeBinomial\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} r - number of successes until experiment is stopped\n* @param {Probability} p - success probability\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = negativeBinomial( 10, 10, 0.5 );\n* // returns \n*\n* @example\n* var arr = negativeBinomial( 10, 10, 0.5, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar negativeBinomial = factory();\n\n\n// EXPORTS //\n\nmodule.exports = negativeBinomial;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @module @stdlib/random/array/negative-binomial\n*\n* @example\n* var negativeBinomial = require( '@stdlib/random/array/negative-binomial' );\n*\n* var arr = negativeBinomial( 10, 10, 0.5 );\n* // returns \n*\n* @example\n* var negativeBinomial = require( '@stdlib/random/array/negative-binomial' );\n*\n* var arr = negativeBinomial( 10, 10, 0.5, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var negativeBinomial = require( '@stdlib/random/array/negative-binomial' );\n*\n* var rand = negativeBinomial.factory( 10, 0.5 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var negativeBinomial = require( '@stdlib/random/array/negative-binomial' );\n*\n* var rand = negativeBinomial.factory( 10, 0.5 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, sigma ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( sigma ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns a pseudorandom number from a normal distribution with parameters `mu` and `sigma`.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @returns {number} pseudorandom number\n*/\nfunction normal( rand, mu, sigma ) {\n\treturn mu + (sigma*rand());\n}\n\n\n// EXPORTS //\n\nmodule.exports = normal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar normal0 = require( './normal.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating normally distributed random numbers.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [sigma] - standard deviation\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var normal = factory( 0.0, 1.0 );\n* var v = normal();\n* // returns \n*\n* @example\n* var normal = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = normal();\n* // returns \n*/\nfunction factory() {\n\tvar sigma;\n\tvar rnorm;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\n\tif ( arguments.length === 0 ) {\n\t\trnorm = randn();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trnorm = randn({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trnorm = randn( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\tsigma = arguments[ 1 ];\n\t\terr = validate( mu, sigma );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trnorm = randn({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trnorm = randn( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trnorm = randn();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = normal2;\n\t} else {\n\t\tprng = normal1;\n\t}\n\trand = rnorm.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'normal' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, sigma ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number from a normal distribution with bound parameters `mu` and `sigma`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = normal1();\n\t* // returns \n\t*/\n\tfunction normal1() {\n\t\treturn normal0( rnorm, mu, sigma );\n\t}\n\n\t/**\n\t* Returns a normally distributed pseudorandom number with mean `mu` and standard deviation `sigma`.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} sigma - standard deviation\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = normal2( 0.0, 1.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = normal2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction normal2( mu, sigma ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( sigma ) ||\n\t\t\tsigma <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn normal0( rnorm, mu, sigma );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a normally distributed pseudorandom number with mean `mu` and standard deviation `sigma`.\n*\n* @name normal\n* @type {PRNG}\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = normal( 0.0, 1.0 );\n* // returns \n*\n* @example\n* var v = normal( 0.0, -1.0 );\n* // returns NaN\n*/\nvar normal = factory();\n\n\n// EXPORTS //\n\nmodule.exports = normal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Normally distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/normal\n*\n* @example\n* var normal = require( '@stdlib/random/base/normal' );\n*\n* var v = normal( 0.0, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/normal' ).factory;\n* var normal = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = normal();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/normal' ).factory;\n* var normal = factory({\n* 'seed': 297\n* });\n*\n* var v = normal( -3.0, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/normal' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a normal distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [sigma] - standard deviation\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var normal = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = normal( 10 );\n* // returns \n*\n* @example\n* var normal = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = normal( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a normal distribution.\n*\n* @name normal\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = normal( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = normal( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar normal = factory();\n\n\n// EXPORTS //\n\nmodule.exports = normal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a normal distribution.\n*\n* @module @stdlib/random/array/normal\n*\n* @example\n* var normal = require( '@stdlib/random/array/normal' );\n*\n* var arr = normal( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var normal = require( '@stdlib/random/array/normal' );\n*\n* var arr = normal( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var normal = require( '@stdlib/random/array/normal' );\n*\n* var rand = normal.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var normal = require( '@stdlib/random/array/normal' );\n*\n* var rand = normal.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, beta ) {\n\tif ( !isPositive( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar pow = require( '@stdlib/math/base/special/pow' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Pareto (Type I) distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*/\nfunction pareto( rand, alpha, beta ) {\n\treturn beta / pow( rand(), 1.0/alpha );\n}\n\n\n// EXPORTS //\n\nmodule.exports = pareto;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar pareto0 = require( './pareto.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Pareto (Type I) distributed random numbers.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var pareto1 = factory( 2.0, 1.0 );\n*\n* var v = pareto1();\n* // returns \n*\n* @example\n* var pareto1 = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = pareto1();\n* // returns \n*/\nfunction factory() {\n\tvar alpha;\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( alpha, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = pareto2;\n\t} else {\n\t\tprng = pareto1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'pareto-type1' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Pareto (Type I) distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = pareto1();\n\t* // returns \n\t*/\n\tfunction pareto1() {\n\t\treturn pareto0( rand, alpha, beta );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Pareto (Type I) distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = pareto2( 2.0, 3.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = pareto2( 3.0, 0.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = pareto2( 0.0, 2.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = pareto2( NaN, NaN );\n\t* // returns NaN\n\t*/\n\tfunction pareto2( alpha, beta ) {\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( beta ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn pareto0( rand, alpha, beta );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Pareto (Type I) distribution.\n*\n* @name pareto1\n* @type {PRNG}\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*\n* @example\n* var v = pareto1( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var v = pareto1( -2.0, 3.0 );\n* // returns NaN\n*/\nvar pareto1 = factory();\n\n\n// EXPORTS //\n\nmodule.exports = pareto1;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Pareto (Type I) distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/pareto-type1\n*\n* @example\n* var pareto1 = require( '@stdlib/random/base/pareto-type1' );\n*\n* var v = pareto1( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/pareto-type1' ).factory;\n* var pareto1 = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = pareto1();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/pareto-type1' ).factory;\n* var pareto1 = factory({\n* 'seed': 297\n* });\n*\n* var v = pareto1( 3.0, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/pareto-type1' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var pareto1 = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = pareto1( 10 );\n* // returns \n*\n* @example\n* var pareto1 = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = pareto1( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @name pareto1\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = pareto1( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = pareto1( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar pareto1 = factory();\n\n\n// EXPORTS //\n\nmodule.exports = pareto1;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @module @stdlib/random/array/pareto-type1\n*\n* @example\n* var pareto1 = require( '@stdlib/random/array/pareto-type1' );\n*\n* var arr = pareto1( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var pareto1 = require( '@stdlib/random/array/pareto-type1' );\n*\n* var arr = pareto1( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var pareto1 = require( '@stdlib/random/array/pareto-type1' );\n*\n* var rand = pareto1.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var pareto1 = require( '@stdlib/random/array/pareto-type1' );\n*\n* var rand = pareto1.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar unaryFactory = require( './../../../array/tools/unary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/poisson' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Poisson distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [lambda] - mean parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var poisson = factory( 2.0 );\n* // returns \n*\n* var arr = poisson( 10 );\n* // returns \n*\n* @example\n* var poisson = factory( 2.0 );\n* // returns \n*\n* var arr = poisson( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = unaryFactory( base, DTYPES, defaults.get( 'dtypes.real' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Poisson distribution.\n*\n* @name poisson\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} lambda - mean parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = poisson( 10, 2.0 );\n* // returns \n*\n* @example\n* var arr = poisson( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar poisson = factory();\n\n\n// EXPORTS //\n\nmodule.exports = poisson;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a Poisson distribution.\n*\n* @module @stdlib/random/array/poisson\n*\n* @example\n* var poisson = require( '@stdlib/random/array/poisson' );\n*\n* var arr = poisson( 10, 2.0 );\n* // returns \n*\n* @example\n* var poisson = require( '@stdlib/random/array/poisson' );\n*\n* var arr = poisson( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var poisson = require( '@stdlib/random/array/poisson' );\n*\n* var rand = poisson.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var poisson = require( '@stdlib/random/array/poisson' );\n*\n* var rand = poisson.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "{\n\t\"name\": \"mt19937\",\n\t\"copy\": true\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar minstd = require( './../../../base/minstd' );\nvar minstdShuffle = require( './../../../base/minstd-shuffle' );\nvar mt19937 = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\nvar prngs = {};\n\nprngs[ 'minstd' ] = minstd;\nprngs[ 'minstd-shuffle' ] = minstdShuffle;\nprngs[ 'mt19937' ] = mt19937;\n\n\n// EXPORTS //\n\nmodule.exports = prngs;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar PRNGS = require( './prngs.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating uniformly distributed random numbers on the interval \\\\( [0,1) \\\\).\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of pseudorandom number generator\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} must provide an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide the name of a supported pseudorandom number generator\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var uniform = factory();\n* var v = uniform();\n* // returns \n*\n* @example\n* var uniform = factory({\n* 'name': 'minstd'\n* });\n* var v = uniform();\n* // returns \n*\n* @example\n* var uniform = factory({\n* 'seed': 12345\n* });\n* var v = uniform();\n* // returns \n*\n* @example\n* var uniform = factory({\n* 'name': 'minstd',\n* 'seed': 12345\n* });\n* var v = uniform();\n* // returns \n*/\nfunction factory( options ) {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\topts = {\n\t\t'name': defaults.name,\n\t\t'copy': defaults.copy\n\t};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'name' ) ) {\n\t\t\topts.name = options.name;\n\t\t}\n\t\tif ( hasOwnProp( options, 'state' ) ) {\n\t\t\topts.state = options.state;\n\t\t\tif ( opts.state === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t} else if ( hasOwnProp( options, 'seed' ) ) {\n\t\t\topts.seed = options.seed;\n\t\t\tif ( opts.seed === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'seed', opts.seed ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t}\n\t}\n\tprng = PRNGS[ opts.name ];\n\tif ( prng === void 0 ) {\n\t\tthrow new Error( format( 'invalid option. Unrecognized/unsupported PRNG. Option: `%s`.', opts.name ) );\n\t}\n\tif ( opts.state === void 0 ) {\n\t\tif ( opts.seed === void 0 ) {\n\t\t\trand = prng.factory();\n\t\t} else {\n\t\t\trand = prng.factory({\n\t\t\t\t'seed': opts.seed\n\t\t\t});\n\t\t}\n\t} else {\n\t\trand = prng.factory({\n\t\t\t'state': opts.state,\n\t\t\t'copy': opts.copy\n\t\t});\n\t}\n\tsetReadOnly( uniform, 'NAME', 'randu' );\n\tsetReadOnlyAccessor( uniform, 'seed', getSeed );\n\tsetReadOnlyAccessor( uniform, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( uniform, 'state', getState, setState );\n\tsetReadOnlyAccessor( uniform, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( uniform, 'byteLength', getStateSize );\n\tsetReadOnly( uniform, 'toJSON', toJSON );\n\tsetReadOnly( uniform, 'PRNG', rand );\n\tsetReadOnly( uniform, 'MIN', rand.normalized.MIN );\n\tsetReadOnly( uniform, 'MAX', rand.normalized.MAX );\n\n\treturn uniform;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = uniform.NAME + '-' + rand.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a uniformly distributed pseudorandom number on the interval \\\\( [0,1) \\\\).\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = uniform();\n\t* // returns \n\t*/\n\tfunction uniform() {\n\t\treturn rand.normalized();\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a uniformly distributed random number on the interval \\\\( [0,1) \\\\).\n*\n* @name randu\n* @type {PRNG}\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = randu();\n* // returns \n*/\nvar randu = factory();\n\n\n// EXPORTS //\n\nmodule.exports = randu;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Uniformly distributed pseudorandom numbers on the interval \\\\( [0,1) \\\\).\n*\n* @module @stdlib/random/base/randu\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n*\n* var v = randu();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/randu' ).factory;\n*\n* var randu = factory({\n* 'name': 'minstd',\n* 'seed': 12345\n* });\n*\n* var v = randu();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"dtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar dtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes();\nDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( DTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', DTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar base = require( './../../../base/randu' );\nvar ctors = require( '@stdlib/array/typed-real-float-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var randu = factory();\n* // returns \n*\n* var arr = randu( 10 );\n* // returns \n*\n* @example\n* var randu = factory();\n* // returns \n*\n* var arr = randu( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'dtype': defaults.dtype\n\t};\n\n\tnargs = arguments.length;\n\trand = randu;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\tsetReadOnly( rand, 'PRNG', prng.PRNG );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a randu distribution.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction randu( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @name randu\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = randu( 10 );\n* // returns \n*\n* @example\n* var arr = randu( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar randu = factory();\n\n\n// EXPORTS //\n\nmodule.exports = randu;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @module @stdlib/random/array/randu\n*\n* @example\n* var randu = require( '@stdlib/random/array/randu' );\n*\n* var arr = randu( 10 );\n* // returns \n*\n* @example\n* var randu = require( '@stdlib/random/array/randu' );\n*\n* var arr = randu( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var randu = require( '@stdlib/random/array/randu' );\n*\n* var rand = randu.factory();\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var randu = require( '@stdlib/random/array/randu' );\n*\n* var rand = randu.factory();\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number from a Rayleigh distribution with scale parameter `sigma`.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveNumber} sigma - scale parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*/\nfunction rayleigh( rand, sigma ) {\n\treturn sigma * sqrt( -2.0*ln( rand() ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = rayleigh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar rayleigh0 = require( './rayleigh.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Rayleigh distributed random numbers.\n*\n* @param {PositiveNumber} [sigma] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var rayleigh = factory( 1.0 );\n*\n* var v = rayleigh();\n* // returns \n*\n* @example\n* var rayleigh = factory( 0.5, {\n* 'seed': 297\n* });\n* var v = rayleigh();\n* // returns \n*\n* @example\n* var rayleigh = factory();\n* var v = rayleigh( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar sigma;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tsigma = arguments[ 0 ];\n\t\tif ( !isPositive( sigma ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', sigma ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( sigma === void 0 ) {\n\t\tprng = rayleigh2;\n\t} else {\n\t\tprng = rayleigh1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'rayleigh' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( sigma === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ sigma ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number from a Rayleigh distribution with bound scale parameter `sigma`.\n\t*\n\t* @private\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = rayleigh1();\n\t* // returns \n\t*/\n\tfunction rayleigh1() {\n\t\treturn rayleigh0( rand, sigma );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number from a Rayleigh distribution with scale parameter `sigma`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} sigma - scale parameter\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = rayleigh2( 3.0 );\n\t* // returns \n\t*/\n\tfunction rayleigh2( sigma ) {\n\t\tif (\n\t\t\tisnan( sigma ) ||\n\t\t\tsigma <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn rayleigh0( rand, sigma );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Rayleigh distribution with scale parameter `sigma`.\n*\n* @name rayleigh\n* @type {Function}\n* @param {PositiveNumber} sigma - scale parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*\n* @example\n* var v = rayleigh( 3.0 );\n* // returns \n*\n* @example\n* var v = rayleigh( 0.0 );\n* // returns NaN\n*\n* @example\n* var v = rayleigh( NaN );\n* // returns NaN\n*/\nvar rayleigh = factory();\n\n\n// EXPORTS //\n\nmodule.exports = rayleigh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Rayleigh distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/rayleigh\n*\n* @example\n* var rayleigh = require( '@stdlib/random/base/rayleigh' );\n*\n* var v = rayleigh( 2.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/rayleigh' ).factory;\n* var rayleigh = factory( 3.0, {\n* 'seed': 297\n* });\n*\n* var v = rayleigh();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/rayleigh' ).factory;\n* var rayleigh = factory({\n* 'seed': 297\n* });\n*\n* var v = rayleigh( 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar unaryFactory = require( './../../../array/tools/unary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/rayleigh' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [sigma] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var rayleigh = factory( 2.0 );\n* // returns \n*\n* var arr = rayleigh( 10 );\n* // returns \n*\n* @example\n* var rayleigh = factory( 2.0 );\n* // returns \n*\n* var arr = rayleigh( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = unaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @name rayleigh\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = rayleigh( 10, 2.0 );\n* // returns \n*\n* @example\n* var arr = rayleigh( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar rayleigh = factory();\n\n\n// EXPORTS //\n\nmodule.exports = rayleigh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @module @stdlib/random/array/rayleigh\n*\n* @example\n* var rayleigh = require( '@stdlib/random/array/rayleigh' );\n*\n* var arr = rayleigh( 10, 2.0 );\n* // returns \n*\n* @example\n* var rayleigh = require( '@stdlib/random/array/rayleigh' );\n*\n* var arr = rayleigh( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var rayleigh = require( '@stdlib/random/array/rayleigh' );\n*\n* var rand = rayleigh.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var rayleigh = require( '@stdlib/random/array/rayleigh' );\n*\n* var rand = rayleigh.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar chisquare = require( './../../../base/chisquare' ).factory;\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar assign = require( '@stdlib/object/assign' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating t-distributed random numbers.\n*\n* @param {PositiveNumber} [v] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `v` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var t = factory( 1.0 );\n*\n* var v = t();\n* // returns \n*\n* @example\n* var t = factory( 0.5, {\n* 'seed': 297\n* });\n* var v = t();\n* // returns \n*\n* @example\n* var t = factory();\n* var v = t( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar rchisq;\n\tvar STATE;\n\tvar rnorm;\n\tvar rand;\n\tvar opts;\n\tvar prng;\n\tvar FLG;\n\tvar v;\n\n\tFLG = true;\n\tif ( arguments.length === 0 ) {\n\t\topts = {\n\t\t\t'copy': false\n\t\t};\n\t\trnorm = randn( opts );\n\t} else if ( arguments.length === 1 ) {\n\t\tif ( isObject( arguments[ 0 ] ) ) {\n\t\t\topts = arguments[ 0 ];\n\t\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trnorm = randn({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t\t}\n\t\t\t\topts = assign( {}, opts );\n\t\t\t\tif ( opts.copy === false ) {\n\t\t\t\t\tFLG = false;\n\t\t\t\t} else if ( opts.state ) {\n\t\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\topts.copy = false;\n\t\t\t\trnorm = randn( opts );\n\t\t\t}\n\t\t} else {\n\t\t\tv = arguments[ 0 ];\n\t\t\tif ( !isPositive( v ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number or an options object. Value: `%s`.', v ) );\n\t\t\t}\n\t\t\topts = {\n\t\t\t\t'copy': false\n\t\t\t};\n\t\t\trnorm = randn( opts );\n\t\t}\n\t} else {\n\t\tv = arguments[ 0 ];\n\t\tif ( !isPositive( v ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', v ) );\n\t\t}\n\t\topts = arguments[ 1 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trnorm = randn({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t\topts = assign( {}, opts );\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tFLG = false;\n\t\t\t} else if ( opts.state ) {\n\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t}\n\t\t\topts.copy = false;\n\t\t\trnorm = randn( opts );\n\t\t}\n\t}\n\tif ( opts && opts.prng ) {\n\t\tif ( v === void 0 ) {\n\t\t\trchisq = chisquare({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trchisq = chisquare( v, {\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t}\n\t} else {\n\t\tif ( opts.state ) {\n\t\t\tSTATE = opts.state;\n\t\t} else {\n\t\t\tSTATE = rnorm.state;\n\t\t\trnorm.state = STATE; // updates the underlying PRNG to point to a shared state\n\t\t}\n\t\tif ( v === void 0 ) {\n\t\t\trchisq = chisquare({\n\t\t\t\t'state': STATE,\n\t\t\t\t'copy': false\n\t\t\t});\n\t\t} else {\n\t\t\trchisq = chisquare( v, {\n\t\t\t\t'state': STATE,\n\t\t\t\t'copy': false\n\t\t\t});\n\t\t}\n\t}\n\tif ( v === void 0 ) {\n\t\tprng = t2;\n\t} else {\n\t\tprng = t1;\n\t}\n\trand = rnorm.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 't' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {TypeError} must provide a `Uint32Array`\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\tif ( !isUint32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a Uint32Array. Value: `%s`.', s ) );\n\t\t}\n\t\tif ( FLG ) {\n\t\t\ts = gcopy( s.length, s, 1, new Uint32Array( s.length ), 1 );\n\t\t}\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( v === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ v ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Student's t-distribution with bound degrees of freedom `v`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = t1();\n\t* // returns \n\t*/\n\tfunction t1() {\n\t\treturn rnorm() / sqrt( rchisq() / v );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Student's t-distribution with degrees of freedom `v`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} v - degrees of freedom\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = t2( 3.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = t2( 0.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = t2( -1.5 );\n\t* // returns NaN\n\t*/\n\tfunction t2( v ) {\n\t\tif (\n\t\t\tisnan( v ) ||\n\t\t\tv <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn rnorm() / sqrt( rchisq( v ) / v );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Student's t-distribution with degrees of freedom `v`.\n*\n* @name t\n* @type {PRNG}\n* @param {PositiveNumber} v - degrees of freedom\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = t( 3.0 );\n* // returns \n*\n* @example\n* var v = t( 0.0 );\n* // returns NaN\n*\n* @example\n* var v = t( NaN );\n* // returns NaN\n*/\nvar t = factory();\n\n\n// EXPORTS //\n\nmodule.exports = t;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Student's t-distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/t\n*\n* @example\n* var t = require( '@stdlib/random/base/t' );\n*\n* var v = t( 2.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/t' ).factory;\n* var t = factory( 3.0, {\n* 'seed': 297\n* });\n*\n* var v = t();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/t' ).factory;\n* var t = factory({\n* 'seed': 297\n* });\n*\n* var v = t( 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar unaryFactory = require( './../../../array/tools/unary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/t' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Student's t-distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [v] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `v` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var t = factory( 2.0 );\n* // returns \n*\n* var arr = t( 10 );\n* // returns \n*\n* @example\n* var t = factory( 2.0 );\n* // returns \n*\n* var arr = t( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = unaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Student's t-distribution.\n*\n* @name t\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} v - degrees of freedom\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = t( 10, 2.0 );\n* // returns \n*\n* @example\n* var arr = t( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar t = factory();\n\n\n// EXPORTS //\n\nmodule.exports = t;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a Student's t-distribution.\n*\n* @module @stdlib/random/array/t\n*\n* @example\n* var t = require( '@stdlib/random/array/t' );\n*\n* var arr = t( 10, 2.0 );\n* // returns \n*\n* @example\n* var t = require( '@stdlib/random/array/t' );\n*\n* var arr = t( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var t = require( '@stdlib/random/array/t' );\n*\n* var rand = t.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var t = require( '@stdlib/random/array/t' );\n*\n* var rand = t.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0, 1.3 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( a, b, c ) {\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( !isNumber( c ) || isnan( c ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Third argument must be a number and not NaN. Value: `%s`.', c ) );\n\t}\n\tif ( !(a <= c && c <= b) ) {\n\t\treturn new RangeError( format( 'invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.', 'a <= c <= b', a, b, c ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a triangular distribution with minimum support `a`, maximum support `b` and mode `c`.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @returns {number} pseudorandom number\n*/\nfunction triangular( rand, a, b, c ) {\n\tvar fc;\n\tvar x;\n\tvar u;\n\tfc = (c - a) / (b - a);\n\tu = rand();\n\tif ( u < fc ) {\n\t\tx = (b - a) * (c - a);\n\t\treturn a + sqrt( x * u );\n\t}\n\tx = (b - a) * (b - c);\n\treturn b - sqrt( x * (1.0 - u) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = triangular;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar triangular0 = require( './triangular.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers drawn from a triangular distribution.\n*\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {number} [c] - mode\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {TypeError} `c` must be a number\n* @throws {RangeError} arguments must satisfy `a <= c <= b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var triangular = factory( 0.0, 1.0, 0.8 );\n*\n* var v = triangular();\n* // returns \n*\n* @example\n* var triangular = factory( -3.0, -1.0, -2.0, {\n* 'seed': 297\n* });\n* var v = triangular();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar a;\n\tvar b;\n\tvar c;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\ta = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\tc = arguments[ 2 ];\n\t\terr = validate( a, b, c );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 3 ) {\n\t\t\topts = arguments[ 3 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( a === void 0 ) {\n\t\tprng = triangular2;\n\t} else {\n\t\tprng = triangular1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'triangular' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( a === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ a, b, c ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a triangular distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = triangular1();\n\t* // returns \n\t*/\n\tfunction triangular1() {\n\t\treturn triangular0( rand, a, b, c );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a triangular distribution with minimum support `a`, maximum support `b`, and mode `c`.\n\t*\n\t* @private\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @param {number} c - mode\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = triangular2( 0.0, 1.0, 0.5 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = triangular2( 1.0, 0.0, 0.5 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = triangular2( 1.0, 2.0, NaN );\n\t* // returns NaN\n\t*/\n\tfunction triangular2( a, b, c ) {\n\t\tif (\n\t\t\tisnan( a ) ||\n\t\t\tisnan( b ) ||\n\t\t\tisnan( c ) ||\n\t\t\t!(a <= c && c <= b)\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn triangular0( rand, a, b, c );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a triangular distribution with minimum support `a`, maximum support `b`, and mode `c`.\n*\n* @name triangular\n* @type {PRNG}\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = triangular( 0.0, 1.0, 0.5 );\n* // returns \n*/\nvar triangular = factory();\n\n\n// EXPORTS //\n\nmodule.exports = triangular;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Triangular distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/triangular\n*\n* @example\n* var triangular = require( '@stdlib/random/base/triangular' );\n*\n* var v = triangular( 0.0, 10.0, 7.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/triangular' ).factory;\n* var triangular = factory( -5.0, 5.0, 3.0, {\n* 'seed': 297\n* });\n*\n* var v = triangular();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/triangular' ).factory;\n* var triangular = factory({\n* 'seed': 297\n* });\n*\n* var v = triangular( -5.0, 5.0, 3.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar ternaryFactory = require( './../../../array/tools/ternary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/triangular' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a triangular distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {number} [c] - mode\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {TypeError} `c` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var triangular = factory( 2.0, 5.0, 3.0 );\n* // returns \n*\n* var arr = triangular( 10 );\n* // returns \n*\n* @example\n* var triangular = factory( 2.0, 5.0, 3.0 );\n* // returns \n*\n* var arr = triangular( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = ternaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a triangular distribution.\n*\n* @name triangular\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = triangular( 10, 2.0, 5.0, 3.0 );\n* // returns \n*\n* @example\n* var arr = triangular( 10, 2.0, 5.0, 3.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar triangular = factory();\n\n\n// EXPORTS //\n\nmodule.exports = triangular;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a triangular distribution.\n*\n* @module @stdlib/random/array/triangular\n*\n* @example\n* var triangular = require( '@stdlib/random/array/triangular' );\n*\n* var arr = triangular( 10, 2.0, 5.0, 3.0 );\n* // returns \n*\n* @example\n* var triangular = require( '@stdlib/random/array/triangular' );\n*\n* var arr = triangular( 10, 2.0, 5.0, 3.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var triangular = require( '@stdlib/random/array/triangular' );\n*\n* var rand = triangular.factory( 2.0, 5.0, 3.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var triangular = require( '@stdlib/random/array/triangular' );\n*\n* var rand = triangular.factory( 2.0, 5.0, 3.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates values provided for minimum and maximum support.\n*\n* @private\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( a, b ) {\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\treturn new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns a uniformly distributed pseudorandom number with minimum support `a` and maximum support `b`.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator\n* @param {number} a - minimum support (inclusive)\n* @param {number} b - maximum support (exclusive)\n* @returns {number} pseudorandom number\n*/\nfunction uniform( rand, a, b ) {\n\tvar r = rand();\n\treturn ( b*r ) + ( (1.0-r)*a ); // equivalent to (b-a)*r + a\n}\n\n\n// EXPORTS //\n\nmodule.exports = uniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar uniform0 = require( './uniform.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating uniformly distributed random numbers.\n*\n* @param {number} [a] - minimum support (inclusive)\n* @param {number} [b] - maximum support (exclusive)\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var uniform = factory( 0.0, 1.0 );\n*\n* var v = uniform();\n* // returns \n*\n* @example\n* var uniform = factory( -3.0, -1.0, {\n* 'seed': 297\n* });\n* var v = uniform();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar a;\n\tvar b;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\ta = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\terr = validate( a, b );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( a === void 0 ) {\n\t\tprng = uniform2;\n\t} else {\n\t\tprng = uniform1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'uniform' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( a === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ a, b ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a uniformly distributed pseudorandom number with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = uniform1();\n\t* // returns \n\t*/\n\tfunction uniform1() {\n\t\treturn uniform0( rand, a, b );\n\t}\n\n\t/**\n\t* Returns a uniformly distributed pseudorandom number with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @param {number} a - minimum support (inclusive)\n\t* @param {number} b - maximum support (exclusive)\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = uniform2( 0.0, 1.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = uniform2( 1.0, 0.0 );\n\t* // returns NaN\n\t*/\n\tfunction uniform2( a, b ) {\n\t\tif (\n\t\t\tisnan( a ) ||\n\t\t\tisnan( b ) ||\n\t\t\ta >= b\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn uniform0( rand, a, b );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a uniformly distributed pseudorandom number with minimum support `a` and maximum support `b`.\n*\n* @name uniform\n* @type {PRNG}\n* @param {number} a - minimum support (inclusive)\n* @param {number} b - maximum support (exclusive)\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = uniform( 0.0, 1.0 );\n* // returns \n*/\nvar uniform = factory();\n\n\n// EXPORTS //\n\nmodule.exports = uniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Uniform distribution pseudorandom numbers.\n*\n* @module @stdlib/random/base/uniform\n*\n* @example\n* var uniform = require( '@stdlib/random/base/uniform' );\n*\n* var v = uniform( 0.0, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/uniform' ).factory;\n* var uniform = factory( -5.0, 5.0, {\n* 'seed': 297\n* });\n*\n* var v = uniform();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/uniform' ).factory;\n* var uniform = factory({\n* 'seed': 297\n* });\n*\n* var v = uniform( -5.0, 5.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/uniform' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var uniform = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = uniform( 10 );\n* // returns \n*\n* @example\n* var uniform = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = uniform( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @name uniform\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = uniform( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = uniform( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar uniform = factory();\n\n\n// EXPORTS //\n\nmodule.exports = uniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @module @stdlib/random/array/uniform\n*\n* @example\n* var uniform = require( '@stdlib/random/array/uniform' );\n*\n* var arr = uniform( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var uniform = require( '@stdlib/random/array/uniform' );\n*\n* var arr = uniform( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var uniform = require( '@stdlib/random/array/uniform' );\n*\n* var rand = uniform.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var uniform = require( '@stdlib/random/array/uniform' );\n*\n* var rand = uniform.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( k, lambda ) {\n\tif ( !isPositive( k ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Scale parameter must be a positive number. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositive( lambda ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Shape parameter must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar pow = require( '@stdlib/math/base/special/pow' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Weibull distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*/\nfunction weibull( rand, k, lambda ) {\n\treturn lambda * pow( -ln( 1.0-rand() ), 1.0/k );\n}\n\n\n// EXPORTS //\n\nmodule.exports = weibull;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar weibull0 = require( './weibull.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Weibull distributed random numbers.\n*\n* @param {PositiveNumber} [k] - scale parameter\n* @param {PositiveNumber} [lambda] - shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var weibull = factory( 2.0, 1.0 );\n*\n* var v = weibull();\n* // returns \n*\n* @example\n* var weibull = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = weibull();\n* // returns \n*/\nfunction factory() {\n\tvar lambda;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar k;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tk = arguments[ 0 ];\n\t\tlambda = arguments[ 1 ];\n\t\terr = validate( lambda, k );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( lambda === void 0 ) {\n\t\tprng = weibull2;\n\t} else {\n\t\tprng = weibull1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'weibull' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( k === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ k, lambda ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Weibull distribution.\n\t*\n\t* @private\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = weibull1();\n\t* // returns \n\t*/\n\tfunction weibull1() {\n\t\treturn weibull0( rand, k, lambda );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Weibull distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - scale parameter\n\t* @param {PositiveNumber} lambda - shape parameter\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = weibull2( 2.0, 1.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = weibull2( 3.0, 0.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = weibull2( 0.0, 2.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = weibull2( NaN, NaN );\n\t* // returns NaN\n\t*/\n\tfunction weibull2( k, lambda ) {\n\t\tif (\n\t\t\tisnan( k ) ||\n\t\t\tisnan( lambda ) ||\n\t\t\tk <= 0.0 ||\n\t\t\tlambda <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn weibull0( rand, k, lambda );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Weibull distribution.\n*\n* @name weibull\n* @type {PRNG}\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*\n* @example\n* var v = weibull( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var v = weibull( -2.0, 3.0 );\n* // returns NaN\n*/\nvar weibull = factory();\n\n\n// EXPORTS //\n\nmodule.exports = weibull;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Weibull distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/weibull\n*\n* @example\n* var weibull = require( '@stdlib/random/base/weibull' );\n*\n* var v = weibull( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/weibull' ).factory;\n* var weibull = factory( 2.0, 3.0, {\n* 'seed': 297\n* });\n*\n* var v = weibull();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/weibull' ).factory;\n* var weibull = factory({\n* 'seed': 297\n* });\n*\n* var v = weibull( 2.0, 3.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/weibull' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Weibull distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [k] - scale parameter\n* @param {PositiveNumber} [lambda] - shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var weibull = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = weibull( 10 );\n* // returns \n*\n* @example\n* var weibull = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = weibull( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Weibull distribution.\n*\n* @name weibull\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = weibull( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = weibull( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar weibull = factory();\n\n\n// EXPORTS //\n\nmodule.exports = weibull;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an array containing pseudorandom numbers drawn from a Weibull distribution.\n*\n* @module @stdlib/random/array/weibull\n*\n* @example\n* var weibull = require( '@stdlib/random/array/weibull' );\n*\n* var arr = weibull( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var weibull = require( '@stdlib/random/array/weibull' );\n*\n* var arr = weibull( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var weibull = require( '@stdlib/random/array/weibull' );\n*\n* var rand = weibull.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var weibull = require( '@stdlib/random/array/weibull' );\n*\n* var rand = weibull.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name arcsine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/arcsine}\n*/\nsetReadOnly( ns, 'arcsine', require( './../../array/arcsine' ) );\n\n/**\n* @name bernoulli\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/bernoulli}\n*/\nsetReadOnly( ns, 'bernoulli', require( './../../array/bernoulli' ) );\n\n/**\n* @name beta\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/beta}\n*/\nsetReadOnly( ns, 'beta', require( './../../array/beta' ) );\n\n/**\n* @name betaprime\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/betaprime}\n*/\nsetReadOnly( ns, 'betaprime', require( './../../array/betaprime' ) );\n\n/**\n* @name binomial\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/binomial}\n*/\nsetReadOnly( ns, 'binomial', require( './../../array/binomial' ) );\n\n/**\n* @name cauchy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/cauchy}\n*/\nsetReadOnly( ns, 'cauchy', require( './../../array/cauchy' ) );\n\n/**\n* @name chi\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/chi}\n*/\nsetReadOnly( ns, 'chi', require( './../../array/chi' ) );\n\n/**\n* @name chisquare\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/chisquare}\n*/\nsetReadOnly( ns, 'chisquare', require( './../../array/chisquare' ) );\n\n/**\n* @name cosine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/cosine}\n*/\nsetReadOnly( ns, 'cosine', require( './../../array/cosine' ) );\n\n/**\n* @name discreteUniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/discrete-uniform}\n*/\nsetReadOnly( ns, 'discreteUniform', require( './../../array/discrete-uniform' ) );\n\n/**\n* @name erlang\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/erlang}\n*/\nsetReadOnly( ns, 'erlang', require( './../../array/erlang' ) );\n\n/**\n* @name exponential\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/exponential}\n*/\nsetReadOnly( ns, 'exponential', require( './../../array/exponential' ) );\n\n/**\n* @name f\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/f}\n*/\nsetReadOnly( ns, 'f', require( './../../array/f' ) );\n\n/**\n* @name frechet\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/frechet}\n*/\nsetReadOnly( ns, 'frechet', require( './../../array/frechet' ) );\n\n/**\n* @name gamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/gamma}\n*/\nsetReadOnly( ns, 'gamma', require( './../../array/gamma' ) );\n\n/**\n* @name geometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/geometric}\n*/\nsetReadOnly( ns, 'geometric', require( './../../array/geometric' ) );\n\n/**\n* @name gumbel\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/gumbel}\n*/\nsetReadOnly( ns, 'gumbel', require( './../../array/gumbel' ) );\n\n/**\n* @name hypergeometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/hypergeometric}\n*/\nsetReadOnly( ns, 'hypergeometric', require( './../../array/hypergeometric' ) );\n\n/**\n* @name invgamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/invgamma}\n*/\nsetReadOnly( ns, 'invgamma', require( './../../array/invgamma' ) );\n\n/**\n* @name kumaraswamy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/kumaraswamy}\n*/\nsetReadOnly( ns, 'kumaraswamy', require( './../../array/kumaraswamy' ) );\n\n/**\n* @name laplace\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/laplace}\n*/\nsetReadOnly( ns, 'laplace', require( './../../array/laplace' ) );\n\n/**\n* @name levy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/levy}\n*/\nsetReadOnly( ns, 'levy', require( './../../array/levy' ) );\n\n/**\n* @name logistic\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/logistic}\n*/\nsetReadOnly( ns, 'logistic', require( './../../array/logistic' ) );\n\n/**\n* @name lognormal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/lognormal}\n*/\nsetReadOnly( ns, 'lognormal', require( './../../array/lognormal' ) );\n\n/**\n* @name minstd\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/minstd}\n*/\nsetReadOnly( ns, 'minstd', require( './../../array/minstd' ) );\n\n/**\n* @name minstdShuffle\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/minstd-shuffle}\n*/\nsetReadOnly( ns, 'minstdShuffle', require( './../../array/minstd-shuffle' ) );\n\n/**\n* @name mt19937\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/mt19937}\n*/\nsetReadOnly( ns, 'mt19937', require( './../../array/mt19937' ) );\n\n/**\n* @name negativeBinomial\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/negative-binomial}\n*/\nsetReadOnly( ns, 'negativeBinomial', require( './../../array/negative-binomial' ) );\n\n/**\n* @name normal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/normal}\n*/\nsetReadOnly( ns, 'normal', require( './../../array/normal' ) );\n\n/**\n* @name pareto1\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/pareto-type1}\n*/\nsetReadOnly( ns, 'pareto1', require( './../../array/pareto-type1' ) );\n\n/**\n* @name poisson\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/poisson}\n*/\nsetReadOnly( ns, 'poisson', require( './../../array/poisson' ) );\n\n/**\n* @name randu\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/randu}\n*/\nsetReadOnly( ns, 'randu', require( './../../array/randu' ) );\n\n/**\n* @name rayleigh\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/rayleigh}\n*/\nsetReadOnly( ns, 'rayleigh', require( './../../array/rayleigh' ) );\n\n/**\n* @name t\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/t}\n*/\nsetReadOnly( ns, 't', require( './../../array/t' ) );\n\n/**\n* @name triangular\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/triangular}\n*/\nsetReadOnly( ns, 'triangular', require( './../../array/triangular' ) );\n\n/**\n* @name uniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/uniform}\n*/\nsetReadOnly( ns, 'uniform', require( './../../array/uniform' ) );\n\n/**\n* @name weibull\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/weibull}\n*/\nsetReadOnly( ns, 'weibull', require( './../../array/weibull' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar ln = require( '@stdlib/math/base/special/ln' );\nvar sin = require( '@stdlib/math/base/special/sin' );\nvar cos = require( '@stdlib/math/base/special/cos' );\nvar TWO_PI = require( '@stdlib/constants/float64/two-pi' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating standard normally distributed pseudorandom numbers using the Box-Muller algorithm.\n*\n* @private\n* @param {PRNG} rand - PRNG which returns standard uniformly distributed numbers\n* @returns {PRNG} PRNG\n*/\nfunction wrap( rand ) {\n\tvar flg;\n\tvar r;\n\n\t// Flag indicating whether to generate new normal random variates or return a cached normal random variate:\n\tflg = true;\n\n\treturn randn;\n\n\t/**\n\t* Generates a standard normally distributed pseudorandom number.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var r = randn();\n\t* // returns \n\t*/\n\tfunction randn() {\n\t\tvar u1;\n\t\tvar u2;\n\t\tvar a;\n\t\tvar b;\n\t\tif ( flg ) {\n\t\t\t// Note: if `u1` is `0`, the natural log blows up, so we keep trying until we get a non-zero rand. Rarely should we need more than one iteration.\n\t\t\tdo {\n\t\t\t\tu1 = rand();\n\t\t\t\tu2 = rand();\n\t\t\t} while (\n\t\t\t\tu1 === 0.0\n\t\t\t);\n\t\t\ta = sqrt( -2.0 * ln(u1) );\n\t\t\tb = TWO_PI * u2;\n\t\t\tr = a * cos( b ); // cache for next call\n\t\t\tflg = false;\n\t\t\treturn a * sin( b );\n\t\t}\n\t\tflg = true;\n\t\treturn r;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = wrap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar ln = require( '@stdlib/math/base/special/ln' );\nvar cos = require( '@stdlib/math/base/special/cos' );\nvar PI = require( '@stdlib/constants/float64/pi' );\n\n\n// VARIABLES //\n\nvar COS_PI = cos( PI ); // -1\n\n\n// MAIN //\n\n/**\n* Returns the minimum possible normally distributed pseudorandom number.\n*\n* @private\n* @param {number} min - minimum possible uniformly distributed pseudorandom number\n* @returns {number} minimum possible number\n*/\nfunction getMin( min ) {\n\tvar a = sqrt( -2.0 * ln( min ) );\n\treturn a * COS_PI;\n}\n\n\n// EXPORTS //\n\nmodule.exports = getMin;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar ln = require( '@stdlib/math/base/special/ln' );\nvar cos = require( '@stdlib/math/base/special/cos' );\nvar TWO_PI = require( '@stdlib/constants/float64/two-pi' );\n\n\n// MAIN //\n\n/**\n* Returns the maximum possible normally distributed pseudorandom number.\n*\n* @private\n* @param {number} min - minimum possible uniformly distributed pseudorandom number\n* @returns {number} maximum possible number\n*/\nfunction getMax( min ) {\n\tvar a = sqrt( -2.0 * ln( min ) );\n\tvar b = TWO_PI * min;\n\treturn a * cos( b );\n}\n\n\n// EXPORTS //\n\nmodule.exports = getMax;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar mt19937 = require( './../../../base/mt19937' ).factory;\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar randn0 = require( './randn.js' );\nvar getMin = require( './min.js' );\nvar getMax = require( './max.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator which implements the Box-Muller transform to generate standard normally distributed pseudorandom numbers.\n*\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} must provide an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var randn = factory();\n*\n* var r = randn();\n* // returns \n*\n* @example\n* // Return a seeded PRNG:\n* var randn = factory({\n* 'seed': 12345\n* });\n*\n* var r = randn();\n* // returns \n*/\nfunction factory( options ) {\n\tvar randu;\n\tvar randn;\n\tvar rand;\n\tvar opts;\n\n\topts = {\n\t\t'copy': true\n\t};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( options.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', options.copy ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\t\tif ( !isFunction( options.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', options.prng ) );\n\t\t\t}\n\t\t\trandu = options.prng;\n\t\t}\n\t\t// If provided a PRNG, ignore the `state` option, as we don't support getting or setting PRNG state.\n\t\telse if ( hasOwnProp( options, 'state' ) ) {\n\t\t\topts.state = options.state;\n\t\t\tif ( !isUint32Array( options.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', options.state ) );\n\t\t\t}\n\t\t}\n\t\t// If provided a PRNG, ignore the `seed` option, as a `seed`, by itself, is insufficient to guarantee reproducibility. If provided a state, ignore the `seed` option, as a PRNG state should contain seed information.\n\t\telse if ( hasOwnProp( options, 'seed' ) ) {\n\t\t\topts.seed = options.seed;\n\t\t\tif ( options.seed === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%s`.', 'seed', options.seed ) );\n\t\t\t}\n\t\t}\n\t}\n\tif ( opts.state === void 0 ) {\n\t\tif ( randu === void 0 ) {\n\t\t\trand = mt19937( opts );\n\t\t\trandu = rand.normalized;\n\t\t} else {\n\t\t\topts.seed = null;\n\t\t}\n\t} else {\n\t\trand = mt19937( opts );\n\t\trandu = rand.normalized;\n\t}\n\trandn = randn0( randu );\n\n\tsetReadOnly( randn, 'NAME', 'box-muller' );\n\tif ( opts.seed === null ) {\n\t\tsetReadOnly( randn, 'seed', null );\n\t\tsetReadOnly( randn, 'seedLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( randn, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( randn, 'seedLength', getSeedLength );\n\t}\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( options && options.prng ) {\n\t\tsetReadWriteAccessor( randn, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( randn, 'stateLength', null );\n\t\tsetReadOnly( randn, 'byteLength', null );\n\t\tsetReadOnly( randn, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadWriteAccessor( randn, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( randn, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( randn, 'byteLength', getStateSize );\n\t\tsetReadOnly( randn, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( randn, 'PRNG', randu );\n\n\tif ( hasOwnProp( randu, 'MIN' ) ) {\n\t\tsetReadOnly( randn, 'MIN', getMin( randu.MIN ) );\n\t\tsetReadOnly( randn, 'MAX', getMax( randu.MIN ) );\n\t} else {\n\t\tsetReadOnly( randn, 'MIN', null );\n\t\tsetReadOnly( randn, 'MAX', null );\n\t}\n\n\treturn randn;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = randn.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Generates a standard normally distributed random number.\n*\n* ## Method\n*\n* - Given two independent uniformly distributed random variables \\\\( U_1 \\\\) and \\\\( U_2 \\\\) in the interval \\\\( [0,1) \\\\), let\n*\n* ``` tex\n* \\begin{align*}\n* Z_1 &= R \\cos(\\theta) = \\sqrt{-2 \\ln(U_1)} \\cos(2\\pi U_2) \\\\\n* Z_2 &= R \\sin(\\theta) = \\sqrt{-2 \\ln(U_1)} \\sin(2\\pi U_2)\n* \\end{align*}\n* ```\n*\n* where \\\\( Z_1 \\\\) and \\\\( Z_2 \\\\) are independent random variables with a standard normal distribution.\n*\n* - As two uniform random variates are mapped to two standard normal random variates, one of the random variates is cached and returned upon the following invocation.\n*\n* ## Notes\n*\n* - The minimum and maximum pseudorandom numbers which can be generated are dependent on the number of bits an underlying uniform pseudorandom number generator (PRNG) uses. For instance, if a PRNG uses \\\\( 32 \\\\) bits, the smallest non-zero number that can be generated is \\\\( 2^{-32}). When \\\\( U_1 \\\\) equals this value and \\\\( U_2 \\\\) equals \\\\( 0 \\\\),\n*\n* ``` tex\n* r = \\sqrt{-2\\ln(2^{-32})} \\cos(2\\pi) \\approx 6.66\n* ```\n*\n* which means that the algorithm cannot produce random variates more than \\\\( 6.66 \\\\) standard deviations from the mean.\n*\n* \n*\n* This corresponds to a \\\\( 2.74 \\times 10^{-11} \\\\) loss due to tail truncation.\n*\n* \n*\n* ## References\n*\n* - Box, G. E. P., and Mervin E. Muller. 1958. \"A Note on the Generation of Random Normal Deviates.\" _The Annals of Mathematical Statistics_ 29 (2). The Institute of Mathematical Statistics: 610\u201311. doi:[10.1214/aoms/1177706645](http://dx.doi.org/10.1214/aoms/1177706645).\n* - Bell, James R. 1968. \"Algorithm 334: Normal Random Deviates.\" _Communications of the ACM_ 11 (7). New York, NY, USA: ACM: 498. doi:[10.1145/363397.363547](http://dx.doi.org/10.1145/363397.363547).\n* - Knop, R. 1969. \"Remark on Algorithm 334 \\[G5]: Normal Random Deviates.\" _Communications of the ACM_ 12 (5). New York, NY, USA: ACM: 281. doi:[10.1145/362946.362996](http://dx.doi.org/10.1145/362946.362996).\n* - Marsaglia, G., and T. A. Bray. 1964. \"A Convenient Method for Generating Normal Variables.\" _SIAM Review_ 6 (3). Society for Industrial; Applied Mathematics: 260\u201364. doi:[10.1137/1006063](http://dx.doi.org/10.1137/1006063).\n* - Thomas, David B., Wayne Luk, Philip H.W. Leong, and John D. Villasenor. 2007. \"Gaussian Random Number Generators.\" _ACM Computing Surveys_ 39 (4). New York, NY, USA: ACM. doi:[10.1145/1287620.1287622](http://dx.doi.org/10.1145/1287620.1287622).\n*\n* @name randn\n* @type {PRNG}\n* @returns {number} pseudorandom number\n*\n* @example\n* var r = randn();\n* // returns \n*/\nvar randn = factory();\n\n\n// EXPORTS //\n\nmodule.exports = randn;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Normally distributed pseudorandom numbers using the Box-Muller transform.\n*\n* @module @stdlib/random/base/box-muller\n*\n* @example\n* var randn = require( '@stdlib/random/base/box-muller' );\n*\n* var r = randn();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/box-muller' ).factory;\n*\n* var randn = factory({\n* 'seed': 12345\n* });\n*\n* var r = randn();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"name\": \"mt19937\",\n\t\"copy\": true\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar minstd = require( './../../../base/minstd' );\nvar minstdShuffle = require( './../../../base/minstd-shuffle' );\nvar mt19937 = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\nvar prngs = {};\n\nprngs[ 'minstd' ] = minstd;\nprngs[ 'minstd-shuffle' ] = minstdShuffle;\nprngs[ 'mt19937' ] = mt19937;\n\n\n// EXPORTS //\n\nmodule.exports = prngs;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar PRNGS = require( './prngs.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers having integer values.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of pseudorandom number generator\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} must provide an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide the name of a supported pseudorandom number generator\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var randi = factory();\n* var v = randi();\n* // returns \n*\n* @example\n* var randi = factory({\n* 'name': 'minstd'\n* });\n* var v = randi();\n* // returns \n*\n* @example\n* var randi = factory({\n* 'seed': 12345\n* });\n* var v = randi();\n* // returns \n*\n* @example\n* var randi = factory({\n* 'name': 'minstd',\n* 'seed': 12345\n* });\n* var v = randi();\n* // returns \n*/\nfunction factory( options ) {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\topts = {\n\t\t'name': defaults.name,\n\t\t'copy': defaults.copy\n\t};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'name' ) ) {\n\t\t\topts.name = options.name;\n\t\t}\n\t\tif ( hasOwnProp( options, 'state' ) ) {\n\t\t\topts.state = options.state;\n\t\t\tif ( opts.state === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t} else if ( hasOwnProp( options, 'seed' ) ) {\n\t\t\topts.seed = options.seed;\n\t\t\tif ( opts.seed === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'seed', opts.seed ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t}\n\t}\n\tprng = PRNGS[ opts.name ];\n\tif ( prng === void 0 ) {\n\t\tthrow new Error( format( 'invalid option. Unrecognized/unsupported PRNG. Option: `%s`.', opts.name ) );\n\t}\n\tif ( opts.state === void 0 ) {\n\t\tif ( opts.seed === void 0 ) {\n\t\t\trand = prng.factory();\n\t\t} else {\n\t\t\trand = prng.factory({\n\t\t\t\t'seed': opts.seed\n\t\t\t});\n\t\t}\n\t} else {\n\t\trand = prng.factory({\n\t\t\t'state': opts.state,\n\t\t\t'copy': opts.copy\n\t\t});\n\t}\n\tsetReadOnly( randi, 'NAME', 'randi' );\n\tsetReadOnlyAccessor( randi, 'seed', getSeed );\n\tsetReadOnlyAccessor( randi, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( randi, 'state', getState, setState );\n\tsetReadOnlyAccessor( randi, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( randi, 'byteLength', getStateSize );\n\tsetReadOnly( randi, 'toJSON', toJSON );\n\tsetReadOnly( randi, 'PRNG', rand );\n\tsetReadOnly( randi, 'MIN', rand.MIN );\n\tsetReadOnly( randi, 'MAX', rand.MAX );\n\n\treturn randi;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = randi.NAME + '-' + rand.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number having an integer value.\n\t*\n\t* @private\n\t* @returns {integer} pseudorandom number\n\t*\n\t* @example\n\t* var v = randi();\n\t* // returns \n\t*/\n\tfunction randi() {\n\t\treturn rand();\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number having an integer value.\n*\n* @name randi\n* @type {PRNG}\n* @returns {integer} pseudorandom number\n*\n* @example\n* var v = randi();\n* // returns \n*/\nvar randi = factory();\n\n\n// EXPORTS //\n\nmodule.exports = randi;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Pseudorandom numbers having integer values.\n*\n* @module @stdlib/random/base/randi\n*\n* @example\n* var randi = require( '@stdlib/random/base/randi' );\n*\n* var v = randi();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/randi' ).factory;\n*\n* var randi = factory({\n* 'name': 'minstd',\n* 'seed': 12345\n* });\n*\n* var v = randi();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"name\": \"improved-ziggurat\",\n\t\"copy\": true\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar boxMuller = require( './../../../base/box-muller' );\nvar improvedZiggurat = require( './../../../base/improved-ziggurat' );\n\n\n// MAIN //\n\nvar prngs = {};\n\nprngs[ 'box-muller' ] = boxMuller;\nprngs[ 'improved-ziggurat' ] = improvedZiggurat;\n\n\n// EXPORTS //\n\nmodule.exports = prngs;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar format = require( '@stdlib/string/format' );\nvar noop = require( '@stdlib/utils/noop' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar defaults = require( './defaults.json' );\nvar PRNGS = require( './prngs.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for numbers from a standard normal distribution.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='improved-ziggurat'] - name of pseudorandom number generator\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} must provide an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide the name of a supported pseudorandom number generator\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var randn = factory();\n*\n* var v = randn();\n* // returns \n*\n* @example\n* var randn = factory({\n* 'name': 'box-muller'\n* });\n* var v = randn();\n* // returns \n*\n* @example\n* var randn = factory({\n* 'seed': 12345\n* });\n* var v = randn();\n* // returns \n*\n* @example\n* var randn = factory({\n* 'name': 'box-muller',\n* 'seed': 12345\n* });\n* var v = randn();\n* // returns \n*/\nfunction factory( options ) {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\topts = {\n\t\t'name': defaults.name,\n\t\t'copy': defaults.copy\n\t};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'name' ) ) {\n\t\t\topts.name = options.name;\n\t\t}\n\t\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\t\topts.prng = options.prng;\n\t\t\tif ( opts.prng === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t} else if ( hasOwnProp( options, 'state' ) ) {\n\t\t\topts.state = options.state;\n\t\t\tif ( opts.state === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t} else if ( hasOwnProp( options, 'seed' ) ) {\n\t\t\topts.seed = options.seed;\n\t\t\tif ( opts.seed === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'seed', opts.seed ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t}\n\t}\n\tprng = PRNGS[ opts.name ];\n\tif ( prng === void 0 ) {\n\t\tthrow new Error( format( 'invalid option. Unrecognized/unsupported PRNG. Option: `%s`.', opts.name ) );\n\t}\n\tif ( opts.prng === void 0 ) {\n\t\tif ( opts.state === void 0 ) {\n\t\t\tif ( opts.seed === void 0 ) {\n\t\t\t\trand = prng.factory();\n\t\t\t} else {\n\t\t\t\trand = prng.factory({\n\t\t\t\t\t'seed': opts.seed\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\trand = prng.factory({\n\t\t\t\t'state': opts.state,\n\t\t\t\t'copy': opts.copy\n\t\t\t});\n\t\t}\n\t} else {\n\t\trand = prng.factory({\n\t\t\t'prng': opts.prng\n\t\t});\n\t}\n\tsetReadOnly( normal, 'NAME', 'randn' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts.prng ) {\n\t\tsetReadOnly( normal, 'seed', null );\n\t\tsetReadOnly( normal, 'seedLength', null );\n\t\tsetReadWriteAccessor( normal, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( normal, 'stateLength', null );\n\t\tsetReadOnly( normal, 'byteLength', null );\n\t\tsetReadOnly( normal, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( normal, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( normal, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( normal, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( normal, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( normal, 'byteLength', getStateSize );\n\t\tsetReadOnly( normal, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( normal, 'PRNG', rand.PRNG );\n\treturn normal;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = normal.NAME + '-' + rand.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a standard normal distribution.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = normal();\n\t* // returns \n\t*/\n\tfunction normal() {\n\t\treturn rand();\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a standard normal random number.\n*\n* @name normal\n* @type {PRNG}\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = normal();\n* // returns \n*/\nvar normal = factory();\n\n\n// EXPORTS //\n\nmodule.exports = normal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Standard normal pseudorandom numbers.\n*\n* @module @stdlib/random/base/randn\n*\n* @example\n* var randn = require( '@stdlib/random/base/randn' );\n*\n* var v = randn();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/randn' ).factory;\n*\n* var randn = factory({\n* 'name': 'box-muller',\n* 'seed': 12345\n* });\n*\n* var v = randn();\n* // returns \n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n// This file is generated using `scripts/build.js`.\n\n'use strict';\n\n// MODULES //\n\nvar prng0 = require( './../../../base/arcsine' );\nvar prng1 = require( './../../../base/bernoulli' );\nvar prng2 = require( './../../../base/beta' );\nvar prng3 = require( './../../../base/betaprime' );\nvar prng4 = require( './../../../base/binomial' );\nvar prng5 = require( './../../../base/box-muller' );\nvar prng6 = require( './../../../base/cauchy' );\nvar prng7 = require( './../../../base/chi' );\nvar prng8 = require( './../../../base/chisquare' );\nvar prng9 = require( './../../../base/cosine' );\nvar prng10 = require( './../../../base/discrete-uniform' );\nvar prng11 = require( './../../../base/erlang' );\nvar prng12 = require( './../../../base/exponential' );\nvar prng13 = require( './../../../base/f' );\nvar prng14 = require( './../../../base/frechet' );\nvar prng15 = require( './../../../base/gamma' );\nvar prng16 = require( './../../../base/geometric' );\nvar prng17 = require( './../../../base/gumbel' );\nvar prng18 = require( './../../../base/hypergeometric' );\nvar prng19 = require( './../../../base/improved-ziggurat' );\nvar prng20 = require( './../../../base/invgamma' );\nvar prng21 = require( './../../../base/kumaraswamy' );\nvar prng22 = require( './../../../base/laplace' );\nvar prng23 = require( './../../../base/levy' );\nvar prng24 = require( './../../../base/logistic' );\nvar prng25 = require( './../../../base/lognormal' );\nvar prng26 = require( './../../../base/minstd' );\nvar prng27 = require( './../../../base/minstd-shuffle' );\nvar prng28 = require( './../../../base/mt19937' );\nvar prng29 = require( './../../../base/negative-binomial' );\nvar prng30 = require( './../../../base/normal' );\nvar prng31 = require( './../../../base/pareto-type1' );\nvar prng32 = require( './../../../base/poisson' );\nvar prng33 = require( './../../../base/randi' );\nvar prng34 = require( './../../../base/randn' );\nvar prng35 = require( './../../../base/randu' );\nvar prng36 = require( './../../../base/rayleigh' );\nvar prng37 = require( './../../../base/t' );\nvar prng38 = require( './../../../base/triangular' );\nvar prng39 = require( './../../../base/uniform' );\nvar prng40 = require( './../../../base/weibull' );\n\n\n// MAIN //\n\nvar prngs = {};\nprngs[ 'arcsine' ] = prng0.factory;\nprngs[ 'bernoulli' ] = prng1.factory;\nprngs[ 'beta' ] = prng2.factory;\nprngs[ 'betaprime' ] = prng3.factory;\nprngs[ 'binomial' ] = prng4.factory;\nprngs[ 'box-muller' ] = prng5.factory;\nprngs[ 'cauchy' ] = prng6.factory;\nprngs[ 'chi' ] = prng7.factory;\nprngs[ 'chisquare' ] = prng8.factory;\nprngs[ 'cosine' ] = prng9.factory;\nprngs[ 'discrete-uniform' ] = prng10.factory;\nprngs[ 'erlang' ] = prng11.factory;\nprngs[ 'exponential' ] = prng12.factory;\nprngs[ 'f' ] = prng13.factory;\nprngs[ 'frechet' ] = prng14.factory;\nprngs[ 'gamma' ] = prng15.factory;\nprngs[ 'geometric' ] = prng16.factory;\nprngs[ 'gumbel' ] = prng17.factory;\nprngs[ 'hypergeometric' ] = prng18.factory;\nprngs[ 'improved-ziggurat' ] = prng19.factory;\nprngs[ 'invgamma' ] = prng20.factory;\nprngs[ 'kumaraswamy' ] = prng21.factory;\nprngs[ 'laplace' ] = prng22.factory;\nprngs[ 'levy' ] = prng23.factory;\nprngs[ 'logistic' ] = prng24.factory;\nprngs[ 'lognormal' ] = prng25.factory;\nprngs[ 'minstd' ] = prng26.factory;\nprngs[ 'minstd-shuffle' ] = prng27.factory;\nprngs[ 'mt19937' ] = prng28.factory;\nprngs[ 'negative-binomial' ] = prng29.factory;\nprngs[ 'normal' ] = prng30.factory;\nprngs[ 'pareto-type1' ] = prng31.factory;\nprngs[ 'poisson' ] = prng32.factory;\nprngs[ 'randi' ] = prng33.factory;\nprngs[ 'randn' ] = prng34.factory;\nprngs[ 'randu' ] = prng35.factory;\nprngs[ 'rayleigh' ] = prng36.factory;\nprngs[ 't' ] = prng37.factory;\nprngs[ 'triangular' ] = prng38.factory;\nprngs[ 'uniform' ] = prng39.factory;\nprngs[ 'weibull' ] = prng40.factory;\n\n\n// EXPORTS //\n\nmodule.exports = prngs;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isArray = require( '@stdlib/assert/is-array' );\nvar contains = require( '@stdlib/assert/contains' );\nvar Int32Array = require( '@stdlib/array/int32' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar table = require( './prngs.js' );\n\n\n// VARIABLES //\n\nvar TYPED_ARRAY_CTORS = {\n\t'Int32Array': Int32Array,\n\t'Uint32Array': Uint32Array\n};\nvar PRNG_WRAPPERS = [ 'randi', 'randn', 'randu' ];\n\n\n// MAIN //\n\n/**\n* Revives a JSON-serialized pseudorandom number generator.\n*\n* @param {string} key - key\n* @param {*} value - value\n* @returns {(*|Function)} value or PRNG\n*\n* @example\n* var parseJSON = require( '@stdlib/utils/parse-json' );\n* var mt19937 = require( '@stdlib/random/base/mt19937' );\n*\n* var str = JSON.stringify( mt19937 );\n* var rand = parseJSON( str, reviveBasePRNG );\n* // returns \n*/\nfunction reviveBasePRNG( key, value ) {\n\tvar factory;\n\tvar opts;\n\tvar args;\n\tvar ctor;\n\tvar tmp;\n\tif (\n\t\tvalue &&\n\t\tvalue.type === 'PRNG' &&\n\t\tisString( value.name ) &&\n\t\tisObject( value.state ) &&\n\t\tisArray( value.params ) &&\n\t\tisString( value.state.type ) &&\n\t\tisArray( value.state.data )\n\t) {\n\t\topts = {};\n\t\tfactory = table[ value.name ];\n\t\tif ( factory === void 0 ) {\n\t\t\ttmp = value.name.split( '-' );\n\t\t\tif ( contains( PRNG_WRAPPERS, tmp[ 0 ] ) ) {\n\t\t\t\tfactory = table[ tmp[ 0 ] ];\n\t\t\t\topts.name = tmp.slice( 1 ).join( '-' );\n\t\t\t}\n\t\t}\n\t\tif ( factory ) {\n\t\t\tctor = TYPED_ARRAY_CTORS[ value.state.type ];\n\t\t\tif ( ctor ) {\n\t\t\t\topts.state = new ctor( value.state.data );\n\n\t\t\t\targs = value.params.slice();\n\t\t\t\targs.push( opts );\n\n\t\t\t\ttry {\n\t\t\t\t\treturn factory.apply( null, args );\n\t\t\t\t} catch ( error ) { // eslint-disable-line no-unused-vars\n\t\t\t\t\t// Return the original JSON value...\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n}\n\n\n// EXPORTS //\n\nmodule.exports = reviveBasePRNG;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Revive a JSON-serialized pseudorandom generator.\n*\n* @module @stdlib/random/base/reviver\n*\n* @example\n* var parseJSON = require( '@stdlib/utils/parse-json' );\n* var mt19937 = require( '@stdlib/random/base/mt19937' );\n* var reviveBasePRNG = require( '@stdlib/random/base/reviver' );\n*\n* var str = JSON.stringify( mt19937 );\n* var rand = parseJSON( str, reviveBasePRNG );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace random\n*/\nvar random = {};\n\n/**\n* @name arcsine\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/arcsine}\n*/\nsetReadOnly( random, 'arcsine', require( './../../base/arcsine' ) );\n\n/**\n* @name bernoulli\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/bernoulli}\n*/\nsetReadOnly( random, 'bernoulli', require( './../../base/bernoulli' ) );\n\n/**\n* @name beta\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/beta}\n*/\nsetReadOnly( random, 'beta', require( './../../base/beta' ) );\n\n/**\n* @name betaprime\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/betaprime}\n*/\nsetReadOnly( random, 'betaprime', require( './../../base/betaprime' ) );\n\n/**\n* @name binomial\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/binomial}\n*/\nsetReadOnly( random, 'binomial', require( './../../base/binomial' ) );\n\n/**\n* @name boxMuller\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/box-muller}\n*/\nsetReadOnly( random, 'boxMuller', require( './../../base/box-muller' ) );\n\n/**\n* @name cauchy\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/cauchy}\n*/\nsetReadOnly( random, 'cauchy', require( './../../base/cauchy' ) );\n\n/**\n* @name chi\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/chi}\n*/\nsetReadOnly( random, 'chi', require( './../../base/chi' ) );\n\n/**\n* @name chisquare\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/chisquare}\n*/\nsetReadOnly( random, 'chisquare', require( './../../base/chisquare' ) );\n\n/**\n* @name cosine\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/cosine}\n*/\nsetReadOnly( random, 'cosine', require( './../../base/cosine' ) );\n\n/**\n* @name discreteUniform\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/discrete-uniform}\n*/\nsetReadOnly( random, 'discreteUniform', require( './../../base/discrete-uniform' ) );\n\n/**\n* @name erlang\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/erlang}\n*/\nsetReadOnly( random, 'erlang', require( './../../base/erlang' ) );\n\n/**\n* @name exponential\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/exponential}\n*/\nsetReadOnly( random, 'exponential', require( './../../base/exponential' ) );\n\n/**\n* @name f\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/f}\n*/\nsetReadOnly( random, 'f', require( './../../base/f' ) );\n\n/**\n* @name frechet\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/frechet}\n*/\nsetReadOnly( random, 'frechet', require( './../../base/frechet' ) );\n\n/**\n* @name gamma\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/gamma}\n*/\nsetReadOnly( random, 'gamma', require( './../../base/gamma' ) );\n\n/**\n* @name geometric\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/geometric}\n*/\nsetReadOnly( random, 'geometric', require( './../../base/geometric' ) );\n\n/**\n* @name gumbel\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/gumbel}\n*/\nsetReadOnly( random, 'gumbel', require( './../../base/gumbel' ) );\n\n/**\n* @name hypergeometric\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/hypergeometric}\n*/\n\nsetReadOnly( random, 'hypergeometric', require( './../../base/hypergeometric' ) );\n\n/**\n* @name improvedZiggurat\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/improved-ziggurat}\n*/\nsetReadOnly( random, 'improvedZiggurat', require( './../../base/improved-ziggurat' ) );\n\n/**\n* @name invgamma\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/invgamma}\n*/\nsetReadOnly( random, 'invgamma', require( './../../base/invgamma' ) );\n\n/**\n* @name kumaraswamy\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/kumaraswamy}\n*/\nsetReadOnly( random, 'kumaraswamy', require( './../../base/kumaraswamy' ) );\n\n/**\n* @name laplace\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/laplace}\n*/\nsetReadOnly( random, 'laplace', require( './../../base/laplace' ) );\n\n/**\n* @name levy\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/levy}\n*/\nsetReadOnly( random, 'levy', require( './../../base/levy' ) );\n\n/**\n* @name logistic\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/logistic}\n*/\nsetReadOnly( random, 'logistic', require( './../../base/logistic' ) );\n\n/**\n* @name lognormal\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/lognormal}\n*/\nsetReadOnly( random, 'lognormal', require( './../../base/lognormal' ) );\n\n/**\n* @name minstd\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/minstd}\n*/\nsetReadOnly( random, 'minstd', require( './../../base/minstd' ) );\n\n/**\n* @name minstdShuffle\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/minstd-shuffle}\n*/\nsetReadOnly( random, 'minstdShuffle', require( './../../base/minstd-shuffle' ) );\n\n/**\n* @name mt19937\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/mt19937}\n*/\nsetReadOnly( random, 'mt19937', require( './../../base/mt19937' ) );\n\n/**\n* @name negativeBinomial\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/negative-binomial}\n*/\nsetReadOnly( random, 'negativeBinomial', require( './../../base/negative-binomial' ) );\n\n/**\n* @name normal\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/normal}\n*/\nsetReadOnly( random, 'normal', require( './../../base/normal' ) );\n\n/**\n* @name pareto1\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/pareto-type1}\n*/\nsetReadOnly( random, 'pareto1', require( './../../base/pareto-type1' ) );\n\n/**\n* @name poisson\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/poisson}\n*/\nsetReadOnly( random, 'poisson', require( './../../base/poisson' ) );\n\n/**\n* @name randi\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/randi}\n*/\nsetReadOnly( random, 'randi', require( './../../base/randi' ) );\n\n/**\n* @name randn\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/randn}\n*/\nsetReadOnly( random, 'randn', require( './../../base/randn' ) );\n\n/**\n* @name randu\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/randu}\n*/\nsetReadOnly( random, 'randu', require( './../../base/randu' ) );\n\n/**\n* @name rayleigh\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/rayleigh}\n*/\nsetReadOnly( random, 'rayleigh', require( './../../base/rayleigh' ) );\n\n/**\n* @name reviveBasePRNG\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/reviver}\n*/\nsetReadOnly( random, 'reviveBasePRNG', require( './../../base/reviver' ) );\n\n/**\n* @name t\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/t}\n*/\nsetReadOnly( random, 't', require( './../../base/t' ) );\n\n/**\n* @name triangular\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/triangular}\n*/\nsetReadOnly( random, 'triangular', require( './../../base/triangular' ) );\n\n/**\n* @name uniform\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/uniform}\n*/\nsetReadOnly( random, 'uniform', require( './../../base/uniform' ) );\n\n/**\n* @name weibull\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/weibull}\n*/\nsetReadOnly( random, 'weibull', require( './../../base/weibull' ) );\n\n\n// EXPORTS //\n\nmodule.exports = random;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rarcsine = require( './../../../base/arcsine' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from an arcsine distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( a, b, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rarcsine( a, b, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rarcsine( a, b );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( a, b, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from an arcsine distribution.\n*\n* @module @stdlib/random/iter/arcsine\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/arcsine' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rbern = require( './../../../base/bernoulli' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @param {Probability} p - success probability\n* @param {Options} [options] - function options\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( p, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rbern( p, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rbern( p );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( p, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @module @stdlib/random/iter/bernoulli\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/bernoulli' );\n*\n* var iter = iterator( 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rbeta = require( './../../../base/beta' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a beta distribution.\n*\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rbeta( alpha, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rbeta( alpha, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a beta distribution.\n*\n* @module @stdlib/random/iter/beta\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/beta' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rbetaprime = require( './../../../base/betaprime' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a beta prime distribution.\n*\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rbetaprime( alpha, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rbetaprime( alpha, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a beta prime distribution.\n*\n* @module @stdlib/random/iter/betaprime\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/betaprime' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rbinom = require( './../../../base/binomial' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a binomial distribution.\n*\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive integer\n* @throws {TypeError} second argument must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 8, 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( n, p, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveInteger( n ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', n ) );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a probability. Value: `%s`.', p ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rbinom( n, p, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rbinom( n, p );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( n, p, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a binomial distribution.\n*\n* @module @stdlib/random/iter/binomial\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/binomial' );\n*\n* var iter = iterator( 10, 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rnorm = require( './../../../base/box-muller' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rnorm( opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rnorm();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @module @stdlib/random/iter/box-muller\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/box-muller' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rcauchy = require( './../../../base/cauchy' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `x0` must be a number\n* @throws {TypeError} `gamma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( x0, gamma, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( x0 ) || isnan( x0 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', x0 ) );\n\t}\n\tif ( !isPositive( gamma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', gamma ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rcauchy( x0, gamma, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rcauchy( x0, gamma );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( x0, gamma, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @module @stdlib/random/iter/cauchy\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/cauchy' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rchi = require( './../../../base/chi' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a chi distribution.\n*\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( k, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rchi( k, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rchi( k );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( k, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a chi distribution.\n*\n* @module @stdlib/random/iter/chi\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/chi' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rchisq = require( './../../../base/chisquare' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a chi-square distribution.\n*\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( k, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rchisq( k, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rchisq( k );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( k, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a chi-square distribution.\n*\n* @module @stdlib/random/iter/chisquare\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/chisquare' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rcosine = require( './../../../base/cosine' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @param {number} mu - location parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, s, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rcosine( mu, s, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rcosine( mu, s );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, s, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @module @stdlib/random/iter/cosine\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/cosine' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isInteger = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar runif = require( './../../../base/discrete-uniform' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `a` must be an integer\n* @throws {TypeError} `b` must be an integer\n* @throws {RangeError} `a` must be less than or equal to `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2, 6 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( a, b, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isInteger( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', a ) );\n\t}\n\tif ( !isInteger( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', b ) );\n\t}\n\tif ( a > b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d,%d]`.', a, b ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = runif( a, b, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = runif( a, b );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( a, b, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @module @stdlib/random/iter/discrete-uniform\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/discrete-uniform' );\n*\n* var iter = iterator( -1, 2 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rerlang = require( './../../../base/erlang' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from an Erlang distribution.\n*\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `k` must be a positive integer\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( k, lambda, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveInteger( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rerlang( k, lambda, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rerlang( k, lambda );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( k, lambda, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from an Erlang distribution.\n*\n* @module @stdlib/random/iter/erlang\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/erlang' );\n*\n* var iter = iterator( 2, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rexp = require( './../../../base/exponential' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from an exponential distribution.\n*\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( lambda, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rexp( lambda, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rexp( lambda );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( lambda, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from an exponential distribution.\n*\n* @module @stdlib/random/iter/exponential\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/exponential' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rf = require( './../../../base/f' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from an F distribution.\n*\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `d1` must be a positive number\n* @throws {TypeError} `d2` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( d1, d2, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( d1 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', d1 ) );\n\t}\n\tif ( !isPositiveNumber( d2 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', d2 ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rf( d1, d2, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rf( d1, d2 );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( d1, d2, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from an F distribution.\n*\n* @module @stdlib/random/iter/f\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/f' );\n*\n* var iter = iterator( 2.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rfrechet = require( './../../../base/frechet' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} s - rate parameter\n* @param {number} m - location parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} `m` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, s, m, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\tif ( !isNumber( m ) || isnan( m ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a number. Value: `%s`.', m ) );\n\t}\n\tif ( arguments.length > 3 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rfrechet( alpha, s, m, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rfrechet( alpha, s, m );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, s, m, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @module @stdlib/random/iter/frechet\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/frechet' );\n*\n* var iter = iterator( 2.0, 5.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rgamma = require( './../../../base/gamma' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a gamma distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rgamma( alpha, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rgamma( alpha, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a gamma distribution.\n*\n* @module @stdlib/random/iter/gamma\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/gamma' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rgeom = require( './../../../base/geometric' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a geometric distribution.\n*\n* @param {Probability} p - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( p, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rgeom( p, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rgeom( p );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( p, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a geometric distribution.\n*\n* @module @stdlib/random/iter/geometric\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/geometric' );\n*\n* var iter = iterator( 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rgumbel = require( './../../../base/gumbel' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a number\n* @throws {TypeError} second argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rgumbel( mu, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rgumbel( mu, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, beta, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @module @stdlib/random/iter/gumbel\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/gumbel' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rhypergeom = require( './../../../base/hypergeometric' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @param {NonNegativeInteger} N - population size\n* @param {NonNegativeInteger} K - subpopulation size\n* @param {NonNegativeInteger} n - number of draws\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} second argument must be a nonnegative integer\n* @throws {TypeError} third argument must be a nonnegative integer\n* @throws {RangeError} number of draws must be less than or equal to the population size\n* @throws {RangeError} subpopulation size must be less than or equal to the population size\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 10, 5, 3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( N, K, n, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNonNegativeInteger( N ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', N ) );\n\t}\n\tif ( !isNonNegativeInteger( K ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', K ) );\n\t}\n\tif ( !isNonNegativeInteger( n ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%s`.', n ) );\n\t}\n\tif ( n > N ) {\n\t\tthrow new RangeError( format( 'invalid argument. Number of draws must be less than or equal to the population size. Value: `%u`.', n ) );\n\t}\n\tif ( K > N ) {\n\t\tthrow new RangeError( format( 'invalid argument. Subpopulation size must be less than or equal to the population size. Value: `%u`.', K ) );\n\t}\n\tif ( arguments.length > 3 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rhypergeom( N, K, n, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rhypergeom( N, K, n );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( N, K, n, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @module @stdlib/random/iter/hypergeometric\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/hypergeometric' );\n*\n* var iter = iterator( 10, 5, 6 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rnorm = require( './../../../base/improved-ziggurat' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rnorm( opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rnorm();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @module @stdlib/random/iter/improved-ziggurat\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/improved-ziggurat' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rinvgamma = require( './../../../base/invgamma' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rinvgamma( alpha, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rinvgamma( alpha, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @module @stdlib/random/iter/invgamma\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/invgamma' );\n*\n* var iter = iterator( 2.0, 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rkumaraswamy = require( './../../../base/kumaraswamy' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `a` must be a positive number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( a, b, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', a ) );\n\t}\n\tif ( !isPositiveNumber( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rkumaraswamy( a, b, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rkumaraswamy( a, b );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( a, b, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @module @stdlib/random/iter/kumaraswamy\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/kumaraswamy' );\n*\n* var iter = iterator( 2.0, 1.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rlaplace = require( './../../../base/laplace' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, b, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rlaplace( mu, b, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rlaplace( mu, b );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, b, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @module @stdlib/random/iter/laplace\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/laplace' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rlevy = require( './../../../base/levy' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} c - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `c` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, c, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( c ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', c ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rlevy( mu, c, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rlevy( mu, c );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, c, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @module @stdlib/random/iter/levy\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/levy' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rlogis = require( './../../../base/logistic' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a logistic distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, s, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rlogis( mu, s, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rlogis( mu, s );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, s, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a logistic distribution.\n*\n* @module @stdlib/random/iter/logistic\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/logistic' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rlognorm = require( './../../../base/lognormal' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a lognormal distribution.\n*\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, sigma, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rlognorm( mu, sigma, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rlognorm( mu, sigma );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, sigma, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a lognormal distribution.\n*\n* @module @stdlib/random/iter/lognormal\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/lognormal' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar minstd = require( './../../../base/minstd' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @param {Options} [options] - function options\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'normalized' ) ) {\n\t\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = minstd( opts );\n\t\tif ( opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = minstd();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\tif ( opts.normalized ) {\n\t\trand = rand.normalized;\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMINSTD} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMINSTD} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMINSTD} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @module @stdlib/random/iter/minstd\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/minstd' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar minstd = require( './../../../base/minstd-shuffle' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @param {Options} [options] - function options\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'normalized' ) ) {\n\t\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = minstd( opts );\n\t\tif ( opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = minstd();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\tif ( opts.normalized ) {\n\t\trand = rand.normalized;\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMINSTD} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMINSTD} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMINSTD} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @module @stdlib/random/iter/minstd-shuffle\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/minstd-shuffle' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar mt19937 = require( './../../../base/mt19937' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @param {Options} [options] - function options\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'normalized' ) ) {\n\t\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = mt19937( opts );\n\t\tif ( opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = mt19937();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\tif ( opts.normalized ) {\n\t\trand = rand.normalized;\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @module @stdlib/random/iter/mt19937\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/mt19937' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rnbinom = require( './../../../base/negative-binomial' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @param {PositiveNumber} r - number of successes until experiment is stopped\n* @param {Probability} p - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} second argument must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 8, 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( r, p, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( r ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', r ) );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a probability. Value: `%s`.', p ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rnbinom( r, p, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rnbinom( r, p );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( r, p, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @module @stdlib/random/iter/negative-binomial\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/negative-binomial' );\n*\n* var iter = iterator( 10, 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rnorm = require( './../../../base/normal' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a normal distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, sigma, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rnorm( mu, sigma, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rnorm( mu, sigma );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, sigma, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a normal distribution.\n*\n* @module @stdlib/random/iter/normal\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/normal' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rpareto = require( './../../../base/pareto-type1' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rpareto( alpha, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rpareto( alpha, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @module @stdlib/random/iter/pareto-type1\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/pareto-type1' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rpois = require( './../../../base/poisson' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Poisson distribution.\n*\n* @param {PositiveNumber} lambda - mean\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( lambda, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rpois( lambda, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rpois( lambda );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( lambda, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Poisson distribution.\n*\n* @module @stdlib/random/iter/poisson\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/poisson' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar randi = require( './../../../base/randi' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers having integer values.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = randi( opts );\n\t\tif ( opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = randi();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers having integer values.\n*\n* @module @stdlib/random/iter/randi\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/randi' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar randn = require( './../../../base/randn' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a standard normal distribution.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='improved-ziggurat'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = randn( opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = randn();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a standard normal distribution.\n*\n* @module @stdlib/random/iter/randn\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/randn' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar randu = require( './../../../base/randu' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating uniformly distributed pseudorandom numbers between 0 and 1.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = randu( opts );\n\t\tif ( opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = randu();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating uniformly distributed pseudorandom numbers between 0 and 1.\n*\n* @module @stdlib/random/iter/randu\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/randu' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rrayleigh = require( './../../../base/rayleigh' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( sigma, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rrayleigh( sigma, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rrayleigh( sigma );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( sigma, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @module @stdlib/random/iter/rayleigh\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/rayleigh' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rt = require( './../../../base/t' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Student's t distribution.\n*\n* @param {PositiveNumber} v - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( v, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( v ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', v ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rt( v, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rt( v );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( v, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Student's t distribution.\n*\n* @module @stdlib/random/iter/t\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/t' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rtriangular = require( './../../../base/triangular' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a triangular distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} arguments must satisfy `a <= c <= b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( a, b, c, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( !isNumber( c ) || isnan( c ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a number and not NaN. Value: `%s`.', c ) );\n\t}\n\tif ( !(a <= c && c <= b) ) {\n\t\tthrow new RangeError( format( 'invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.', 'a <= c <= b', a, b, c ) );\n\t}\n\tif ( arguments.length > 3 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rtriangular( a, b, c, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rtriangular( a, b, c );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( a, b, c, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a triangular distribution.\n*\n* @module @stdlib/random/iter/triangular\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/triangular' );\n*\n* var iter = iterator( 2.0, 5.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar runif = require( './../../../base/uniform' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( a, b, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = runif( a, b, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = runif( a, b );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( a, b, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @module @stdlib/random/iter/uniform\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/uniform' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rweibull = require( './../../../base/weibull' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Weibull distribution.\n*\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( k, lambda, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rweibull( k, lambda, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rweibull( k, lambda );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( k, lambda, opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.PRNG.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.PRNG.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator for generating pseudorandom numbers drawn from a Weibull distribution.\n*\n* @module @stdlib/random/iter/weibull\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/weibull' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name arcsine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/arcsine}\n*/\nsetReadOnly( ns, 'arcsine', require( './../../iter/arcsine' ) );\n\n/**\n* @name bernoulli\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/bernoulli}\n*/\nsetReadOnly( ns, 'bernoulli', require( './../../iter/bernoulli' ) );\n\n/**\n* @name beta\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/beta}\n*/\nsetReadOnly( ns, 'beta', require( './../../iter/beta' ) );\n\n/**\n* @name betaprime\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/betaprime}\n*/\nsetReadOnly( ns, 'betaprime', require( './../../iter/betaprime' ) );\n\n/**\n* @name binomial\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/binomial}\n*/\nsetReadOnly( ns, 'binomial', require( './../../iter/binomial' ) );\n\n/**\n* @name boxMuller\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/box-muller}\n*/\nsetReadOnly( ns, 'boxMuller', require( './../../iter/box-muller' ) );\n\n/**\n* @name cauchy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/cauchy}\n*/\nsetReadOnly( ns, 'cauchy', require( './../../iter/cauchy' ) );\n\n/**\n* @name chi\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/chi}\n*/\nsetReadOnly( ns, 'chi', require( './../../iter/chi' ) );\n\n/**\n* @name chisquare\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/chisquare}\n*/\nsetReadOnly( ns, 'chisquare', require( './../../iter/chisquare' ) );\n\n/**\n* @name cosine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/cosine}\n*/\nsetReadOnly( ns, 'cosine', require( './../../iter/cosine' ) );\n\n/**\n* @name discreteUniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/discrete-uniform}\n*/\nsetReadOnly( ns, 'discreteUniform', require( './../../iter/discrete-uniform' ) );\n\n/**\n* @name erlang\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/erlang}\n*/\nsetReadOnly( ns, 'erlang', require( './../../iter/erlang' ) );\n\n/**\n* @name exponential\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/exponential}\n*/\nsetReadOnly( ns, 'exponential', require( './../../iter/exponential' ) );\n\n/**\n* @name f\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/f}\n*/\nsetReadOnly( ns, 'f', require( './../../iter/f' ) );\n\n/**\n* @name frechet\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/frechet}\n*/\nsetReadOnly( ns, 'frechet', require( './../../iter/frechet' ) );\n\n/**\n* @name gamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/gamma}\n*/\nsetReadOnly( ns, 'gamma', require( './../../iter/gamma' ) );\n\n/**\n* @name geometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/geometric}\n*/\nsetReadOnly( ns, 'geometric', require( './../../iter/geometric' ) );\n\n/**\n* @name gumbel\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/gumbel}\n*/\nsetReadOnly( ns, 'gumbel', require( './../../iter/gumbel' ) );\n\n/**\n* @name hypergeometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/hypergeometric}\n*/\nsetReadOnly( ns, 'hypergeometric', require( './../../iter/hypergeometric' ) );\n\n/**\n* @name improvedZiggurat\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/improved-ziggurat}\n*/\nsetReadOnly( ns, 'improvedZiggurat', require( './../../iter/improved-ziggurat' ) );\n\n/**\n* @name invgamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/invgamma}\n*/\nsetReadOnly( ns, 'invgamma', require( './../../iter/invgamma' ) );\n\n/**\n* @name kumaraswamy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/kumaraswamy}\n*/\nsetReadOnly( ns, 'kumaraswamy', require( './../../iter/kumaraswamy' ) );\n\n/**\n* @name laplace\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/laplace}\n*/\nsetReadOnly( ns, 'laplace', require( './../../iter/laplace' ) );\n\n/**\n* @name levy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/levy}\n*/\nsetReadOnly( ns, 'levy', require( './../../iter/levy' ) );\n\n/**\n* @name logistic\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/logistic}\n*/\nsetReadOnly( ns, 'logistic', require( './../../iter/logistic' ) );\n\n/**\n* @name lognormal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/lognormal}\n*/\nsetReadOnly( ns, 'lognormal', require( './../../iter/lognormal' ) );\n\n/**\n* @name minstd\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/minstd}\n*/\nsetReadOnly( ns, 'minstd', require( './../../iter/minstd' ) );\n\n/**\n* @name minstdShuffle\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/minstd-shuffle}\n*/\nsetReadOnly( ns, 'minstdShuffle', require( './../../iter/minstd-shuffle' ) );\n\n/**\n* @name mt19937\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/mt19937}\n*/\nsetReadOnly( ns, 'mt19937', require( './../../iter/mt19937' ) );\n\n/**\n* @name negativeBinomial\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/negative-binomial}\n*/\nsetReadOnly( ns, 'negativeBinomial', require( './../../iter/negative-binomial' ) );\n\n/**\n* @name normal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/normal}\n*/\nsetReadOnly( ns, 'normal', require( './../../iter/normal' ) );\n\n/**\n* @name pareto1\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/pareto-type1}\n*/\nsetReadOnly( ns, 'pareto1', require( './../../iter/pareto-type1' ) );\n\n/**\n* @name poisson\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/poisson}\n*/\nsetReadOnly( ns, 'poisson', require( './../../iter/poisson' ) );\n\n/**\n* @name randi\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/randi}\n*/\nsetReadOnly( ns, 'randi', require( './../../iter/randi' ) );\n\n/**\n* @name randn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/randn}\n*/\nsetReadOnly( ns, 'randn', require( './../../iter/randn' ) );\n\n/**\n* @name randu\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/randu}\n*/\nsetReadOnly( ns, 'randu', require( './../../iter/randu' ) );\n\n/**\n* @name rayleigh\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/rayleigh}\n*/\nsetReadOnly( ns, 'rayleigh', require( './../../iter/rayleigh' ) );\n\n/**\n* @name t\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/t}\n*/\nsetReadOnly( ns, 't', require( './../../iter/t' ) );\n\n/**\n* @name triangular\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/triangular}\n*/\nsetReadOnly( ns, 'triangular', require( './../../iter/triangular' ) );\n\n/**\n* @name uniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/uniform}\n*/\nsetReadOnly( ns, 'uniform', require( './../../iter/uniform' ) );\n\n/**\n* @name weibull\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/weibull}\n*/\nsetReadOnly( ns, 'weibull', require( './../../iter/weibull' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Samples from a discrete uniform distribution (equal probabilities and with replacement).\n*\n* @private\n* @param {ArrayLike} x - array-like object from which to sample\n* @param {NonNegativeInteger} size - sample size\n* @param {Function} rand - PRNG for generating uniformly distributed numbers\n* @returns {Array} sample\n*/\nfunction discreteUniform( x, size, rand ) {\n\tvar pos;\n\tvar out;\n\tvar N;\n\tvar i;\n\n\tN = x.length;\n\tout = new Array( size );\n\tfor ( i = 0; i < size; i++ ) {\n\t\tpos = floor( N * rand() );\n\t\tout[ i ] = x[ pos ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Samples without replacement from a discrete set using custom probabilities.\n*\n* ## Notes\n*\n* - After each draw, the probabilities of the remaining observations are renormalized so that they sum to one.\n*\n* @private\n* @param {ArrayLike} x - array-like object from which to sample\n* @param {NonNegativeInteger} size - sample size\n* @param {Function} rand - PRNG for generating uniformly distributed numbers\n* @param {ProbabilityArray} probabilities - element probabilities\n* @returns {Array} sample\n*/\nfunction renormalizing( x, size, rand, probabilities ) {\n\tvar probs;\n\tvar psum;\n\tvar out;\n\tvar N;\n\tvar i;\n\tvar j;\n\tvar k;\n\tvar u;\n\n\tN = x.length;\n\tprobs = new Array( N );\n\tfor ( i = 0; i < N; i++ ) {\n\t\tprobs[ i ] = probabilities[ i ];\n\t}\n\tout = new Array( size );\n\tfor ( i = 0; i < size; i++ ) {\n\t\tu = rand();\n\t\tpsum = 0;\n\t\tfor ( j = 0; j < N; j++ ) {\n\t\t\tpsum += probs[ j ];\n\t\t\tif ( u < psum ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfor ( k = 0; k < N; k++ ) {\n\t\t\tif ( k === j ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tprobs[ k ] /= 1.0 - probs[ j ];\n\t\t}\n\t\tprobs[ j ] = 0.0;\n\t\tout[ i ] = x[ j ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = renormalizing;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// FUNCTIONS //\n\nvar slice = Array.prototype.slice;\n\n\n// MAIN //\n\n/**\n* Samples uniformly without replacement using the Fisher-Yates shuffle.\n*\n* ## References\n*\n* - Knuth, Donald E. 1997. _The Art of Computer Programming, Volume 2 (3rd Ed.): Seminumerical Algorithms_. Boston, MA, USA: Addison-Wesley Longman Publishing Co., Inc.\n*\n* @private\n* @param {ArrayLike} x - array-like object from which to sample\n* @param {NonNegativeInteger} size - sample size\n* @param {Function} rand - PRNG for generating uniformly distributed numbers\n* @returns {Array} sample\n*/\nfunction fisherYates( x, size, rand ) {\n\tvar tmp;\n\tvar N;\n\tvar i;\n\tvar j;\n\n\tN = x.length;\n\n\t// Note: we skip the first element, as no further swaps are possible given that all other indices are excluded from swapping...\n\tfor ( i = N-1; i > 0; i-- ) {\n\t\t// Generate an integer index on the interval: [0,i]\n\t\tj = floor( rand()*(i+1) );\n\n\t\t// Swap elements:\n\t\ttmp = x[ i ];\n\t\tx[ i ] = x[ j ];\n\t\tx[ j ] = tmp;\n\t}\n\treturn slice.call( x, 0, size );\n}\n\n\n// EXPORTS //\n\nmodule.exports = fisherYates;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Samples with replacement and non-uniform probabilities using Vose's [alias method][alias-method].\n*\n* ## References\n*\n* - Vose, Michael D. 1991. \"A linear algorithm for generating random numbers with a given distribution.\" _IEEE Transactions on Software Engineering_ 17 (9): 972\u201375. doi:[10.1109/32.92917][@vose:1991].\n*\n* [alias-method]: http://keithschwarz.com/darts-dice-coins/\n* [@vose:1991]: https://doi.org/10.1109/32.92917\n*\n* @private\n* @param {ArrayLike} x - array-like object from which to sample\n* @param {NonNegativeInteger} size - sample size\n* @param {Function} rand - PRNG for generating uniformly distributed numbers\n* @param {ProbabilityArray} probabilities - element probabilities\n* @returns {Array} sample\n*/\nfunction vose( x, size, rand, probabilities ) {\n\tvar small;\n\tvar large;\n\tvar probs;\n\tvar alias;\n\tvar out;\n\tvar N;\n\tvar p;\n\tvar g;\n\tvar i;\n\tvar l;\n\n\tprobs = probabilities.slice();\n\tN = x.length;\n\n\tsmall = [];\n\tlarge = [];\n\tfor ( i = 0; i < N; i++ ) {\n\t\tprobs[ i ] *= N;\n\t\tif ( probs[ i ] < 1.0 ) {\n\t\t\tsmall.push( i );\n\t\t} else {\n\t\t\tlarge.push( i );\n\t\t}\n\t}\n\talias = new Array( N );\n\tp = new Array( N );\n\twhile ( small.length !== 0 && large.length !== 0 ) {\n\t\tl = small.shift();\n\t\tg = large.shift();\n\t\tp[ l ] = probs[ l ];\n\t\talias[ l ] = g;\n\t\tprobs[ g ] = probs[ g ] + probs[ l ] - 1.0;\n\t\tif ( probs[ g ] < 1.0 ) {\n\t\t\tsmall.push( g );\n\t\t} else {\n\t\t\tlarge.push( g );\n\t\t}\n\t}\n\tfor ( i = 0; i < large.length; i++ ) {\n\t\tp[ large[ i ] ] = 1.0;\n\t}\n\tfor ( i = 0; i < small.length; i++ ) {\n\t\tp[ small[ i ] ] = 1.0;\n\t}\n\tout = new Array( size );\n\tfor ( i = 0; i < size; i++ ) {\n\t\tl = floor( N*rand() );\n\t\tif ( rand() < p[ l ] ) {\n\t\t\tout[ i ] = x[ l ];\n\t\t} else {\n\t\t\tout[ i ] = x[ alias[ l ] ];\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = vose;\n", "{\n\t\"mutate\": false,\n\t\"replace\": true\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' );\nvar isUnityProbabilityArray = require( '@stdlib/assert/is-unity-probability-array' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination for validated options\n* @param {Options} options - function options\n* @param {NonNegativeInteger} [options.size] - sample size\n* @param {ProbabilityArray} [options.probs] - element probabilities\n* @param {boolean} [options.replace] - boolean indicating whether to sample with replacement\n* @param {boolean} [options.mutate] - boolean indicating whether to mutate the `pool` when sampling without replacement\n* @returns {(null|Error)} null or an error\n*\n* @example\n* var opts = {};\n* var options = {\n* 'size': 10,\n* 'replace': false,\n* 'mutate': true,\n* 'probs': [ 0.7, 0.3 ]\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'size' ) ) {\n\t\topts.size = options.size;\n\t\tif ( !isNonNegativeInteger( opts.size ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'size', opts.size ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'probs' ) ) {\n\t\topts.probs = options.probs;\n\t\tif ( !isUnityProbabilityArray( opts.probs ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be an array of probabilities that sum to one. Option: `%s`.', 'probs', opts.probs ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'mutate' ) ) {\n\t\topts.mutate = options.mutate;\n\t\tif ( !isBoolean( opts.mutate ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'mutate', opts.mutate ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'replace' ) ) {\n\t\topts.replace = options.replace;\n\t\tif ( !isBoolean( opts.replace ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'replace', opts.replace ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isArrayLike = require( '@stdlib/assert/is-array-like' );\nvar isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar randu = require( './../../base/mt19937' ).factory;\nvar copy = require( '@stdlib/utils/copy' );\nvar discreteUniform = require( './discrete_uniform.js' );\nvar renormalizing = require( './renormalizing.js' );\nvar fisherYates = require( './fisher_yates.js' );\nvar vose = require( './vose.js' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// FUNCTIONS //\n\nvar slice = Array.prototype.slice;\n\n\n// MAIN //\n\n/**\n* Returns a function to sample elements from an array-like object.\n*\n* @param {(ArrayLike|TypedArrayLike)} [pool] - array-like object from which to sample\n* @param {Options} [options] - function options\n* @param {PositiveInteger} [options.seed] - integer-valued seed\n* @param {NonNegativeInteger} [options.size] - sample size\n* @param {boolean} [options.replace=true] - boolean indicating whether to sample with replacement\n* @param {boolean} [options.mutate=false] - boolean indicating whether to mutate the `pool` when sampling without replacement\n* @throws {TypeError} `pool` must be an array-like object\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Function} function to sample elements from an array-like object\n*\n* @example\n* var sample = factory({\n* 'seed': 232\n* });\n* var out = sample( 'abcdefg' );\n* // e.g., returns [ 'g', 'd', 'g', 'f', 'c', 'e', 'f' ]\n*\n* @example\n* var sample = factory( [ 1, 2, 3, 4, 5, 6 ], {\n* 'seed': 232,\n* 'size': 2\n* });\n* var out = sample();\n* // e.g., returns [ 6, 4 ]\n*\n* out = sample();\n* // e.g., returns [ 6, 5 ]\n*\n* @example\n* var sample = factory( [ 1, 2, 3, 4, 5, 6 ], {\n* 'seed': 474,\n* 'size': 3,\n* 'mutate': true,\n* 'replace': false\n* });\n* var out = sample();\n* // e.g., returns [ 4, 3, 6 ]\n*\n* out = sample();\n* // e.g., returns [ 1, 5, 2 ]\n*\n* out = sample();\n* // returns null\n*\n* @example\n* var sample = factory( [ 0, 1 ], {\n* 'size': 2\n* });\n*\n* var out = sample();\n* // e.g., returns [ 1, 1 ]\n*\n* out = sample({\n* 'size': 10\n* });\n* // e.g., returns [ 0, 1, 1, 1, 0, 1, 0, 0, 1, 1 ]\n*\n* @example\n* var sample = factory( [ 0, 1 ], {\n* 'size': 2\n* });\n*\n* var out = sample();\n* // e.g., returns [ 1, 1 ]\n*\n* out = sample({\n* 'replace': false\n* });\n* // e.g., returns [ 0, 1 ] or [ 1, 0 ]\n*\n* out = sample();\n* // e.g., returns [ 1, 1 ]\n*\n* @example\n* var sample = factory( [ 0, 1 ], {\n* 'size': 2,\n* 'mutate': true\n* });\n*\n* var out = sample();\n* // e.g., returns [ 1, 1 ]\n*\n* out = sample({\n* 'replace': false\n* });\n* // e.g., returns [ 0, 1 ] or [ 1, 0 ]\n*\n* out = sample();\n* // returns null\n*/\nfunction factory() {\n\tvar config;\n\tvar pool;\n\tvar conf;\n\tvar rand;\n\tvar err;\n\tvar fcn;\n\n\tconf = copy( defaults );\n\tif ( arguments.length === 1 ) {\n\t\tif ( isArrayLike( arguments[ 0 ] ) || isTypedArrayLike( arguments[ 0 ] ) ) { // eslint-disable-line max-len\n\t\t\tpool = arguments[ 0 ];\n\t\t} else {\n\t\t\tconfig = arguments[ 0 ];\n\t\t\terr = validate( conf, config );\n\t\t}\n\t} else if ( arguments.length > 1 ) {\n\t\tpool = arguments[ 0 ];\n\t\tconfig = arguments[ 1 ];\n\t\tif ( !( isArrayLike( pool ) || isTypedArrayLike( pool ) ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. `%s` argument must be array-like. Value: `%s`.', 'pool', pool ) );\n\t\t}\n\t\terr = validate( conf, config );\n\t}\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tif ( config && config.seed ) {\n\t\trand = randu({\n\t\t\t'seed': config.seed\n\t\t});\n\t} else {\n\t\trand = randu();\n\t}\n\tif ( pool === void 0 ) {\n\t\tfcn = sample1;\n\t} else {\n\t\tif ( isString( pool ) ) {\n\t\t\tpool = pool.split( '' );\n\t\t} else {\n\t\t\tpool = copy( pool );\n\t\t}\n\t\tfcn = sample2;\n\t}\n\tsetReadOnly( fcn, 'seed', rand.seed );\n\tsetReadOnly( fcn, 'PRNG', rand );\n\n\trand = rand.normalized;\n\n\treturn fcn;\n\n\t/**\n\t* Samples elements from an array-like object.\n\t*\n\t* @private\n\t* @param {(ArrayLike|TypedArrayLike)} x - array-like object from which to sample elements\n\t* @param {Options} [options] - function options\n\t* @param {NonNegativeInteger} [options.size] - sample size\n\t* @param {ProbabilityArray} [options.probs] - element probabilities\n\t* @param {boolean} [options.replace=true] - boolean indicating whether to sample with replacement\n\t* @throws {TypeError} first argument must be array-like\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {RangeError} `size` option must be less than or equal to the length of `x` when the `replace` option is `false`\n\t* @returns {Array} sample\n\t*/\n\tfunction sample1( x, options ) {\n\t\tvar replace;\n\t\tvar xcopy;\n\t\tvar probs;\n\t\tvar opts;\n\t\tvar size;\n\t\tvar err;\n\n\t\tif ( !( isArrayLike( x ) || isTypedArrayLike( x ) ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be array-like. Value: `%s`.', x ) );\n\t\t}\n\t\tif ( isString( x ) ) {\n\t\t\tx = x.split( '' );\n\t\t}\n\t\topts = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( opts, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tif ( opts.replace === void 0 ) {\n\t\t\treplace = conf.replace;\n\t\t} else {\n\t\t\treplace = opts.replace;\n\t\t}\n\t\tif ( opts.probs !== void 0 ) {\n\t\t\tprobs = opts.probs;\n\t\t}\n\t\tif ( opts.size ) {\n\t\t\tsize = opts.size;\n\t\t} else if ( conf.size ) {\n\t\t\tsize = conf.size;\n\t\t} else {\n\t\t\tsize = x.length;\n\t\t}\n\t\tif (\n\t\t\treplace === false &&\n\t\t\tsize > x.length\n\t\t) {\n\t\t\tthrow new RangeError( format( 'invalid option. `size` option must be less than or equal to the length of `x` when `replace` is `false`. Option: `%s`.', size ) );\n\t\t}\n\t\t// Custom probabilities...\n\t\tif ( probs ) {\n\t\t\tif ( replace ) {\n\t\t\t\treturn vose( x, size, rand, probs );\n\t\t\t}\n\t\t\treturn renormalizing( x, size, rand, probs );\n\t\t}\n\t\t// All elements equally likely...\n\t\tif ( replace ) {\n\t\t\treturn discreteUniform( x, size, rand );\n\t\t}\n\t\txcopy = slice.call( x );\n\t\treturn fisherYates( xcopy, size, rand );\n\t}\n\n\t/**\n\t* Samples elements from a population.\n\t*\n\t* @private\n\t* @param {Options} [options] - function options\n\t* @param {NonNegativeInteger} [options.size] - sample size\n\t* @param {boolean} [options.replace=true] - boolean indicating whether to sample with replacement\n\t* @param {boolean} [options.mutate=false] - boolean indicating whether to mutate the `pool` when sampling without replacement\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {RangeError} `size` option must be less than or equal to the population when the `replace` option is `false`\n\t* @returns {Array} sample\n\t*/\n\tfunction sample2( options ) {\n\t\tvar replace;\n\t\tvar mutate;\n\t\tvar opts;\n\t\tvar size;\n\t\tvar err;\n\t\tvar out;\n\n\t\tif ( pool.length === 0 ) {\n\t\t\treturn null;\n\t\t}\n\t\topts = {};\n\t\tif ( arguments.length ) {\n\t\t\terr = validate( opts, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tif ( opts.mutate === void 0 ) {\n\t\t\tmutate = conf.mutate;\n\t\t} else {\n\t\t\tmutate = opts.mutate;\n\t\t}\n\t\tif ( opts.replace === void 0 ) {\n\t\t\treplace = conf.replace;\n\t\t} else {\n\t\t\treplace = opts.replace;\n\t\t}\n\t\tif ( opts.size ) {\n\t\t\tsize = opts.size;\n\t\t} else if ( conf.size ) {\n\t\t\tsize = conf.size;\n\t\t} else {\n\t\t\tsize = pool.length;\n\t\t}\n\t\tif (\n\t\t\treplace === false &&\n\t\t\tsize > pool.length\n\t\t) {\n\t\t\tthrow new RangeError( format( 'invalid option. `size` option must be less than or equal to the population size when `replace` is `false`. Option: `%s`.', size ) );\n\t\t}\n\t\tif ( replace ) {\n\t\t\treturn discreteUniform( pool, size, rand );\n\t\t}\n\t\tout = fisherYates( pool, size, rand );\n\t\tif ( mutate ) {\n\t\t\t// Remove the sample observations:\n\t\t\tpool = pool.slice( size, pool.length );\n\t\t}\n\t\treturn out;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Samples elements from an array-like object.\n*\n* @name sample\n* @type {Function}\n* @param {ArrayLike} x - array-like object from which to sample\n* @param {Options} [options] - function options\n* @param {NonNegativeInteger} [options.size] - sample size\n* @param {ProbabilityArray} [options.probs] - element probabilities\n* @param {boolean} [options.replace=true] - boolean indicating whether to sample with replacement\n* @throws {TypeError} first argument must be array-like\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {RangeError} `size` option must be less than or equal to the length of `x` when the `replace` option is `false`\n* @returns {Array} sample\n*\n* @example\n* var out = sample( [ 3, null, NaN, 'abc', function(){} ] );\n* // e.g., returns [ 3, 'abc', null, 3, null ]\n*/\nvar sample = factory();\n\n\n// EXPORTS //\n\nmodule.exports = sample;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Sample elements from an array-like object.\n*\n* @module @stdlib/random/sample\n*\n* @example\n* var sample = require( '@stdlib/random/sample' );\n*\n* var out = sample( 'abc' );\n* // e.g., returns [ 'a', 'a', 'b' ]\n*\n* out = sample( [ 3, 6, 9 ] );\n* // e.g., returns [ 3, 9, 6 ]\n*\n* var bool = ( out.length === 3 );\n* // returns true\n*\n* @example\n* var sample = require( '@stdlib/random/sample' );\n*\n* var mysample = sample.factory({\n* 'seed': 323\n* });\n* var out = mysample( [ 3, 6, 9 ], {\n* 'size': 10\n* });\n* // e.g., returns [ 3, 9, 3, 3, 3, 6, 3, 3, 3, 6 ]\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"copy\": \"shallow\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar indexOf = require( '@stdlib/utils/index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar COPY_OPTIONS = [ 'deep', 'shallow', 'none' ];\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination for validated options\n* @param {Options} options - function options\n* @param {string} [options.copy] - string denoting whether to return a copy (`deep`, `shallow` or `none`)\n* @returns {(null|Error)} null or an error\n*\n* @example\n* var opts = {};\n* var options = {\n* 'copy': 'shallow'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t\tif ( !isString( opts.copy ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t\tif ( indexOf( COPY_OPTIONS, opts.copy ) === -1 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'copy', COPY_OPTIONS.join( '\", \"' ), opts.copy ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isArrayLike = require( '@stdlib/assert/is-array-like' );\nvar isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar deepCopy = require( '@stdlib/utils/copy' );\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar randu = require( './../../base/mt19937' ).factory;\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function to create a random permutation of elements from an array-like object.\n*\n* @param {Options} [config] - function options\n* @param {PositiveInteger} [config.seed] - integer-valued seed\n* @param {string} [config.copy=\"shallow\"] - default copy option (`deep`, `shallow` or `none`)\n* @throws {TypeError} options argument must be an object\n* @returns {Function} shuffle function\n*\n* @example\n* var shuffle = factory({\n* 'seed': 249\n* });\n* var data = [ 3, 8, 4, 8 ];\n* var out = shuffle( data );\n* // e.g., returns [ 4, 3, 8, 8 ]\n*/\nfunction factory( config ) {\n\tvar conf;\n\tvar rand;\n\tvar err;\n\n\tconf = deepCopy( defaults );\n\tif ( arguments.length ) {\n\t\terr = validate( conf, config );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tif ( config && config.seed ) {\n\t\trand = randu({\n\t\t\t'seed': config.seed\n\t\t});\n\t} else {\n\t\trand = randu();\n\t}\n\tsetReadOnly( shuffle, 'seed', rand.seed );\n\tsetReadOnly( shuffle, 'PRNG', rand );\n\n\trand = rand.normalized;\n\n\treturn shuffle;\n\n\t/**\n\t* Returns a random permutation of elements in `arr`.\n\t*\n\t* @private\n\t* @param {(ArrayLike|TypedArrayLike)} arr - array-like object to shuffle\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.copy] - string indicating whether to return a copy (`deep`,`shallow` or `none`)\n\t* @throws {TypeError} first argument must be array-like\n\t* @throws {TypeError} options must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {ArrayLike} the shuffled array-like object\n\t*\n\t* @example\n\t* var data = [ 1, 2, 3 ];\n\t* var out = shuffle( data );\n\t* // e.g., returns [ 3, 1, 2 ]\n\t*\n\t* @example\n\t* var data = [ 1, 2, 3 ];\n\t* var out = shuffle( data, {\n\t* 'copy': 'none'\n\t* });\n\t* var bool = ( data === out );\n\t* // returns true\n\t*/\n\tfunction shuffle( arr, options ) {\n\t\tvar strflg;\n\t\tvar level;\n\t\tvar copy;\n\t\tvar opts;\n\t\tvar err;\n\t\tvar out;\n\t\tvar tmp;\n\t\tvar N;\n\t\tvar i;\n\t\tvar j;\n\n\t\tif ( !( isArrayLike( arr ) || isTypedArrayLike( arr ) ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be array-like. Value: `%s`.', arr ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = {};\n\t\t\terr = validate( opts, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tcopy = ( opts && opts.copy ) ? opts.copy : conf.copy;\n\n\t\tstrflg = isString( arr );\n\t\tif ( strflg ) {\n\t\t\tarr = arr.split( '' );\n\t\t\tcopy = 'none';\n\t\t}\n\n\t\tlevel = 0;\n\t\tif ( copy === 'shallow' ) {\n\t\t\tlevel += 1;\n\t\t} else if ( copy === 'deep' ) {\n\t\t\tlevel += 2;\n\t\t}\n\t\tN = arr.length;\n\t\tout = deepCopy( arr, level );\n\n\t\t// Note: we skip the first element, as no further swaps are possible given that all other indices are excluded from swapping...\n\t\tfor ( i = N - 1; i > 0; i-- ) {\n\t\t\t// Generate an integer index on the interval [0,i]:\n\t\t\tj = floor( rand() * (i+1.0) );\n\n\t\t\t// Swap elements:\n\t\t\ttmp = out[ i ];\n\t\t\tout[ i ] = out[ j ];\n\t\t\tout[ j ] = tmp;\n\t\t}\n\n\t\tif ( strflg ) {\n\t\t\tout = arr.join( '' );\n\t\t}\n\t\treturn out;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a random permutation of elements in `arr`.\n*\n* @name shuffle\n* @type {Function}\n* @param {ArrayLike} arr - array-like object to shuffle\n* @param {Options} [options] - function options\n* @param {string} [options.copy=\"shallow\"] - string indicating whether to return a copy (`deep`,`shallow` or `none`)\n* @throws {TypeError} options must be an object\n* @throws {TypeError} must provide valid options\n* @returns {ArrayLike} the shuffled array-like object\n*\n* @example\n* var data = [ 1, 2, 3 ];\n* var out = shuffle( data );\n* // e.g., returns [ 3, 1, 2 ]\n*\n* @example\n* var data = [ 1, 2, 3 ];\n* var out = shuffle( data, {\n* 'copy': 'none'\n* });\n* var bool = ( data === out );\n* // returns true\n*/\nvar shuffle = factory();\n\n\n// EXPORTS //\n\nmodule.exports = shuffle;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a random permutation of elements from an array-like object.\n*\n* @module @stdlib/random/shuffle\n*\n* @example\n* var shuffle = require( '@stdlib/random/shuffle' );\n*\n* var data = [ 1, 2, 3 ];\n* var out = shuffle( data );\n* // e.g., returns [ 3, 1, 2 ]\n*\n* out = shuffle( data, {\n* 'copy': 'none'\n* });\n*\n* var bool = ( data === out );\n* // returns true\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:arcsine' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rarcsine = require( './../../../base/arcsine' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from an arcsine distribution.\n*\n* @constructor\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( a, b, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( a, b, options );\n\t\t}\n\t\treturn new RandomStream( a, b );\n\t}\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rarcsine( a, b, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar format = require( '@stdlib/string/format' );\nvar assign = require( '@stdlib/object/assign' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from an arcsine distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( a, b, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( a, b, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from an arcsine distribution.\n*\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( a, b, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( a ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', a ) );\n\t\t}\n\t\topts = assign( {}, a );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an arcsine distribution.\n\t*\n\t* @private\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {RangeError} `a` must be less than `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( a, b ) {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an arcsine distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {RangeError} `a` must be less than `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from an arcsine distribution.\n*\n* @module @stdlib/random/streams/arcsine\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/arcsine' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/arcsine' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/arcsine' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:bernoulli' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rbern = require( './../../../base/bernoulli' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @constructor\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 0.5, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( p, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( p, options );\n\t\t}\n\t\treturn new RandomStream( p );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rbern( p, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar format = require( '@stdlib/string/format' );\nvar assign = require( '@stdlib/object/assign' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 0.7, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( p, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( p, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar assign = require( '@stdlib/object/assign' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.3 ) );\n* }\n*/\nfunction factory( p, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isProbability( p ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( p ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', p ) );\n\t\t\t}\n\t\t\topts = assign( {}, p );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Bernoulli distribution.\n\t*\n\t* @private\n\t* @param {Probability} p - success probability\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( p ) {\n\t\treturn new RandomStream( p, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Bernoulli distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( p, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @module @stdlib/random/streams/bernoulli\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/bernoulli' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 0.2, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/bernoulli' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.2 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/bernoulli' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 0.2, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:beta' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rbeta = require( './../../../base/beta' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a beta distribution.\n*\n* @constructor\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( alpha, beta, options );\n\t\t}\n\t\treturn new RandomStream( alpha, beta );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rbeta( alpha, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar format = require( '@stdlib/string/format' );\nvar assign = require( '@stdlib/object/assign' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a beta distribution.\n*\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a beta distribution.\n*\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( alpha, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a beta distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - first shape parameter\n\t* @param {PositiveNumber} beta - second shape parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, beta ) {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a beta distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a beta distribution.\n*\n* @module @stdlib/random/streams/beta\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/beta' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/beta' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/beta' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:betaprime' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rbetaprime = require( './../../../base/betaprime' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a beta prime distribution.\n*\n* @constructor\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( alpha, beta, options );\n\t\t}\n\t\treturn new RandomStream( alpha, beta );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rbetaprime( alpha, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar format = require( '@stdlib/string/format' );\nvar assign = require( '@stdlib/object/assign' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a beta prime distribution.\n*\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a beta prime distribution.\n*\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( alpha, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a beta prime distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - first shape parameter\n\t* @param {PositiveNumber} beta - second shape parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, beta ) {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a beta prime distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a beta prime distribution.\n*\n* @module @stdlib/random/streams/betaprime\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/betaprime' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/betaprime' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/betaprime' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isPlainObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:binomial' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rbinom = require( './../../../base/binomial' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a binomial distribution.\n*\n* @constructor\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `n` must be a positive integer\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 20, 0.2, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( n, p, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( n, p, options );\n\t\t}\n\t\treturn new RandomStream( n, p );\n\t}\n\tif ( !isPositiveInteger( n ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', n ) );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a probability. Value: `%s`.', p ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rbinom( n, p, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a binomial distribution.\n*\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `n` must be a positive integer\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 20, 0.1, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( n, p, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isPlainObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( n, p, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a binomial distribution.\n*\n* @param {PositiveInteger} [n] - number of trials\n* @param {Probability} [p] - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 20, 0.5 ) );\n* }\n*/\nfunction factory( n, p, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( n ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', n ) );\n\t\t}\n\t\topts = assign( {}, n );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a binomial distribution.\n\t*\n\t* @private\n\t* @param {PositiveInteger} n - number of trials\n\t* @param {Probability} p - success probability\n\t* @throws {TypeError} `n` must be a positive integer\n\t* @throws {TypeError} `p` must be a positive probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( n, p ) {\n\t\treturn new RandomStream( n, p, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a binomial distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `n` must be a positive integer\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( n, p, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a binomial distribution.\n*\n* @module @stdlib/random/streams/binomial\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/binomial' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 20, 0.4, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/binomial' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 20, 0.4 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/binomial' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 20, 0.4, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:box-muller' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar randn = require( './../../../base/box-muller' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', randn( opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @module @stdlib/random/streams/box-muller\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/box-muller' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/box-muller' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/box-muller' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:cauchy' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rcauchy = require( './../../../base/cauchy' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @constructor\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `x0` must be a number\n* @throws {TypeError} `gamma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( x0, gamma, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( x0, gamma, options );\n\t\t}\n\t\treturn new RandomStream( x0, gamma );\n\t}\n\tif ( !isNumber( x0 ) || isnan( x0 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', x0 ) );\n\t}\n\tif ( !isPositiveNumber( gamma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', gamma ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rcauchy( x0, gamma, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `gamma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( x0, gamma, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( x0, gamma, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @param {number} [x0] - location parameter\n* @param {PositiveNumber} [gamma] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( x0, gamma, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( x0 ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', x0 ) );\n\t\t}\n\t\topts = assign( {}, x0 );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Cauchy distribution.\n\t*\n\t* @private\n\t* @param {number} x0 - location parameter\n\t* @param {PositiveNumber} gamma - scale parameter\n\t* @throws {TypeError} `gamma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( x0, gamma ) {\n\t\treturn new RandomStream( x0, gamma, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Cauchy distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `gamma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( x0, gamma, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @module @stdlib/random/streams/cauchy\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/cauchy' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/cauchy' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/cauchy' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:chi' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rchi = require( './../../../base/chi' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a chi distribution.\n*\n* @constructor\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( k, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( k, options );\n\t\t}\n\t\treturn new RandomStream( k );\n\t}\n\tif ( !isPositiveNumber( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rchi( k, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a chi distribution.\n*\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( k, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( k, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a chi distribution.\n*\n* @param {PositiveNumber} [k] - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( k, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( k ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( k ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', k ) );\n\t\t\t}\n\t\t\topts = assign( {}, k );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a chi distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - degrees of freedom\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( k ) {\n\t\treturn new RandomStream( k, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a chi distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( k, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a chi distribution.\n*\n* @module @stdlib/random/streams/chi\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/chi' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/chi' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/chi' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:chisquare' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rchisquare = require( './../../../base/chisquare' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a chi-square distribution.\n*\n* @constructor\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( k, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( k, options );\n\t\t}\n\t\treturn new RandomStream( k );\n\t}\n\tif ( !isPositiveNumber( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rchisquare( k, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a chi-square distribution.\n*\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( k, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, opts );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( k, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a chi-square distribution.\n*\n* @param {PositiveNumber} [k] - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( k, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options);\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( k ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( k ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', k ) );\n\t\t\t}\n\t\t\topts = assign( {}, k );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a chi-square distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - degrees of freedom\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( k ) {\n\t\treturn new RandomStream( k, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a chi-square distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( k, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a chi-square distribution.\n*\n* @module @stdlib/random/streams/chisquare\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/chisquare' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/chisquare' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/chisquare' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:cosine' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rcosine = require( './../../../base/cosine' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @constructor\n* @param {number} mu - location parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, s, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, s, options );\n\t\t}\n\t\treturn new RandomStream( mu, s );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rcosine( mu, s, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @param {number} mu - location parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, s, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, s, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @param {number} [mu] - location parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, s, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a raised cosine distribution.\n\t*\n\t* @private\n\t* @param {number} mu - location parameter\n\t* @param {PositiveNumber} s - scale parameter\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, s ) {\n\t\treturn new RandomStream( mu, s, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a raised cosine distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, s, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @module @stdlib/random/streams/cosine\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/cosine' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/cosine' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/cosine' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:discrete-uniform' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rduniform = require( './../../../base/discrete-uniform' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @constructor\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be an integer\n* @throws {TypeError} `b` must be an integer\n* @throws {RangeError} `a` must be less than or equal to `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2, 5, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( a, b, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( a, b, options );\n\t\t}\n\t\treturn new RandomStream( a, b );\n\t}\n\tif ( !isInteger( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', a ) );\n\t}\n\tif ( !isInteger( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', b ) );\n\t}\n\tif ( a > b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d, %d]`.', a, b ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rduniform( a, b, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be an integer\n* @throws {TypeError} `b` must be an integer\n* @throws {RangeError} `a` must be less than or equal to `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2, 5, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( a, b, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( a, b, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @param {integer} [a] - minimum support\n* @param {integer} [b] - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2, 5 ) );\n* }\n*/\nfunction factory( a, b, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( a ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', a ) );\n\t\t}\n\t\topts = assign( {}, a );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a discrete uniform distribution.\n\t*\n\t* @private\n\t* @param {integer} a - minimum support\n\t* @param {integer} b - maximum support\n\t* @throws {TypeError} `a` must be an integer\n\t* @throws {TypeError} `b` must be an integer\n\t* @throws {RangeError} `a` must be less than or equal to `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( a, b ) {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a discrete uniform distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `a` must be an integer\n\t* @throws {TypeError} `b` must be an integer\n\t* @throws {RangeError} `a` must be less than or equal to `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @module @stdlib/random/streams/discrete-uniform\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/discrete-uniform' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2, 5, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/discrete-uniform' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2, 5 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/discrete-uniform' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2, 5, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:erlang' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rerlang = require( './../../../base/erlang' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from an Erlang distribution.\n*\n* @constructor\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive integer\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( k, lambda, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( k, lambda, options );\n\t\t}\n\t\treturn new RandomStream( k, lambda );\n\t}\n\tif ( !isPositiveInteger( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rerlang( k, lambda, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from an Erlang distribution.\n*\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive integer\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( k, lambda, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( k, lambda, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from an Erlang distribution.\n*\n* @param {PositiveInteger} [k] - shape parameter\n* @param {PositiveNumber} [lambda] - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2, 5.0 ) );\n* }\n*/\nfunction factory( k, lambda, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( k ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', k ) );\n\t\t}\n\t\topts = assign( {}, k );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an Erlang distribution.\n\t*\n\t* @private\n\t* @param {PositiveInteger} k - shape parameter\n\t* @param {PositiveNumber} lambda - rate parameter\n\t* @throws {TypeError} `k` must be a positive integer\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( k, lambda ) {\n\t\treturn new RandomStream( k, lambda, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an Erlang distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `k` must be a positive integer\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( k, lambda, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from an Erlang distribution.\n*\n* @module @stdlib/random/streams/erlang\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/erlang' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/erlang' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/erlang' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:exponential' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rexponential = require( './../../../base/exponential' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from an exponential distribution.\n*\n* @constructor\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( lambda, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( lambda, options );\n\t\t}\n\t\treturn new RandomStream( lambda );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rexponential( lambda, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from an exponential distribution.\n*\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( lambda, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( lambda, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from an exponential distribution.\n*\n* @param {PositiveNumber} [lambda] - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( lambda, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( lambda ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( lambda ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', lambda ) );\n\t\t\t}\n\t\t\topts = assign( {}, lambda );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an exponential distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} lambda - rate parameter\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( lambda ) {\n\t\treturn new RandomStream( lambda, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an exponential distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( lambda, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from an exponential distribution.\n*\n* @module @stdlib/random/streams/exponential\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/exponential' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/exponential' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/exponential' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:f' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rf = require( './../../../base/f' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from an F distribution.\n*\n* @constructor\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `d1` must be a positive number\n* @throws {TypeError} `d2` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( d1, d2, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( d1, d2, options );\n\t\t}\n\t\treturn new RandomStream( d1, d2 );\n\t}\n\tif ( !isPositiveNumber( d1 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', d1 ) );\n\t}\n\tif ( !isPositiveNumber( d2 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', d2 ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rf( d1, d2, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from an F distribution.\n*\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `d1` must be a positive number\n* @throws {TypeError} `d2` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( d1, d2, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( d1, d2, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from an F distribution.\n*\n* @param {PositiveNumber} [d1] - degrees of freedom\n* @param {PositiveNumber} [d2] - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( d1, d2, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( d1 ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', d1 ) );\n\t\t}\n\t\topts = assign( {}, d1 );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an F distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} d1 - degrees of freedom\n\t* @param {PositiveNumber} d2 - degrees of freedom\n\t* @throws {TypeError} `d1` must be a positive number\n\t* @throws {TypeError} `d2` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( d1, d2 ) {\n\t\treturn new RandomStream( d1, d2, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an F distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `d1` must be a positive number\n\t* @throws {TypeError} `d2` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( d1, d2, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from an F distribution.\n*\n* @module @stdlib/random/streams/f\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/f' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/f' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/f' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:frechet' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rfrechet = require( './../../../base/frechet' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @constructor\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {number} [m] - location parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} `m` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, 1.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, s, m, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 3 ) {\n\t\t\treturn new RandomStream( alpha, s, m, options );\n\t\t}\n\t\treturn new RandomStream( alpha, s, m );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number and not NaN. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number and not NaN. Value: `%s`.', s ) );\n\t}\n\tif ( !isNumber( m ) || isnan( m ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a number. Value: `%s`.', m ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 3 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rfrechet( alpha, s, m, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {number} [m] - location parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} `m` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 5.0, -1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, s, m, options ) {\n\tvar opts;\n\tif ( arguments.length > 3 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, s, m, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {number} [m] - location parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0, 0.0 ) );\n* }\n*/\nfunction factory( alpha, s, m, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 3 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 3 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} s - scale parameter\n\t* @param {number} m - location parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} `m` must be a number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, s, m ) {\n\t\treturn new RandomStream( alpha, s, m, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} `m` must be a number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, s, m, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @module @stdlib/random/streams/frechet\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/frechet' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 5.0, 3.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/frechet' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0, -2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/frechet' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 5.0, 0.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:gamma' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rgamma = require( './../../../base/gamma' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a gamma distribution.\n*\n* @constructor\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( alpha, beta, options );\n\t\t}\n\t\treturn new RandomStream( alpha, beta );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rgamma( alpha, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a gamma distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a gamma distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( alpha, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a gamma distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - rate parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, beta ) {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a gamma distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a gamma distribution.\n*\n* @module @stdlib/random/streams/gamma\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/gamma' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/gamma' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/gamma' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:geometric' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rgeom = require( './../../../base/geometric' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a geometric distribution.\n*\n* @constructor\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 0.5, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( p, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( p, options );\n\t\t}\n\t\treturn new RandomStream( p );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rgeom( p, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a geometric distribution.\n*\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 0.7, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( p, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( p, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a geometric distribution.\n*\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.3 ) );\n* }\n*/\nfunction factory( p, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isProbability( p ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( p ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', p ) );\n\t\t\t}\n\t\t\topts = assign( {}, p );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a geometric distribution.\n\t*\n\t* @private\n\t* @param {Probability} p - success probability\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( p ) {\n\t\treturn new RandomStream( p, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a geometric distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( p, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a geometric distribution.\n*\n* @module @stdlib/random/streams/geometric\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/geometric' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 0.2, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/geometric' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.2 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/geometric' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 0.2, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:gumbel' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rgumbel = require( './../../../base/gumbel' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @constructor\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, beta, options );\n\t\t}\n\t\treturn new RandomStream( mu, beta );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rgumbel( mu, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Gumbel distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, beta ) {\n\t\treturn new RandomStream( mu, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Gumbel distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, beta, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @module @stdlib/random/streams/gumbel\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/gumbel' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/gumbel' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/gumbel' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:hypergeometric' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rhypergeom = require( './../../../base/hypergeometric' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @constructor\n* @param {NonNegativeInteger} [N] - population size\n* @param {NonNegativeInteger} [K] - subpopulation size\n* @param {NonNegativeInteger} [n] - number of draws\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `N` must be a nonnegative integer\n* @throws {TypeError} `K` must be a nonnegative integer\n* @throws {TypeError} `n` must be a nonnegative integer\n* @throws {RangeError} `n` must be less than or equal to `N`\n* @throws {RangeError} `K` must be less than or equal to `N`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 20, 10, 7, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( N, K, n, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 3 ) {\n\t\t\treturn new RandomStream( N, K, n, options );\n\t\t}\n\t\treturn new RandomStream( N, K, n );\n\t}\n\tif ( !isNonNegativeInteger( N ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', N ) );\n\t}\n\tif ( !isNonNegativeInteger( K ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', K ) );\n\t}\n\tif ( !isNonNegativeInteger( n ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%s`.', n ) );\n\t}\n\tif ( n > N ) {\n\t\tthrow new RangeError( 'invalid argument. Third argument must be less than or equal to the first argument.' );\n\t}\n\tif ( K > N ) {\n\t\tthrow new RangeError( 'invalid argument. Second argument must be less than or equal to the first argument.' );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 3 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rhypergeom( N, K, n, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @param {NonNegativeInteger} [N] - population size\n* @param {NonNegativeInteger} [K] - subpopulation size\n* @param {NonNegativeInteger} [n] - number of draws\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `N` must be a nonnegative integer\n* @throws {TypeError} `K` must be a nonnegative integer\n* @throws {TypeError} `n` must be a nonnegative integer\n* @throws {RangeError} `n` must be less than or equal to `N`\n* @throws {RangeError} `K` must be less than or equal to `N`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 20, 10, 7, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( N, K, n, options ) {\n\tvar opts;\n\tif ( arguments.length > 3 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( N, K, n, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @param {NonNegativeInteger} [N] - population size\n* @param {NonNegativeInteger} [K] - subpopulation size\n* @param {NonNegativeInteger} [n] - number of draws\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 5, 3, 2 ) );\n* }\n*/\nfunction factory( N, K, n, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( N ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', N ) );\n\t\t}\n\t\topts = assign( {}, N );\n\t} else if ( nargs > 3 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 3 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a hypergeometric distribution.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} N - population size\n\t* @param {NonNegativeInteger} K - subpopulation size\n\t* @param {NonNegativeInteger} n - number of draws\n\t* @throws {TypeError} `N` must be a nonnegative integer\n\t* @throws {TypeError} `K` must be a nonnegative integer\n\t* @throws {TypeError} `n` must be a nonnegative integer\n\t* @throws {RangeError} `n` must be less than or equal to `N`\n\t* @throws {RangeError} `K` must be less than or equal to `N`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( N, K, n ) {\n\t\treturn new RandomStream( N, K, n, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a hypergeometric distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `N` must be a nonnegative integer\n\t* @throws {TypeError} `K` must be a nonnegative integer\n\t* @throws {TypeError} `n` must be a nonnegative integer\n\t* @throws {RangeError} `n` must be less than or equal to `N`\n\t* @throws {RangeError} `K` must be less than or equal to `N`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( N, K, n, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @module @stdlib/random/streams/hypergeometric\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/hypergeometric' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 5, 3, 2, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/hypergeometric' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 5, 3, 2 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/hypergeometric' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 5, 3, 2, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:improved-ziggurat' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', randn( opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @module @stdlib/random/streams/improved-ziggurat\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/improved-ziggurat' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/improved-ziggurat' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/improved-ziggurat' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:invgamma' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rinvgamma = require( './../../../base/invgamma' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @constructor\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( alpha, beta, options );\n\t\t}\n\t\treturn new RandomStream( alpha, beta );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rinvgamma( alpha, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( alpha, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an inverse gamma distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, beta ) {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an inverse gamma distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @module @stdlib/random/streams/invgamma\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/invgamma' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/invgamma' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/invgamma' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:kumaraswamy' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rkumaraswamy = require( './../../../base/kumaraswamy' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @constructor\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a positive number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( a, b, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( a, b, options );\n\t\t}\n\t\treturn new RandomStream( a, b );\n\t}\n\tif ( !isPositiveNumber( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', a ) );\n\t}\n\tif ( !isPositiveNumber( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rkumaraswamy( a, b, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a positive number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( a, b, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( a, b, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @param {PositiveNumber} [a] - first shape parameter\n* @param {PositiveNumber} [b] - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( a, b, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( a ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', a ) );\n\t\t}\n\t\topts = assign( {}, a );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} a - first shape parameter\n\t* @param {PositiveNumber} b - second shape parameter\n\t* @throws {TypeError} `a` must be a positive number\n\t* @throws {TypeError} `b` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( a, b ) {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `a` must be a positive number\n\t* @throws {TypeError} `b` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @module @stdlib/random/streams/kumaraswamy\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/kumaraswamy' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/kumaraswamy' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/kumaraswamy' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:laplace' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rlaplace = require( './../../../base/laplace' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar format = require( '@stdlib/string/format' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @constructor\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, b, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, b, options );\n\t\t}\n\t\treturn new RandomStream( mu, b );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rlaplace( mu, b, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, b, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, b, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [b] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, b, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} b - scale parameter\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `b` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, b ) {\n\t\treturn new RandomStream( mu, b, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `b` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, b, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @module @stdlib/random/streams/laplace\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/laplace' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/laplace' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/laplace' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:levy' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rlevy = require( './../../../base/levy' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @constructor\n* @param {number} mu - mean\n* @param {PositiveNumber} c - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `c` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, c, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, c, options );\n\t\t}\n\t\treturn new RandomStream( mu, c );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( c ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', c ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rlevy( mu, c, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} c - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `c` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, c, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, c, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [c] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, c, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} c - scale parameter\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `c` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, c ) {\n\t\treturn new RandomStream( mu, c, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `c` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, c, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @module @stdlib/random/streams/levy\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/levy' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/levy' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/levy' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:logistic' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rlogistic = require( './../../../base/logistic' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a logistic distribution.\n*\n* @constructor\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, s, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, s, options );\n\t\t}\n\t\treturn new RandomStream( mu, s );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rlogistic( mu, s, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a logistic distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, s, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, s, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a logistic distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [s] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, s, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a logistic distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} s - scale parameter\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, s ) {\n\t\treturn new RandomStream( mu, s, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a logistic distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, s, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a logistic distribution.\n*\n* @module @stdlib/random/streams/logistic\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/logistic' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/logistic' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/logistic' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:lognormal' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rlognormal = require( './../../../base/lognormal' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a lognormal distribution.\n*\n* @constructor\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, sigma, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, sigma, options );\n\t\t}\n\t\treturn new RandomStream( mu, sigma );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rlognormal( mu, sigma, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a lognormal distribution.\n*\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, sigma, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, sigma, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a lognormal distribution.\n*\n* @param {number} [mu] - location parameter\n* @param {PositiveNumber} [sigma] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, sigma, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a lognormal distribution.\n\t*\n\t* @private\n\t* @param {number} mu - location parameter\n\t* @param {PositiveNumber} sigma - scale parameter\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, sigma ) {\n\t\treturn new RandomStream( mu, sigma, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a lognormal distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, sigma, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a lognormal distribution.\n*\n* @module @stdlib/random/streams/lognormal\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/lognormal' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 0.0, 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/lognormal' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.0, 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/lognormal' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 0.0, 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"normalized\": false\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'normalized' ) ) {\n\t\topts.normalized = options.normalized;\n\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:minstd' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar minstd = require( './../../../base/minstd' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {PRNGSeedMINSTD} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {PositiveInteger} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {PositiveInteger} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {PositiveInteger} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {PRNGStateMINSTD} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMINSTD} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar prng;\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tprng = minstd( opts );\n\tif ( opts.normalized ) {\n\t\tprng = prng.normalized;\n\t}\n\tsetNonEnumerableReadOnly( this, '_prng', prng );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {PRNGSeedMINSTD}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {PRNGStateMINSTD}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @module @stdlib/random/streams/minstd\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/minstd' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/minstd' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/minstd' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"normalized\": false\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'normalized' ) ) {\n\t\topts.normalized = options.normalized;\n\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:minstd-shuffle' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar minstd = require( './../../../base/minstd-shuffle' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {PRNGSeedMINSTD} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {PositiveInteger} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {PositiveInteger} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {PositiveInteger} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {PRNGStateMINSTD} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMINSTD} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar prng;\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tprng = minstd( opts );\n\tif ( opts.normalized ) {\n\t\tprng = prng.normalized;\n\t}\n\tsetNonEnumerableReadOnly( this, '_prng', prng );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {PRNGSeedMINSTD}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {PRNGStateMINSTD}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @module @stdlib/random/streams/minstd-shuffle\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/minstd-shuffle' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/minstd-shuffle' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/minstd-shuffle' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"normalized\": false\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'normalized' ) ) {\n\t\topts.normalized = options.normalized;\n\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:mt19937' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar mt19937 = require( './../../../base/mt19937' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {PRNGSeedMT19937} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {PositiveInteger} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {PositiveInteger} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {PositiveInteger} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {PRNGStateMT19937} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar prng;\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tprng = mt19937( opts );\n\tif ( opts.normalized ) {\n\t\tprng = prng.normalized;\n\t}\n\tsetNonEnumerableReadOnly( this, '_prng', prng );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {PRNGSeedMT19937}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {PRNGStateMT19937}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @module @stdlib/random/streams/mt19937\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/mt19937' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/mt19937' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/mt19937' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isPlainObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:negative-binomial' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rnbinom = require( './../../../base/negative-binomial' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a binomial distribution.\n*\n* @constructor\n* @param {PositiveNumber} r - number of successes until experiment is stopped\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `r` must be a positive number\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 20.0, 0.2, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( r, p, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( r, p, options );\n\t\t}\n\t\treturn new RandomStream( r, p );\n\t}\n\tif ( !isPositiveNumber( r ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', r ) );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a probability. Value: `%s`.', p ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rnbinom( r, p, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @param {PositiveNumber} r - number of successes until experiment is stopped\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `r` must be a positive number\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 20.0, 0.1, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( r, p, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isPlainObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( r, p, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @param {PositiveNumber} [r] - number of successes until experiment is stopped\n* @param {Probability} [p] - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 20.0, 0.5 ) );\n* }\n*/\nfunction factory( r, p, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( r ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', r ) );\n\t\t}\n\t\topts = assign( {}, r );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a negative binomial distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} r - number of trials\n\t* @param {Probability} p - success probability\n\t* @throws {TypeError} `r` must be a positive number\n\t* @throws {TypeError} `p` must be a positive probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( r, p ) {\n\t\treturn new RandomStream( r, p, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a negative binomial distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `r` must be a positive number\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( r, p, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @module @stdlib/random/streams/negative-binomial\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/negative-binomial' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 20.0, 0.4, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/negative-binomial' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 20.0, 0.4 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/negative-binomial' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 20.0, 0.4, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:normal' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rnorm = require( './../../../base/normal' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a normal distribution.\n*\n* @constructor\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, sigma, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, sigma, options );\n\t\t}\n\t\treturn new RandomStream( mu, sigma );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rnorm( mu, sigma, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a normal distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, sigma, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, sigma, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a normal distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [sigma] - standard deviation\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, sigma, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a normal distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} sigma - standard deviation\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, sigma ) {\n\t\treturn new RandomStream( mu, sigma, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a normal distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, sigma, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a normal distribution.\n*\n* @module @stdlib/random/streams/normal\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/normal' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 0.0, 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/normal' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.0, 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/normal' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 0.0, 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isPlainObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:pareto1' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rpareto1 = require( './../../../base/pareto-type1' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @constructor\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( alpha, beta, options );\n\t\t}\n\t\treturn new RandomStream( alpha, beta );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rpareto1( alpha, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isPlainObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( alpha, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, beta ) {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @module @stdlib/random/streams/pareto-type1\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/pareto-type1' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/pareto-type1' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/pareto-type1' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:poisson' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rpoisson = require( './../../../base/poisson' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar format = require( '@stdlib/string/format' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Poisson distribution.\n*\n* @constructor\n* @param {PositiveNumber} lambda - mean\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( lambda, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( lambda, options );\n\t\t}\n\t\treturn new RandomStream( lambda );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rpoisson( lambda, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Poisson distribution.\n*\n* @param {PositiveNumber} lambda - mean\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( lambda, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( lambda, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Poisson distribution.\n*\n* @param {PositiveNumber} [lambda] - mean\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( lambda, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( lambda ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( lambda ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', lambda ) );\n\t\t\t}\n\t\t\topts = assign( {}, lambda );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Poisson distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} lambda - mean\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( lambda ) {\n\t\treturn new RandomStream( lambda, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Poisson distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( lambda, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Poisson distribution.\n*\n* @module @stdlib/random/streams/poisson\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/poisson' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/poisson' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/poisson' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"name\": \"mt19937\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'name' ) ) {\n\t\topts.name = options.name;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:randi' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar randi = require( './../../../base/randi' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {*} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {PositiveInteger} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {PositiveInteger} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {PositiveInteger} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {*} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {*} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers having integer values.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', randi( opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {*}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {*}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers having integer values.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers having integer values.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers having integer values.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers having integer values.\n*\n* @module @stdlib/random/streams/randi\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randi' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/randi' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randi' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"name\": \"improved-ziggurat\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'name' ) ) {\n\t\topts.name = options.name;\n\t}\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:randn' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar randn = require( './../../../base/randn' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a standard normal distribution.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='improved-ziggurat'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', randn( opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a standard normal distribution.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='improved-ziggurat'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a standard normal distribution.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='improved-ziggurat'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a standard normal distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers from a standard normal distribution.\n*\n* @module @stdlib/random/streams/randn\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randn' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/randn' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randn' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"name\": \"mt19937\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'name' ) ) {\n\t\topts.name = options.name;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:randu' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar randu = require( './../../../base/randu' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {*} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {PositiveInteger} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {PositiveInteger} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {PositiveInteger} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {*} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {*} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', randu( opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {*}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {*}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {Function} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating uniformly distributed pseudorandom numbers between `0` and `1`.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @module @stdlib/random/streams/randu\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randu' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/randu' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randu' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:rayleigh' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rrayleigh = require( './../../../base/rayleigh' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @constructor\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( sigma, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( sigma, options );\n\t\t}\n\t\treturn new RandomStream( sigma );\n\t}\n\tif ( !isPositiveNumber( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rrayleigh( sigma, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( sigma, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( sigma, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @param {PositiveNumber} [sigma] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( sigma, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( sigma ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( sigma ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', sigma ) );\n\t\t\t}\n\t\t\topts = assign( {}, sigma );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Rayleigh distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} sigma - scale parameter\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( sigma ) {\n\t\treturn new RandomStream( sigma, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Rayleigh distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( sigma, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @module @stdlib/random/streams/rayleigh\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/rayleigh' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/rayleigh' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/rayleigh' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:t' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rt = require( './../../../base/t' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Student's t distribution.\n*\n* @constructor\n* @param {PositiveNumber} v - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `v` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( v, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( v, options );\n\t\t}\n\t\treturn new RandomStream( v );\n\t}\n\tif ( !isPositiveNumber( v ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', v ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rt( v, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Student's t distribution.\n*\n* @param {PositiveNumber} v - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `v` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( v, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( v, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Student's t distribution.\n*\n* @param {PositiveNumber} [v] - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( v, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( v ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( v ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', v ) );\n\t\t\t}\n\t\t\topts = assign( {}, v );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Student's t distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} v - degrees of freedom\n\t* @throws {TypeError} `v` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( v ) {\n\t\treturn new RandomStream( v, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Student's t distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `v` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( v, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Student's t distribution.\n*\n* @module @stdlib/random/streams/t\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/t' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/t' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/t' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:triangular' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rtriang = require( './../../../base/triangular' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a uniform distribution.\n*\n* @constructor\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {TypeError} `c` must be a number\n* @throws {RangeError} arguments must satisfy `a <= c <= b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( a, b, c, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 3 ) {\n\t\t\treturn new RandomStream( a, b, c, options );\n\t\t}\n\t\treturn new RandomStream( a, b, c );\n\t}\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( !isNumber( c ) || isnan( c ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a number and not NaN. Value: `%s`.', c ) );\n\t}\n\tif ( !(a <= c && c <= b) ) {\n\t\tthrow new RangeError( format( 'invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.', 'a <= c <= b', a, b, c ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 3 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rtriang( a, b, c, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a triangular distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {TypeError} `c` must be a number\n* @throws {RangeError} arguments must satisfy `a <= c <= b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 5.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( a, b, c, options ) {\n\tvar opts;\n\tif ( arguments.length > 3 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( a, b, c, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a triangular distribution.\n*\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {number} [c] - mode\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0, 4.0 ) );\n* }\n*/\nfunction factory( a, b, c, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( a ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', a ) );\n\t\t}\n\t\topts = assign( {}, a );\n\t} else if ( nargs > 3 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 3 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a triangular distribution.\n\t*\n\t* @private\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @param {number} c - mode\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {TypeError} `c` must be a number\n\t* @throws {RangeError} arguments must satisfy `a <= c <= b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( a, b, c ) {\n\t\treturn new RandomStream( a, b, c, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a triangular distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {TypeError} `c` must be a number\n\t* @throws {RangeError} arguments must satisfy `a <= c <= b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( a, b, c, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a triangular distribution.\n*\n* @module @stdlib/random/streams/triangular\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/triangular' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 5.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/triangular' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/triangular' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 5.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:uniform' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar runiform = require( './../../../base/uniform' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a uniform distribution.\n*\n* @constructor\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( a, b, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( a, b, options );\n\t\t}\n\t\treturn new RandomStream( a, b );\n\t}\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', runiform( a, b, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a uniform distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( a, b, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( a, b, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a uniform distribution.\n*\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( a, b, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( a ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', a ) );\n\t\t}\n\t\topts = assign( {}, a );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a uniform distribution.\n\t*\n\t* @private\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {RangeError} `a` must be less than `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( a, b ) {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a uniform distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {RangeError} `a` must be less than `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a uniform distribution.\n*\n* @module @stdlib/random/streams/uniform\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/uniform' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/uniform' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/uniform' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:weibull' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rweibull = require( './../../../base/weibull' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar format = require( '@stdlib/string/format' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Weibull distribution.\n*\n* @constructor\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( k, lambda, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( k, lambda, options );\n\t\t}\n\t\treturn new RandomStream( k, lambda );\n\t}\n\tif ( !isPositiveNumber( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rweibull( k, lambda, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Weibull distribution.\n*\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( k, lambda, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( k, lambda, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Weibull distribution.\n*\n* @param {PositiveNumber} [k] - scale parameter\n* @param {PositiveNumber} [lambda] - shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( k, lambda, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( k ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', k ) );\n\t\t}\n\t\topts = assign( {}, k );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Weibull distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - scale parameter\n\t* @param {PositiveNumber} lambda - shape parameter\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( k, lambda ) {\n\t\treturn new RandomStream( k, lambda, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Weibull distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( k, lambda, opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Weibull distribution.\n*\n* @module @stdlib/random/streams/weibull\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/weibull' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/weibull' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/weibull' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name arcsine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/arcsine}\n*/\nsetReadOnly( ns, 'arcsine', require( './../../streams/arcsine' ) );\n\n/**\n* @name bernoulli\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/bernoulli}\n*/\nsetReadOnly( ns, 'bernoulli', require( './../../streams/bernoulli' ) );\n\n/**\n* @name beta\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/beta}\n*/\nsetReadOnly( ns, 'beta', require( './../../streams/beta' ) );\n\n/**\n* @name betaprime\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/betaprime}\n*/\nsetReadOnly( ns, 'betaprime', require( './../../streams/betaprime' ) );\n\n/**\n* @name binomial\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/binomial}\n*/\nsetReadOnly( ns, 'binomial', require( './../../streams/binomial' ) );\n\n/**\n* @name boxMuller\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/box-muller}\n*/\nsetReadOnly( ns, 'boxMuller', require( './../../streams/box-muller' ) );\n\n/**\n* @name cauchy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/cauchy}\n*/\nsetReadOnly( ns, 'cauchy', require( './../../streams/cauchy' ) );\n\n/**\n* @name chi\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/chi}\n*/\nsetReadOnly( ns, 'chi', require( './../../streams/chi' ) );\n\n/**\n* @name chisquare\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/chisquare}\n*/\nsetReadOnly( ns, 'chisquare', require( './../../streams/chisquare' ) );\n\n/**\n* @name cosine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/cosine}\n*/\nsetReadOnly( ns, 'cosine', require( './../../streams/cosine' ) );\n\n/**\n* @name discreteUniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/discrete-uniform}\n*/\nsetReadOnly( ns, 'discreteUniform', require( './../../streams/discrete-uniform' ) );\n\n/**\n* @name erlang\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/erlang}\n*/\nsetReadOnly( ns, 'erlang', require( './../../streams/erlang' ) );\n\n/**\n* @name exponential\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/exponential}\n*/\nsetReadOnly( ns, 'exponential', require( './../../streams/exponential' ) );\n\n/**\n* @name f\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/f}\n*/\nsetReadOnly( ns, 'f', require( './../../streams/f' ) );\n\n/**\n* @name frechet\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/frechet}\n*/\nsetReadOnly( ns, 'frechet', require( './../../streams/frechet' ) );\n\n/**\n* @name gamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/gamma}\n*/\nsetReadOnly( ns, 'gamma', require( './../../streams/gamma' ) );\n\n/**\n* @name geometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/geometric}\n*/\nsetReadOnly( ns, 'geometric', require( './../../streams/geometric' ) );\n\n/**\n* @name gumbel\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/gumbel}\n*/\nsetReadOnly( ns, 'gumbel', require( './../../streams/gumbel' ) );\n\n/**\n* @name hypergeometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/hypergeometric}\n*/\nsetReadOnly( ns, 'hypergeometric', require( './../../streams/hypergeometric' ) );\n\n/**\n* @name improvedZiggurat\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/improved-ziggurat}\n*/\nsetReadOnly( ns, 'improvedZiggurat', require( './../../streams/improved-ziggurat' ) );\n\n/**\n* @name invgamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/invgamma}\n*/\nsetReadOnly( ns, 'invgamma', require( './../../streams/invgamma' ) );\n\n/**\n* @name kumaraswamy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/kumaraswamy}\n*/\nsetReadOnly( ns, 'kumaraswamy', require( './../../streams/kumaraswamy' ) );\n\n/**\n* @name laplace\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/laplace}\n*/\nsetReadOnly( ns, 'laplace', require( './../../streams/laplace' ) );\n\n/**\n* @name levy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/levy}\n*/\nsetReadOnly( ns, 'levy', require( './../../streams/levy' ) );\n\n/**\n* @name logistic\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/logistic}\n*/\nsetReadOnly( ns, 'logistic', require( './../../streams/logistic' ) );\n\n/**\n* @name lognormal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/lognormal}\n*/\nsetReadOnly( ns, 'lognormal', require( './../../streams/lognormal' ) );\n\n/**\n* @name minstd\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/minstd}\n*/\nsetReadOnly( ns, 'minstd', require( './../../streams/minstd' ) );\n\n/**\n* @name minstdShuffle\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/minstd-shuffle}\n*/\nsetReadOnly( ns, 'minstdShuffle', require( './../../streams/minstd-shuffle' ) );\n\n/**\n* @name mt19937\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/mt19937}\n*/\nsetReadOnly( ns, 'mt19937', require( './../../streams/mt19937' ) );\n\n/**\n* @name negativeBinomial\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/negative-binomial}\n*/\nsetReadOnly( ns, 'negativeBinomial', require( './../../streams/negative-binomial' ) );\n\n/**\n* @name normal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/normal}\n*/\nsetReadOnly( ns, 'normal', require( './../../streams/normal' ) );\n\n/**\n* @name pareto1\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/pareto-type1}\n*/\nsetReadOnly( ns, 'pareto1', require( './../../streams/pareto-type1' ) );\n\n/**\n* @name poisson\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/poisson}\n*/\nsetReadOnly( ns, 'poisson', require( './../../streams/poisson' ) );\n\n/**\n* @name randi\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/randi}\n*/\nsetReadOnly( ns, 'randi', require( './../../streams/randi' ) );\n\n/**\n* @name randn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/randn}\n*/\nsetReadOnly( ns, 'randn', require( './../../streams/randn' ) );\n\n/**\n* @name randu\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/randu}\n*/\nsetReadOnly( ns, 'randu', require( './../../streams/randu' ) );\n\n/**\n* @name rayleigh\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/rayleigh}\n*/\nsetReadOnly( ns, 'rayleigh', require( './../../streams/rayleigh' ) );\n\n/**\n* @name t\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/t}\n*/\nsetReadOnly( ns, 't', require( './../../streams/t' ) );\n\n/**\n* @name triangular\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/triangular}\n*/\nsetReadOnly( ns, 'triangular', require( './../../streams/triangular' ) );\n\n/**\n* @name uniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/uniform}\n*/\nsetReadOnly( ns, 'uniform', require( './../../streams/uniform' ) );\n\n/**\n* @name weibull\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/weibull}\n*/\nsetReadOnly( ns, 'weibull', require( './../../streams/weibull' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/arcsine' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from an arcsine distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} minimum support must be less than maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* arcsine( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction arcsine( N, a, sa, b, sb, out, so, options ) {\n\tvar rand = prng( a, sa, 0, b, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = arcsine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from an arcsine distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {NonNegativeInteger} oa - starting `a` index\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {NonNegativeInteger} ob - starting `b` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} minimum support must be less than maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* arcsine( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction arcsine( N, a, sa, oa, b, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( a, sa, oa, b, sb, ob, arguments.length > 10, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = arcsine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from an arcsine distribution.\n*\n* @module @stdlib/random/strided/arcsine\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var arcsine = require( '@stdlib/random/strided/arcsine' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* arcsine( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var arcsine = require( '@stdlib/random/strided/arcsine' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* arcsine.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isMethodIn = require( '@stdlib/assert/is-method-in' );\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar unary = require( '@stdlib/strided/base/unary' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a factory function for filling strided arrays with pseudorandom values drawn from a unary PRNG.\n*\n* @param {Function} prng - unary pseudorandom value generator\n* @param {Function} prng.factory - method which returns a new unary pseudorandom value generator\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} first argument must have a `factory` method\n* @returns {Function} function which returns a function for filling strided arrays\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var factory = createFactory( exponential );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var out = new Float64Array( 10 );\n* // returns \n*\n* random( out.length, [ 2.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var factory = createFactory( exponential );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var out = new Float64Array( 10 );\n* // returns \n*\n* random.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 );\n*/\nfunction createFactory( prng ) {\n\tif ( !isFunction( prng ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) );\n\t}\n\tif ( !isMethodIn( prng, 'factory' ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must have a `%s` method.', 'factory' ) );\n\t}\n\treturn factory;\n\n\t/**\n\t* Returns a function for filling strided arrays with pseudorandom values drawn from a PRNG.\n\t*\n\t* @private\n\t* @param {Options} [options] - function options\n\t* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n\t* @param {*} [options.seed] - pseudorandom value generator seed\n\t* @param {*} [options.state] - pseudorandom value generator state\n\t* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom value generator state\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {Function} function for filling strided arrays\n\t*/\n\tfunction factory() {\n\t\tvar base;\n\t\tvar opts;\n\n\t\tif ( arguments.length > 0 ) {\n\t\t\topts = arguments[ 0 ];\n\t\t\tif ( !isPlainObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tbase = prng.factory( opts );\n\t\t} else {\n\t\t\topts = {};\n\t\t\tbase = prng;\n\t\t}\n\t\tif ( opts && opts.prng ) {\n\t\t\tsetReadOnly( rand, 'seed', null );\n\t\t\tsetReadOnly( rand, 'seedLength', null );\n\t\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\t\tsetReadOnly( rand, 'stateLength', null );\n\t\t\tsetReadOnly( rand, 'byteLength', null );\n\t\t} else {\n\t\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t\t}\n\t\tsetReadOnly( rand, 'PRNG', base.PRNG );\n\t\tsetReadOnly( rand, 'ndarray', ndarray );\n\t\treturn rand;\n\n\t\t/**\n\t\t* Fills a strided array with pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} N - number of indexed elements\n\t\t* @param {Collection} param1 - PRNG parameter\n\t\t* @param {integer} sp1 - PRNG parameter stride length\n\t\t* @param {Collection} out - output array\n\t\t* @param {integer} so - output array stride length\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction rand( N, param1, sp1, out, so ) {\n\t\t\tunary( [ param1, out ], [ N ], [ sp1, so ], base );\n\t\t\treturn out;\n\t\t}\n\n\t\t/**\n\t\t* Fills a strided array with pseudorandom values drawn from a PRNG using alternative indexing semantics.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} N - number of indexed elements\n\t\t* @param {Collection} param1 - PRNG parameter\n\t\t* @param {integer} sp1 - PRNG parameter stride length\n\t\t* @param {NonNegativeInteger} op1 - PRNG parameter starting index\n\t\t* @param {Collection} out - output array\n\t\t* @param {integer} so - output array stride length\n\t\t* @param {NonNegativeInteger} oo - output array starting index\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction ndarray( N, param1, sp1, op1, out, so, oo ) {\n\t\t\tunary.ndarray( [ param1, out ], [ N ], [ sp1, so ], [ op1, oo ], base ); // eslint-disable-line max-len\n\t\t\treturn out;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG seed.\n\t\t*\n\t\t* @private\n\t\t* @returns {*} seed\n\t\t*/\n\t\tfunction getSeed() {\n\t\t\treturn rand.PRNG.seed;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG seed length.\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} seed length\n\t\t*/\n\t\tfunction getSeedLength() {\n\t\t\treturn rand.PRNG.seedLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG state length.\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} state length\n\t\t*/\n\t\tfunction getStateLength() {\n\t\t\treturn rand.PRNG.stateLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG state size (in bytes).\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} state size (in bytes)\n\t\t*/\n\t\tfunction getStateSize() {\n\t\t\treturn rand.PRNG.byteLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the current pseudorandom number generator state.\n\t\t*\n\t\t* @private\n\t\t* @returns {*} current state\n\t\t*/\n\t\tfunction getState() {\n\t\t\treturn rand.PRNG.state;\n\t\t}\n\n\t\t/**\n\t\t* Sets the pseudorandom number generator state.\n\t\t*\n\t\t* @private\n\t\t* @param {*} s - generator state\n\t\t* @throws {Error} must provide a valid state\n\t\t*/\n\t\tfunction setState( s ) {\n\t\t\trand.PRNG.state = s;\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = createFactory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create a factory function for filling strided arrays with pseudorandom values drawn from a unary PRNG.\n*\n* @module @stdlib/random/strided/tools/unary-factory\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var exponential = require( '@stdlib/random/base/exponential' );\n* var unaryFactory = require( '@stdlib/random/strided/tools/unary-factory' );\n*\n* var factory = createFactory( exponential );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var out = new Float64Array( 10 );\n* // returns \n*\n* random( out.length, [ 2.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var exponential = require( '@stdlib/random/base/exponential' );\n* var unaryFactory = require( '@stdlib/random/strided/tools/unary-factory' );\n*\n* var factory = createFactory( exponential );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var out = new Float64Array( 10 );\n* // returns \n*\n* random.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar unaryFactory = require( './../../../strided/tools/unary-factory' );\nvar base = require( './../../../base/bernoulli' );\n\n\n// MAIN //\n\n/**\n* Returns a function for filling strided arrays containing pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @name factory\n* @type {Function}\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for filling strided arrays\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var bernoulli = factory();\n* // returns \n*\n* var out = new Float64Array( 10 );\n* // returns \n*\n* var arr = bernoulli( out.length, [ 0.5 ], 0, out, 1 );\n* // returns \n*\n* var bool = ( arr === out );\n* // returns true\n*/\nvar factory = unaryFactory( base );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @name bernoulli\n* @type {Function}\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} p - success probability\n* @param {integer} sp - `p` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* bernoulli( out.length, [ 0.5 ], 0, out, 1 );\n*/\nvar bernoulli = factory();\n\n\n// EXPORTS //\n\nmodule.exports = bernoulli;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @module @stdlib/random/strided/bernoulli\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var bernoulli = require( '@stdlib/random/strided/bernoulli' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* bernoulli( out.length, [ 0.5 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var bernoulli = require( '@stdlib/random/strided/bernoulli' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* bernoulli.ndarray( out.length, [ 0.5 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/beta' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a beta distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - first shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {Collection} beta - second shape parameter\n* @param {integer} sb - `beta` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* beta( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction beta( N, alpha, sa, beta, sb, out, so, options ) {\n\tvar rand = prng( alpha, sa, 0, beta, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = beta;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a beta distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - first shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {NonNegativeInteger} oa - starting `alpha` index\n* @param {Collection} beta - second shape parameter\n* @param {integer} sb - `beta` stride length\n* @param {NonNegativeInteger} ob - starting `beta` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* beta( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction beta( N, alpha, sa, oa, beta, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( alpha, sa, oa, beta, sb, ob, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = beta;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a beta distribution.\n*\n* @module @stdlib/random/strided/beta\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var beta = require( '@stdlib/random/strided/beta' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* beta( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var beta = require( '@stdlib/random/strided/beta' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* beta.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/betaprime' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a beta prime distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - first shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {Collection} beta - second shape parameter\n* @param {integer} sb - `beta` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* betaprime( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction betaprime( N, alpha, sa, beta, sb, out, so, options ) {\n\tvar rand = prng( alpha, sa, 0, beta, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = betaprime;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a beta prime distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - first shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {NonNegativeInteger} oa - starting `alpha` index\n* @param {Collection} beta - second shape parameter\n* @param {integer} sb - `beta` stride length\n* @param {NonNegativeInteger} ob - starting `beta` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* betaprime( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction betaprime( N, alpha, sa, oa, beta, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( alpha, sa, oa, beta, sb, ob, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = betaprime;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a beta prime distribution.\n*\n* @module @stdlib/random/strided/betaprime\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var betaprime = require( '@stdlib/random/strided/betaprime' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* betaprime( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var betaprime = require( '@stdlib/random/strided/betaprime' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* betaprime.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar unaryFactory = require( './../../../strided/tools/unary-factory' );\nvar base = require( './../../../base/chi' );\n\n\n// MAIN //\n\n/**\n* Returns a function for filling strided arrays containing pseudorandom numbers drawn from a chi distribution.\n*\n* @name factory\n* @type {Function}\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for filling strided arrays\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var chi = factory();\n* // returns \n*\n* var out = new Float64Array( 10 );\n* // returns \n*\n* var arr = chi( out.length, [ 2.0 ], 0, out, 1 );\n* // returns \n*\n* var bool = ( arr === out );\n* // returns true\n*/\nvar factory = unaryFactory( base );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a chi distribution.\n*\n* @name chi\n* @type {Function}\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} k - degrees of freedom\n* @param {integer} sk - `k` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* chi( out.length, [ 2.0 ], 0, out, 1 );\n*/\nvar chi = factory();\n\n\n// EXPORTS //\n\nmodule.exports = chi;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a chi distribution.\n*\n* @module @stdlib/random/strided/chi\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var chi = require( '@stdlib/random/strided/chi' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* chi( out.length, [ 2.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var chi = require( '@stdlib/random/strided/chi' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* chi.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar unaryFactory = require( './../../../strided/tools/unary-factory' );\nvar base = require( './../../../base/chisquare' );\n\n\n// MAIN //\n\n/**\n* Returns a function for filling strided arrays containing pseudorandom numbers drawn from a chi-square distribution.\n*\n* @name factory\n* @type {Function}\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for filling strided arrays\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var chisquare = factory();\n* // returns \n*\n* var out = new Float64Array( 10 );\n* // returns \n*\n* var arr = chisquare( out.length, [ 2.0 ], 0, out, 1 );\n* // returns \n*\n* var bool = ( arr === out );\n* // returns true\n*/\nvar factory = unaryFactory( base );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a chi-square distribution.\n*\n* @name chisquare\n* @type {Function}\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} k - degrees of freedom\n* @param {integer} sk - `k` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* chisquare( out.length, [ 2.0 ], 0, out, 1 );\n*/\nvar chisquare = factory();\n\n\n// EXPORTS //\n\nmodule.exports = chisquare;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a chi-square distribution.\n*\n* @module @stdlib/random/strided/chisquare\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var chisquare = require( '@stdlib/random/strided/chisquare' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* chisquare( out.length, [ 2.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var chisquare = require( '@stdlib/random/strided/chisquare' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* chisquare.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/cosine' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - mean\n* @param {integer} sm - `mu` stride length\n* @param {Collection} s - scale parameter\n* @param {integer} ss - `s` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* cosine( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction cosine( N, mu, sm, s, ss, out, so, options ) {\n\tvar rand = prng( mu, sm, 0, s, ss, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, s, out ], [ N ], [ sm, ss, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cosine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - mean\n* @param {integer} sm - `mu` stride length\n* @param {NonNegativeInteger} om - starting `mu` index\n* @param {Collection} s - scale parameter\n* @param {integer} ss - `s` stride length\n* @param {NonNegativeInteger} os - starting `s` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* cosine( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction cosine( N, mu, sm, om, s, ss, os, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( mu, sm, om, s, ss, os, arguments.length > 10, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, s, out ], [ N ], [ sm, ss, so ], [ om, os, oo ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cosine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @module @stdlib/random/strided/cosine\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var cosine = require( '@stdlib/random/strided/cosine' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* cosine( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var cosine = require( '@stdlib/random/strided/cosine' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* cosine.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/discrete-uniform' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} minimum support must be less than or equal to maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* discreteUniform( out.length, [ -10 ], 0, [ 10 ], 0, out, 1 );\n*/\nfunction discreteUniform( N, a, sa, b, sb, out, so, options ) {\n\tvar rand = prng( a, sa, 0, b, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {NonNegativeInteger} oa - starting `a` index\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {NonNegativeInteger} ob - starting `b` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} minimum support must be less than or equal to maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* discreteUniform( out.length, [ -10 ], 0, 0, [ 10 ], 0, 0, out, 1, 0 );\n*/\nfunction discreteUniform( N, a, sa, oa, b, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( a, sa, oa, b, sb, ob, arguments.length > 10, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @module @stdlib/random/strided/discrete-uniform\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var discreteUniform = require( '@stdlib/random/strided/discrete-uniform' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* discreteUniform( out.length, [ -10 ], 0, [ 10 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var discreteUniform = require( '@stdlib/random/strided/discrete-uniform' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* discreteUniform.ndarray( out.length, [ -10 ], 0, 0, [ 10 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar unaryFactory = require( './../../../strided/tools/unary-factory' );\nvar base = require( './../../../base/exponential' );\n\n\n// MAIN //\n\n/**\n* Returns a function for filling strided arrays containing pseudorandom numbers drawn from an exponential distribution.\n*\n* @name factory\n* @type {Function}\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for filling strided arrays\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var exponential = factory();\n* // returns \n*\n* var out = new Float64Array( 10 );\n* // returns \n*\n* var arr = exponential( out.length, [ 2.0 ], 0, out, 1 );\n* // returns \n*\n* var bool = ( arr === out );\n* // returns true\n*/\nvar factory = unaryFactory( base );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from an exponential distribution.\n*\n* @name exponential\n* @type {Function}\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} lambda - rate parameter\n* @param {integer} sl - `lambda` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* exponential( out.length, [ 2.0 ], 0, out, 1 );\n*/\nvar exponential = factory();\n\n\n// EXPORTS //\n\nmodule.exports = exponential;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from an exponential distribution.\n*\n* @module @stdlib/random/strided/exponential\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var exponential = require( '@stdlib/random/strided/exponential' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* exponential( out.length, [ 2.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var exponential = require( '@stdlib/random/strided/exponential' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* exponential.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"factory\": \"main.factory\", \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/gamma' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a gamma distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {Collection} beta - rate parameter\n* @param {integer} sb - `beta` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* gamma( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction gamma( N, alpha, sa, beta, sb, out, so, options ) {\n\tvar rand = prng( alpha, sa, 0, beta, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a gamma distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {NonNegativeInteger} oa - starting `alpha` index\n* @param {Collection} beta - rate parameter\n* @param {integer} sb - `beta` stride length\n* @param {NonNegativeInteger} ob - starting `beta` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* gamma( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction gamma( N, alpha, sa, oa, beta, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( alpha, sa, oa, beta, sb, ob, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a gamma distribution.\n*\n* @module @stdlib/random/strided/gamma\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var gamma = require( '@stdlib/random/strided/gamma' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* gamma( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var gamma = require( '@stdlib/random/strided/gamma' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* gamma.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/invgamma' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {Collection} beta - scale parameter\n* @param {integer} sb - `beta` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* invgamma( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction invgamma( N, alpha, sa, beta, sb, out, so, options ) {\n\tvar rand = prng( alpha, sa, 0, beta, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = invgamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {NonNegativeInteger} oa - starting `alpha` index\n* @param {Collection} beta - scale parameter\n* @param {integer} sb - `beta` stride length\n* @param {NonNegativeInteger} ob - starting `beta` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* invgamma( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction invgamma( N, alpha, sa, oa, beta, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( alpha, sa, oa, beta, sb, ob, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = invgamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @module @stdlib/random/strided/invgamma\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var invgamma = require( '@stdlib/random/strided/invgamma' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* invgamma( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var invgamma = require( '@stdlib/random/strided/invgamma' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* invgamma.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/lognormal' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a lognormal distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - location parameter\n* @param {integer} sm - `mu` stride length\n* @param {Collection} sigma - scale parameter\n* @param {integer} ss - `sigma` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* lognormal( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction lognormal( N, mu, sm, sigma, ss, out, so, options ) {\n\tvar rand = prng( mu, sm, 0, sigma, ss, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, sigma, out ], [ N ], [ sm, ss, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = lognormal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a lognormal distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - location parameter\n* @param {integer} sm - `mu` stride length\n* @param {NonNegativeInteger} om - starting `mu` index\n* @param {Collection} sigma - scale parameter\n* @param {integer} ss - `sigma` stride length\n* @param {NonNegativeInteger} os - starting `sigma` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* lognormal( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction lognormal( N, mu, sm, om, sigma, ss, os, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( mu, sm, om, sigma, ss, os, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, sigma, out ], [ N ], [ sm, ss, so ], [ om, os, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = lognormal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a lognormal distribution.\n*\n* @module @stdlib/random/strided/lognormal\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var lognormal = require( '@stdlib/random/strided/lognormal' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* lognormal( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var lognormal = require( '@stdlib/random/strided/lognormal' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* lognormal.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/minstd' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*/\nfunction minstd( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/minstd' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1, 0 );\n*/\nfunction minstd( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/minstd' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*/\nfunction minstd( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/minstd' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1, 0 );\n*/\nfunction minstd( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG).\n*\n* @module @stdlib/random/strided/minstd\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd.ndarray( out.length, out, 1, 0 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd.normalized( out.length, out, 1 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\nvar normalized = require( './normalized.js' );\nvar ndarrayNormalized = require( './normalized.ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\nsetReadOnly( main, 'normalized', normalized );\nsetReadOnly( normalized, 'ndarray', ndarrayNormalized );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\", \"normalized\": \"main.normalized\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/minstd-shuffle' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*/\nfunction minstd( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/minstd-shuffle' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1, 0 );\n*/\nfunction minstd( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/minstd-shuffle' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*/\nfunction minstd( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/minstd-shuffle' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1, 0 );\n*/\nfunction minstd( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @module @stdlib/random/strided/minstd-shuffle\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd-shuffle' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd-shuffle' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd.ndarray( out.length, out, 1, 0 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd-shuffle' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd.normalized( out.length, out, 1 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\nvar normalized = require( './normalized.js' );\nvar ndarrayNormalized = require( './normalized.ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\nsetReadOnly( main, 'normalized', normalized );\nsetReadOnly( normalized, 'ndarray', ndarrayNormalized );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\", \"normalized\": \"main.normalized\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[0, 4294967295]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937( out.length, out, 1 );\n*/\nfunction mt19937( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[0, 4294967295]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937( out.length, out, 1, 0 );\n*/\nfunction mt19937( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937( out.length, out, 1 );\n*/\nfunction mt19937( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937( out.length, out, 1, 0 );\n*/\nfunction mt19937( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers generated using a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @module @stdlib/random/strided/mt19937\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var mt19937 = require( '@stdlib/random/strided/mt19937' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937( out.length, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var mt19937 = require( '@stdlib/random/strided/mt19937' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937.ndarray( out.length, out, 1, 0 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var mt19937 = require( '@stdlib/random/strided/mt19937' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937.normalized( out.length, out, 1 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\nvar normalized = require( './normalized.js' );\nvar ndarrayNormalized = require( './normalized.ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\nsetReadOnly( main, 'normalized', normalized );\nsetReadOnly( normalized, 'ndarray', ndarrayNormalized );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\", \"normalized\": \"main.normalized\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/normal' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a normal distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - mean\n* @param {integer} sm - `mu` stride length\n* @param {Collection} sigma - standard deviation\n* @param {integer} ss - `sigma` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* normal( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction normal( N, mu, sm, sigma, ss, out, so, options ) {\n\tvar rand = prng( mu, sm, 0, sigma, ss, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, sigma, out ], [ N ], [ sm, ss, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = normal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a normal distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - mean\n* @param {integer} sm - `mu` stride length\n* @param {NonNegativeInteger} om - starting `mu` index\n* @param {Collection} sigma - standard deviation\n* @param {integer} ss - `sigma` stride length\n* @param {NonNegativeInteger} os - starting `sigma` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* normal( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction normal( N, mu, sm, om, sigma, ss, os, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( mu, sm, om, sigma, ss, os, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, sigma, out ], [ N ], [ sm, ss, so ], [ om, os, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = normal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a normal distribution.\n*\n* @module @stdlib/random/strided/normal\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var normal = require( '@stdlib/random/strided/normal' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* normal( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var normal = require( '@stdlib/random/strided/normal' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* normal.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/randu' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* randu( out.length, out, 1 );\n*/\nfunction randu( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = randu;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/randu' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* randu( out.length, out, 1, 0 );\n*/\nfunction randu( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = randu;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @module @stdlib/random/strided/randu\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var randu = require( '@stdlib/random/strided/randu' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* randu( out.length, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var randu = require( '@stdlib/random/strided/randu' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* randu.ndarray( out.length, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/uniform' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} minimum support must be less than maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* uniform( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction uniform( N, a, sa, b, sb, out, so, options ) {\n\tvar rand = prng( a, sa, 0, b, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = uniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {NonNegativeInteger} oa - starting `a` index\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {NonNegativeInteger} ob - starting `b` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} minimum support must be less than maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* uniform( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction uniform( N, a, sa, oa, b, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( a, sa, oa, b, sb, ob, arguments.length > 10, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = uniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @module @stdlib/random/strided/uniform\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var uniform = require( '@stdlib/random/strided/uniform' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* uniform( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var uniform = require( '@stdlib/random/strided/uniform' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* uniform.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/weibull' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a Weibull distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} k - scale parameter\n* @param {integer} sk - `k` stride length\n* @param {Collection} lambda - shape parameter\n* @param {integer} sl - `lambda` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* weibull( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction weibull( N, k, sk, lambda, sl, out, so, options ) {\n\tvar rand = prng( k, sk, 0, lambda, sl, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ k, lambda, out ], [ N ], [ sk, sl, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = weibull;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a Weibull distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} k - scale parameter\n* @param {integer} sk - `k` stride length\n* @param {NonNegativeInteger} ok - starting `k` index\n* @param {Collection} lambda - shape parameter\n* @param {integer} sl - `lambda` stride length\n* @param {NonNegativeInteger} ol - starting `lambda` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* weibull( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction weibull( N, k, sk, ok, lambda, sl, ol, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( k, sk, ok, lambda, sl, ol, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ k, lambda, out ], [ N ], [ sk, sl, so ], [ ok, ol, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = weibull;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with pseudorandom numbers drawn from a Weibull distribution.\n*\n* @module @stdlib/random/strided/weibull\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var weibull = require( '@stdlib/random/strided/weibull' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* weibull( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var weibull = require( '@stdlib/random/strided/weibull' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* weibull.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name arcsine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/arcsine}\n*/\nsetReadOnly( ns, 'arcsine', require( './../../strided/arcsine' ) );\n\n/**\n* @name bernoulli\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/bernoulli}\n*/\nsetReadOnly( ns, 'bernoulli', require( './../../strided/bernoulli' ) );\n\n/**\n* @name beta\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/beta}\n*/\nsetReadOnly( ns, 'beta', require( './../../strided/beta' ) );\n\n/**\n* @name betaprime\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/betaprime}\n*/\nsetReadOnly( ns, 'betaprime', require( './../../strided/betaprime' ) );\n\n/**\n* @name chi\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/chi}\n*/\nsetReadOnly( ns, 'chi', require( './../../strided/chi' ) );\n\n/**\n* @name chisquare\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/chisquare}\n*/\nsetReadOnly( ns, 'chisquare', require( './../../strided/chisquare' ) );\n\n/**\n* @name cosine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/cosine}\n*/\nsetReadOnly( ns, 'cosine', require( './../../strided/cosine' ) );\n\n/**\n* @name discreteUniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/discrete-uniform}\n*/\nsetReadOnly( ns, 'discreteUniform', require( './../../strided/discrete-uniform' ) );\n\n/**\n* @name exponential\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/exponential}\n*/\nsetReadOnly( ns, 'exponential', require( './../../strided/exponential' ) );\n\n/**\n* @name gamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/gamma}\n*/\nsetReadOnly( ns, 'gamma', require( './../../strided/gamma' ) );\n\n/**\n* @name 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,GAAQ,QAAS,qBAAsB,EACvCC,GAAS,QAAS,uBAAwB,EAC1CC,GAAW,KA4Bf,SAASC,GAAQC,EAAMC,EAAQC,EAAQ,CACtC,GAA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1LjB,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_factory", "__commonJSMin", "exports", "module", "unaryFactory", "base", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "chi", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "base", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "chisquare", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "cosine", "N", "mu", "sm", "s", "ss", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "cosine", "N", "mu", "sm", "om", "s", "ss", "os", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "discreteUniform", "N", "a", "sa", "b", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "discreteUniform", "N", "a", "sa", "oa", "b", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "base", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "exponential", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "gamma", "N", "alpha", "sa", "beta", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "gamma", "N", "alpha", "sa", "oa", "beta", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_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/chisquare/README.md b/strided/chisquare/README.md new file mode 100644 index 00000000..43d1fc15 --- /dev/null +++ b/strided/chisquare/README.md @@ -0,0 +1,375 @@ + + +# Chi-square Random Numbers + +> Fill a strided array with pseudorandom numbers drawn from a [chi-square][@stdlib/random/base/chisquare] distribution. + +
+ +## Usage + +```javascript +var chisquare = require( '@stdlib/random/strided/chisquare' ); +``` + +#### chisquare( N, k, sk, out, so ) + +Fills a strided array with pseudorandom numbers drawn from a [chi-square][@stdlib/random/base/chisquare] distribution. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +// Create an array: +var out = new Float64Array( 10 ); + +// Fill the array with pseudorandom numbers: +chisquare( out.length, [ 2.0 ], 0, out, 1 ); +``` + +The function has the following parameters: + +- **N**: number of indexed elements. +- **k**: rate parameter. +- **sk**: index increment for `k`. +- **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 ]; + +chisquare( 3, [ 2.0 ], 0, out, 2 ); +``` + +Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. + + + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +// Initial array: +var k0 = new Float64Array( [ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0 ] ); + +// Create offset view: +var k1 = new Float64Array( k0.buffer, k0.BYTES_PER_ELEMENT*3 ); // start at 4th element + +// Create an output array: +var out = new Float64Array( 3 ); + +// Fill the output array: +chisquare( out.length, k1, -1, out, 1 ); +``` + +#### chisquare.ndarray( N, k, sk, ok, out, so, oo ) + +Fills a strided array with pseudorandom numbers drawn from a [chi-square][@stdlib/random/base/chisquare] 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: +chisquare.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 ); +``` + +The function has the following additional parameters: + +- **ok**: starting index for `k`. +- **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 ]; + +chisquare.ndarray( 3, [ 2.0 ], 0, 0, out, 2, 1 ); +``` + +#### chisquare.factory( \[options] ) + +Returns a function for filling strided arrays with pseudorandom numbers drawn from a [chi-square][@stdlib/random/base/chisquare] distribution. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var random = chisquare.factory(); +// returns + +// Create an array: +var out = new Float64Array( 10 ); + +// Fill the array with pseudorandom numbers: +random( out.length, [ 2.0 ], 0, out, 1 ); +``` + +The function accepts the following `options`: + +- **prng**: pseudorandom number generator for generating uniformly distributed pseudorandom numbers on the interval `[0,1)`. If provided, the function **ignores** both the `state` and `seed` options. In order to seed the underlying pseudorandom number generator, one must seed the provided `prng` (assuming the provided `prng` is seedable). +- **seed**: pseudorandom number generator seed. +- **state**: a [`Uint32Array`][@stdlib/array/uint32] containing pseudorandom number generator state. If provided, the function ignores the `seed` option. +- **copy**: `boolean` indicating whether to copy a provided pseudorandom number generator state. Setting this option to `false` allows sharing state between two or more pseudorandom number generators. Setting this option to `true` ensures that an underlying generator has exclusive control over its internal state. Default: `true`. + +To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); +var minstd = require( '@stdlib/random/base/minstd' ); + +var opts = { + 'prng': minstd.normalized +}; +var random = chisquare.factory( opts ); + +var out = new Float64Array( 10 ); +random( out.length, [ 2.0 ], 0, out, 1 ); +``` + +To seed the underlying pseudorandom number generator, set the `seed` option. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var opts = { + 'seed': 12345 +}; +var random = chisquare.factory( opts ); + +var out = new Float64Array( 10 ); +random( out.length, [ 2.0 ], 0, out, 1 ); +``` + +* * * + +#### random.PRNG + +The underlying pseudorandom number generator. + +```javascript +var prng = chisquare.PRNG; +// returns +``` + +#### chisquare.seed + +The value used to seed the underlying pseudorandom number generator. + +```javascript +var seed = chisquare.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 = chisquare.factory({ + 'prng': minstd +}); +// returns + +var seed = random.seed; +// returns null +``` + +#### chisquare.seedLength + +Length of underlying pseudorandom number generator seed. + +```javascript +var len = chisquare.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 = chisquare.factory({ + 'prng': minstd +}); +// returns + +var len = random.seedLength; +// returns null +``` + +#### chisquare.state + +Writable property for getting and setting the underlying pseudorandom number generator state. + +```javascript +var state = chisquare.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 = chisquare.factory({ + 'prng': minstd +}); +// returns + +var state = random.state; +// returns null +``` + +#### chisquare.stateLength + +Length of underlying pseudorandom number generator state. + +```javascript +var len = chisquare.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 = chisquare.factory({ + 'prng': minstd +}); +// returns + +var len = random.stateLength; +// returns null +``` + +#### chisquare.byteLength + +Size (in bytes) of underlying pseudorandom number generator state. + +```javascript +var sz = chisquare.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 = chisquare.factory({ + 'prng': minstd +}); +// returns + +var sz = random.byteLength; +// returns null +``` + +
+ + + +
+ +* * * + +## Notes + +- If `N <= 0`, both `chisquare` and `chisquare.ndarray` leave the output array unchanged. +- Both `chisquare` and `chisquare.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 chisquare = require( '@stdlib/random/strided/chisquare' ); + +// Specify a PRNG seed: +var opts = { + 'seed': 1234 +}; + +// Create a seeded PRNG: +var rand1 = chisquare.factory( opts ); + +// Create an array: +var x1 = zeros( 10, 'float64' ); + +// Fill the array with pseudorandom numbers: +rand1( x1.length, [ 2.0 ], 0, x1, 1 ); + +// Create another function for filling strided arrays: +var rand2 = chisquare.factory( opts ); +// returns + +// Create a second array: +var x2 = zeros( 10, 'generic' ); + +// Fill the array with the same pseudorandom numbers: +rand2( x2.length, [ 2.0 ], 0, x2, 1 ); + +// Create a list of indices: +var idx = zeroTo( x1.length, 'generic' ); + +// Print the array contents: +logEach( 'x1[%d] = %.2f; x2[%d] = %.2f', idx, x1, idx, x2 ); +``` + +
+ + + + + + + + + + + + + + diff --git a/strided/chisquare/benchmark/benchmark.float32.broadcast.js b/strided/chisquare/benchmark/benchmark.float32.broadcast.js new file mode 100644 index 00000000..2134d30d --- /dev/null +++ b/strided/chisquare/benchmark/benchmark.float32.broadcast.js @@ -0,0 +1,100 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var filledarray = require( '@stdlib/array/filled' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var pkg = require( './../package.json' ).name; +var random = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var out; + var x; + + x = filledarray( 2.0, 1, 'float32' ); + out = filledarray( 0.0, len, 'float32' ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var o; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + o = random( len, x, 0, out, 1 ); + if ( isnanf( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( pkg+'::broadcast:dtype=float32,len='+len, f ); + } +} + +main(); diff --git a/strided/chisquare/benchmark/benchmark.float32.js b/strided/chisquare/benchmark/benchmark.float32.js new file mode 100644 index 00000000..5e989730 --- /dev/null +++ b/strided/chisquare/benchmark/benchmark.float32.js @@ -0,0 +1,100 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var filledarray = require( '@stdlib/array/filled' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var pkg = require( './../package.json' ).name; +var random = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var out; + var x; + + x = filledarray( 2.0, len, 'float32' ); + out = filledarray( 0.0, len, 'float32' ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var o; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + o = random( len, x, 1, out, 1 ); + if ( isnanf( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( pkg+':dtype=float32,len='+len, f ); + } +} + +main(); diff --git a/strided/chisquare/benchmark/benchmark.float64.broadcast.js b/strided/chisquare/benchmark/benchmark.float64.broadcast.js new file mode 100644 index 00000000..b7d33b2f --- /dev/null +++ b/strided/chisquare/benchmark/benchmark.float64.broadcast.js @@ -0,0 +1,100 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var filledarray = require( '@stdlib/array/filled' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var pkg = require( './../package.json' ).name; +var random = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var out; + var x; + + x = filledarray( 2.0, 1, 'float64' ); + out = filledarray( 0.0, len, 'float64' ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var o; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + o = random( len, x, 0, out, 1 ); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( pkg+'::broadcast:dtype=float64,len='+len, f ); + } +} + +main(); diff --git a/strided/chisquare/benchmark/benchmark.float64.js b/strided/chisquare/benchmark/benchmark.float64.js new file mode 100644 index 00000000..ef48824a --- /dev/null +++ b/strided/chisquare/benchmark/benchmark.float64.js @@ -0,0 +1,100 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var filledarray = require( '@stdlib/array/filled' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var pkg = require( './../package.json' ).name; +var random = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var out; + var x; + + x = filledarray( 2.0, len, 'float64' ); + out = filledarray( 0.0, len, 'float64' ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var o; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + o = random( len, x, 1, out, 1 ); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( pkg+':dtype=float64,len='+len, f ); + } +} + +main(); diff --git a/strided/chisquare/benchmark/benchmark.generic.broadcast.js b/strided/chisquare/benchmark/benchmark.generic.broadcast.js new file mode 100644 index 00000000..ceebbc0c --- /dev/null +++ b/strided/chisquare/benchmark/benchmark.generic.broadcast.js @@ -0,0 +1,100 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var filledarray = require( '@stdlib/array/filled' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var pkg = require( './../package.json' ).name; +var random = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var out; + var x; + + x = filledarray( 2.0, 1, 'generic' ); + out = filledarray( 0.0, len, 'generic' ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var o; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + o = random( len, x, 0, out, 1 ); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( pkg+'::broadcast:dtype=generic,len='+len, f ); + } +} + +main(); diff --git a/strided/chisquare/benchmark/benchmark.generic.js b/strided/chisquare/benchmark/benchmark.generic.js new file mode 100644 index 00000000..151a3e06 --- /dev/null +++ b/strided/chisquare/benchmark/benchmark.generic.js @@ -0,0 +1,100 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var filledarray = require( '@stdlib/array/filled' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var pkg = require( './../package.json' ).name; +var random = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var out; + var x; + + x = filledarray( 2.0, len, 'generic' ); + out = filledarray( 0.0, len, 'generic' ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var o; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + o = random( len, x, 1, out, 1 ); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( pkg+':dtype=generic,len='+len, f ); + } +} + +main(); diff --git a/strided/chisquare/docs/repl.txt b/strided/chisquare/docs/repl.txt new file mode 100644 index 00000000..898b874a --- /dev/null +++ b/strided/chisquare/docs/repl.txt @@ -0,0 +1,203 @@ + +{{alias}}( N, k, sk, out, so ) + Fills a strided array with pseudorandom numbers drawn from a chi-square + 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. + + k: ArrayLikeObject + Degrees of freedom. + + sk: integer + Index increment for `k`. + + out: ArrayLikeObject + Output array. + + so: integer + Index increment for `out`. + + Returns + ------- + out: ArrayLikeObject + Output array. + + Examples + -------- + > var out = {{alias:@stdlib/array/zeros}}( 5, 'generic' ); + > {{alias}}( out.length, [ 2.0 ], 0, out, 1 ) + [...] + + +{{alias}}.ndarray( N, k, sk, ok, out, so, oo ) + Fills a strided array with pseudorandom numbers drawn from a chi-square + 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. + + k: ArrayLikeObject + Degrees of freedom. + + sk: integer + Index increment for `k`. + + ok: integer + Starting index for `k`. + + out: ArrayLikeObject + Output array. + + so: integer + Index increment for `out`. + + oo: integer + Starting index for `out`. + + Returns + ------- + out: ArrayLikeObject + Output array. + + Examples + -------- + > var out = {{alias:@stdlib/array/zeros}}( 5, 'generic' ); + > {{alias}}.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 ) + [...] + + +{{alias}}.factory( [options] ) + Returns a function for filling strided arrays with pseudorandom numbers + drawn from a chi-square distribution. + + Parameters + ---------- + options: Object (optional) + Options. + + options.prng: Function (optional) + Pseudorandom number generator (PRNG) for generating uniformly + distributed pseudorandom numbers on the interval `[0,1)`. If provided, + the `state` and `seed` options are ignored. In order to seed the + returned pseudorandom number generator, one must seed the provided + `prng` (assuming the provided `prng` is seedable). + + options.seed: integer|ArrayLikeObject (optional) + Pseudorandom number generator seed. The seed may be either a positive + unsigned 32-bit integer or, for arbitrary length seeds, an array-like + object containing unsigned 32-bit integers. + + options.state: Uint32Array (optional) + Pseudorandom number generator state. If provided, the `seed` option is + ignored. + + options.copy: boolean (optional) + Boolean indicating whether to copy a provided pseudorandom number + generator state. Setting this option to `false` allows sharing state + between two or more pseudorandom number generators. Setting this option + to `true` ensures that a returned generator has exclusive control over + its internal state. Default: true. + + Returns + ------- + fcn: Function + Function for filling strided arrays. + + Examples + -------- + > var fcn = {{alias}}.factory(); + > var out = {{alias:@stdlib/array/zeros}}( 5, 'generic' ); + > fcn( out.length, [ 2.0 ], 0, out, 1 ) + [...] + + +{{alias}}.PRNG + Underlying pseudorandom number generator. + + Examples + -------- + > var prng = {{alias}}.PRNG; + + +{{alias}}.seed + Pseudorandom number generator seed. + + Examples + -------- + > var seed = {{alias}}.seed; + + +{{alias}}.seedLength + Length of generator seed. + + Examples + -------- + > var len = {{alias}}.seedLength; + + +{{alias}}.state + Generator state. + + Examples + -------- + > var out = {{alias:@stdlib/array/zeros}}( 3, 'generic' ); + > {{alias}}( out.length, [ 2.0 ], 0, out, 1 ) + [...] + + // Get a copy of the current state: + > var state = {{alias}}.state + + + // Advance the generator state: + > out = {{alias:@stdlib/array/zeros}}( 3, 'generic' ); + > {{alias}}( out.length, [ 2.0 ], 0, out, 1 ) + [...] + > out = {{alias:@stdlib/array/zeros}}( 3, 'generic' ); + > {{alias}}( out.length, [ 2.0 ], 0, out, 1 ) + [...] + + // Set the state: + > {{alias}}.state = state; + + // Regenerate previous generated values: + > out = {{alias:@stdlib/array/zeros}}( 3, 'generic' ); + > {{alias}}( out.length, [ 2.0 ], 0, out, 1 ) + [...] + + +{{alias}}.stateLength + Length of generator state. + + Examples + -------- + > var len = {{alias}}.stateLength; + + +{{alias}}.byteLength + Size (in bytes) of generator state. + + Examples + -------- + > var sz = {{alias}}.byteLength; + + See Also + -------- + diff --git a/strided/chisquare/docs/types/index.d.ts b/strided/chisquare/docs/types/index.d.ts new file mode 100644 index 00000000..88dffba5 --- /dev/null +++ b/strided/chisquare/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 chi-square distribution. +*/ +interface Random extends PRNG { + /** + * Fills a strided array with pseudorandom numbers drawn from a chi-square distribution. + * + * @param N - number of indexed elements + * @param k - degrees of freedom + * @param sk - `k` 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: + * chisquare( out.length, [ 2.0 ], 0, out, 1 ); + */ + ( N: number, k: Collection, sk: number, out: Collection, so: number ): Collection; + + /** + * Fills a strided array with pseudorandom numbers drawn from a chi-square distribution using alternative indexing semantics. + * + * @param N - number of indexed elements + * @param k - degrees of freedom + * @param sk - `k` strided length + * @param ok - starting index for `k` + * @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: + * chisquare.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 ); + */ + ndarray( N: number, k: Collection, sk: number, ok: 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 chi-square 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 = chisquare.factory(); + * + * // Create an array: + * var out = new Float64Array( 10 ); + * + * // Fill the array with pseudorandom numbers: + * random( out.length, [ 2.0 ], 0, out, 1 ); + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * // Create a new PRNG function: + * var random = chisquare.factory({ + * 'seed': 297 + * }); + * + * // Create an array: + * var out = new Float64Array( 10 ); + * + * // Fill the array with pseudorandom numbers: + * random( out.length, [ 2.0 ], 0, out, 1 ); + */ + factory( options?: Options ): Random; +} + +/** +* Fills a strided array with pseudorandom numbers drawn from a chi-square distribution. +* +* @param N - number of indexed elements +* @param k - degrees of freedom +* @param sk - `k` 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: +* chisquare( out.length, [ 2.0 ], 0, out, 1 ); +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* // Create an array: +* var out = new Float64Array( 10 ); +* +* // Fill the array with pseudorandom numbers: +* chisquare.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 ); +*/ +declare var chisquare: Routine; + + +// EXPORTS // + +export = chisquare; diff --git a/strided/chisquare/docs/types/test.ts b/strided/chisquare/docs/types/test.ts new file mode 100644 index 00000000..b4dc8c38 --- /dev/null +++ b/strided/chisquare/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/chisquare/examples/index.js b/strided/chisquare/examples/index.js new file mode 100644 index 00000000..60d52bc3 --- /dev/null +++ b/strided/chisquare/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 chisquare = require( './../lib' ); + +// Specify a PRNG seed: +var opts = { + 'seed': 1234 +}; + +// Create a seeded PRNG: +var rand1 = chisquare.factory( opts ); + +// Create an array: +var x1 = zeros( 10, 'float64' ); + +// Fill the array with pseudorandom numbers: +rand1( x1.length, [ 2.0 ], 0, x1, 1 ); + +// Create another function for filling strided arrays: +var rand2 = chisquare.factory( opts ); +// returns + +// Create a second array: +var x2 = zeros( 10, 'generic' ); + +// Fill the array with the same pseudorandom numbers: +rand2( x2.length, [ 2.0 ], 0, x2, 1 ); + +// Create a list of indices: +var idx = zeroTo( x1.length, 'generic' ); + +// Print the array contents: +logEach( 'x1[%d] = %.2f; x2[%d] = %.2f', idx, x1, idx, x2 ); diff --git a/strided/chisquare/lib/factory.js b/strided/chisquare/lib/factory.js new file mode 100644 index 00000000..1a0ea508 --- /dev/null +++ b/strided/chisquare/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/chisquare' ); + + +// MAIN // + +/** +* Returns a function for filling strided arrays containing pseudorandom numbers drawn from a chi-square 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 chisquare = factory(); +* // returns +* +* var out = new Float64Array( 10 ); +* // returns +* +* var arr = chisquare( out.length, [ 2.0 ], 0, out, 1 ); +* // returns +* +* var bool = ( arr === out ); +* // returns true +*/ +var factory = unaryFactory( base ); + + +// EXPORTS // + +module.exports = factory; diff --git a/strided/chisquare/lib/index.js b/strided/chisquare/lib/index.js new file mode 100644 index 00000000..6d4b6d60 --- /dev/null +++ b/strided/chisquare/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 chi-square distribution. +* +* @module @stdlib/random/strided/chisquare +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var chisquare = require( '@stdlib/random/strided/chisquare' ); +* +* // Create an array: +* var out = new Float64Array( 10 ); +* +* // Fill the array with pseudorandom numbers: +* chisquare( out.length, [ 2.0 ], 0, out, 1 ); +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var chisquare = require( '@stdlib/random/strided/chisquare' ); +* +* // Create an array: +* var out = new Float64Array( 10 ); +* +* // Fill the array with pseudorandom numbers: +* chisquare.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 ); +*/ + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var main = require( './main.js' ); +var factory = require( './factory.js' ); + + +// MAIN // + +setReadOnly( main, 'factory', factory ); + + +// EXPORTS // + +module.exports = main; + +// exports: { "factory": "main.factory", "ndarray": "main.ndarray" } diff --git a/strided/chisquare/lib/main.js b/strided/chisquare/lib/main.js new file mode 100644 index 00000000..4e2e6aae --- /dev/null +++ b/strided/chisquare/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 chi-square distribution. +* +* @name chisquare +* @type {Function} +* @param {NonNegativeInteger} N - number of indexed elements +* @param {Collection} k - degrees of freedom +* @param {integer} sk - `k` 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: +* chisquare( out.length, [ 2.0 ], 0, out, 1 ); +*/ +var chisquare = factory(); + + +// EXPORTS // + +module.exports = chisquare; diff --git a/strided/chisquare/package.json b/strided/chisquare/package.json new file mode 100644 index 00000000..b3a607f8 --- /dev/null +++ b/strided/chisquare/package.json @@ -0,0 +1,77 @@ +{ + "name": "@stdlib/random/strided/chisquare", + "version": "0.0.0", + "description": "Fill a strided array with pseudorandom numbers drawn from a chi-square 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", + "chi2", + "chi-squared", + "chi-square", + "chisquare", + "chisquared", + "continuous", + "generator", + "seed", + "seedable", + "strided", + "array", + "vector", + "ndarray" + ] +} diff --git a/strided/chisquare/test/test.factory.js b/strided/chisquare/test/test.factory.js new file mode 100644 index 00000000..715311c5 --- /dev/null +++ b/strided/chisquare/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/chisquare' ); +var factory = require( './../lib' ).factory; + + +// VARIABLES // + +// Valid values for PRNG parameters: +var PARAM1 = randomArray( 10, 2.0, 5.0, { + 'dtype': 'generic' +}); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof factory, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function throws an error if provided an options argument which is not an object', function test( t ) { + var values; + var i; + + values = [ + '5', + 5, + NaN, + true, + false, + null, + void 0, + [], + function noop() {} + ]; + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + factory( value ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid option', function test( t ) { + var values; + var i; + + values = [ + '5', + 5, + NaN, + null, + void 0, + [], + {}, + function noop() {} + ]; + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + factory({ + 'copy': value + }); + }; + } +}); + +tape( 'the function returns a function which fills a strided array with pseudorandom numbers', function test( t ) { + var random; + var out; + var x1; + var N; + var i; + + random = factory(); + + N = 10; + + x1 = [ PARAM1[ 0 ] ]; + out = zeros( N, 'generic' ); + + random( N, x1, 0, out, 1 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out[ i ], 'number', 'returns expected value' ); + } + + x1 = randomArray( N, 2.0, 5.0, { + 'dtype': 'generic' + }); + out = zeros( N, 'generic' ); + + random( N, x1, 1, out, 1 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out[ i ], 'number', 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns a function which fills a strided array with pseudorandom numbers (accessors)', function test( t ) { + var random; + var out; + var x1; + var N; + var i; + + random = factory(); + + N = 10; + + x1 = toAccessorArray( [ PARAM1[ 0 ] ] ); + out = zeros( N, 'generic' ); + + random( N, x1, 0, out, 1 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out[ i ], 'number', 'returns expected value' ); + } + + x1 = toAccessorArray( randomArray( N, 2.0, 5.0, { + 'dtype': 'generic' + })); + out = zeros( N, 'generic' ); + + random( N, x1, 1, out, 1 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out[ i ], 'number', 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns a function which fills a strided array with pseudorandom numbers (seeded)', function test( t ) { + var random; + var rand; + var opts; + var out; + var x1; + var N; + var i; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + + N = 10; + + x1 = [ PARAM1[ 0 ] ]; + out = zeros( N, 'generic' ); + + random( N, x1, 0, out, 1 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + for ( i = 0; i < N; i++ ) { + t.strictEqual( out[ i ], rand( x1[ 0 ] ), 'returns expected value' ); + } + + x1 = randomArray( N, 2.0, 5.0, { + 'dtype': 'generic' + }); + out = zeros( N, 'generic' ); + + random = factory( opts ); + random( N, x1, 1, out, 1 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + for ( i = 0; i < N; i++ ) { + t.strictEqual( out[ i ], rand( x1[ i ] ), 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function fills a strided array with pseudorandom numbers (accessors; seeded)', function test( t ) { + var random; + var rand; + var opts; + var out; + var x1; + var N; + var i; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + + N = 10; + + x1 = toAccessorArray( [ PARAM1[ 0 ] ] ); + out = zeros( N, 'generic' ); + + random( N, x1, 0, out, 1 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + for ( i = 0; i < N; i++ ) { + t.strictEqual( out[ i ], rand( x1.get( 0 ) ), 'returns expected value' ); + } + + x1 = toAccessorArray( randomArray( N, 2.0, 5.0, { + 'dtype': 'generic' + })); + out = zeros( N, 'generic' ); + + random = factory( opts ); + random( N, x1, 1, out, 1 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + for ( i = 0; i < N; i++ ) { + t.strictEqual( out[ i ], rand( x1.get( i ) ), 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns a function which supports a stride for the first strided array', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = [ + PARAM1[ 0 ], // 0 + PARAM1[ 1 ], + PARAM1[ 2 ], // 1 + PARAM1[ 3 ], + PARAM1[ 4 ] // 2 + ]; + out = [ + 0.0, // 0 + 0.0, // 1 + 0.0, // 2 + 0.0, + 0.0 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random( N, x1, 2, out, 1 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + expected = [ + rand( x1[ 0 ] ), + rand( x1[ 2 ] ), + rand( x1[ 4 ] ), + 0.0, + 0.0 + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function which supports a stride for the first strided array (accessors)', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = toAccessorArray([ + PARAM1[ 0 ], // 0 + PARAM1[ 1 ], + PARAM1[ 2 ], // 1 + PARAM1[ 3 ], + PARAM1[ 4 ] // 2 + ]); + out = [ + 0.0, // 0 + 0.0, // 1 + 0.0, // 2 + 0.0, + 0.0 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random( N, x1, 2, toAccessorArray( out ), 1 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + expected = [ + rand( x1.get( 0 ) ), + rand( x1.get( 2 ) ), + rand( x1.get( 4 ) ), + 0.0, + 0.0 + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function which supports a stride for the output strided array', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = [ + PARAM1[ 0 ], // 0 + PARAM1[ 1 ], // 1 + PARAM1[ 2 ], // 2 + PARAM1[ 3 ], + PARAM1[ 4 ] + ]; + out = [ + 0.0, // 0 + 0.0, + 0.0, // 1 + 0.0, + 0.0 // 2 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random( N, x1, 1, out, 2 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + expected = [ + rand( x1[ 0 ] ), + 0.0, + rand( x1[ 1 ] ), + 0.0, + rand( x1[ 2 ] ) + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function which supports a stride for the output strided array (accessors)', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = toAccessorArray([ + PARAM1[ 0 ], // 0 + PARAM1[ 1 ], // 1 + PARAM1[ 2 ], // 2 + PARAM1[ 3 ], + PARAM1[ 4 ] + ]); + out = [ + 0.0, // 0 + 0.0, + 0.0, // 1 + 0.0, + 0.0 // 2 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random( N, x1, 1, toAccessorArray( out ), 2 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + expected = [ + rand( x1.get( 0 ) ), + 0.0, + rand( x1.get( 1 ) ), + 0.0, + rand( x1.get( 2 ) ) + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function which returns a reference to the output array', function test( t ) { + var random; + var actual; + var out; + var x1; + + random = factory(); + + x1 = [ PARAM1[ 0 ] ]; + out = zeros( 10, 'generic' ); + + actual = random( out.length, x1, 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, 2.0, 5.0, { + 'dtype': 'generic' + }); + out = zeros( N, 'generic' ); + + random.ndarray( N, x1, 1, 0, out, 1, 0 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out[ i ], 'number', 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns a function having an `ndarray` method which fills a strided array with pseudorandom numbers (accessors)', function test( t ) { + var random; + var out; + var x1; + var N; + var i; + + random = factory(); + + N = 10; + + x1 = toAccessorArray( [ PARAM1[ 0 ] ] ); + out = toAccessorArray( zeros( N, 'generic' ) ); + + random.ndarray( N, x1, 0, 0, out, 1, 0 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out.get( i ), 'number', 'returns expected value' ); + } + + x1 = toAccessorArray( randomArray( N, 2.0, 5.0, { + 'dtype': 'generic' + })); + out = toAccessorArray( zeros( N, 'generic' ) ); + + random.ndarray( N, x1, 1, 0, out, 1, 0 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out.get( i ), 'number', 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns a function having an `ndarray` method which fills a strided array with pseudorandom numbers (seeded)', function test( t ) { + var random; + var rand; + var opts; + var out; + var x1; + var N; + var i; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + + N = 10; + + x1 = [ PARAM1[ 0 ] ]; + out = zeros( N, 'generic' ); + + random.ndarray( N, x1, 0, 0, out, 1, 0 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + for ( i = 0; i < N; i++ ) { + t.strictEqual( out[ i ], rand( x1[ 0 ] ), 'returns expected value' ); + } + + x1 = randomArray( N, 2.0, 5.0, { + 'dtype': 'generic' + }); + out = zeros( N, 'generic' ); + + random = factory( opts ); + random.ndarray( N, x1, 1, 0, out, 1, 0 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + for ( i = 0; i < N; i++ ) { + t.strictEqual( out[ i ], rand( x1[ i ] ), 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns a function having an `ndarray` method which fills a strided array with pseudorandom numbers (accessors; seeded)', function test( t ) { + var random; + var rand; + var opts; + var out; + var x1; + var N; + var i; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + + N = 10; + + x1 = toAccessorArray( [ PARAM1[ 0 ] ] ); + out = toAccessorArray( zeros( N, 'generic' ) ); + + random.ndarray( N, x1, 0, 0, out, 1, 0 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + for ( i = 0; i < N; i++ ) { + t.strictEqual( out.get( i ), rand( x1.get( 0 ) ), 'returns expected value' ); + } + + x1 = toAccessorArray( randomArray( N, 2.0, 5.0, { + 'dtype': 'generic' + })); + out = toAccessorArray( zeros( N, 'generic' ) ); + + random = factory( opts ); + random.ndarray( N, x1, 1, 0, out, 1, 0 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + for ( i = 0; i < N; i++ ) { + t.strictEqual( out.get( i ), rand( x1.get( i ) ), 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns a function having an `ndarray` method which supports a stride for the first strided array', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = [ + PARAM1[ 0 ], // 0 + PARAM1[ 1 ], + PARAM1[ 2 ], // 1 + PARAM1[ 3 ], + PARAM1[ 4 ] // 2 + ]; + out = [ + 0.0, // 0 + 0.0, // 1 + 0.0, // 2 + 0.0, + 0.0 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random.ndarray( N, x1, 2, 0, out, 1, 0 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + expected = [ + rand( x1[ 0 ] ), + rand( x1[ 2 ] ), + rand( x1[ 4 ] ), + 0.0, + 0.0 + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function having an `ndarray` method which supports a stride for the first strided array (accessors)', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = toAccessorArray([ + PARAM1[ 0 ], // 0 + PARAM1[ 1 ], + PARAM1[ 2 ], // 1 + PARAM1[ 3 ], + PARAM1[ 4 ] // 2 + ]); + out = [ + 0.0, // 0 + 0.0, // 1 + 0.0, // 2 + 0.0, + 0.0 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random.ndarray( N, x1, 2, 0, toAccessorArray( out ), 1, 0 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + expected = [ + rand( x1.get( 0 ) ), + rand( x1.get( 2 ) ), + rand( x1.get( 4 ) ), + 0.0, + 0.0 + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function having an `ndarray` method which supports an offset for the first strided array', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = [ + PARAM1[ 0 ], + PARAM1[ 1 ], + PARAM1[ 2 ], // 0 + PARAM1[ 3 ], // 1 + PARAM1[ 4 ] // 2 + ]; + out = [ + 0.0, // 0 + 0.0, // 1 + 0.0, // 2 + 0.0, + 0.0 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random.ndarray( N, x1, 1, 2, out, 1, 0 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + expected = [ + rand( x1[ 2 ] ), + rand( x1[ 3 ] ), + rand( x1[ 4 ] ), + 0.0, + 0.0 + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function having an `ndarray` method which supports an offset for the first strided array (accessors)', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = toAccessorArray([ + PARAM1[ 0 ], + PARAM1[ 1 ], + PARAM1[ 2 ], // 0 + PARAM1[ 3 ], // 1 + PARAM1[ 4 ] // 2 + ]); + out = [ + 0.0, // 0 + 0.0, // 1 + 0.0, // 2 + 0.0, + 0.0 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random.ndarray( N, x1, 1, 2, toAccessorArray( out ), 1, 0 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + expected = [ + rand( x1.get( 2 ) ), + rand( x1.get( 3 ) ), + rand( x1.get( 4 ) ), + 0.0, + 0.0 + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function having an `ndarray` method which supports a stride for the output strided array', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = [ + PARAM1[ 0 ], // 0 + PARAM1[ 1 ], // 1 + PARAM1[ 2 ], // 2 + PARAM1[ 3 ], + PARAM1[ 4 ] + ]; + out = [ + 0.0, // 0 + 0.0, + 0.0, // 1 + 0.0, + 0.0 // 2 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random.ndarray( N, x1, 1, 0, out, 2, 0 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + expected = [ + rand( x1[ 0 ] ), + 0.0, + rand( x1[ 1 ] ), + 0.0, + rand( x1[ 2 ] ) + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function having an `ndarray` method which supports a stride for the output strided array (accessors)', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = toAccessorArray([ + PARAM1[ 0 ], // 0 + PARAM1[ 1 ], // 1 + PARAM1[ 2 ], // 2 + PARAM1[ 3 ], + PARAM1[ 4 ] + ]); + out = [ + 0.0, // 0 + 0.0, + 0.0, // 1 + 0.0, + 0.0 // 2 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random.ndarray( N, x1, 1, 0, toAccessorArray( out ), 2, 0 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + expected = [ + rand( x1.get( 0 ) ), + 0.0, + rand( x1.get( 1 ) ), + 0.0, + rand( x1.get( 2 ) ) + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function having an `ndarray` method which supports an offset for the output strided array', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = [ + PARAM1[ 0 ], // 0 + PARAM1[ 1 ], // 1 + PARAM1[ 2 ], // 2 + PARAM1[ 3 ], + PARAM1[ 4 ] + ]; + out = [ + 0.0, + 0.0, + 0.0, // 0 + 0.0, // 1 + 0.0 // 2 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random.ndarray( N, x1, 1, 0, out, 1, 2 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + expected = [ + 0.0, + 0.0, + rand( x1[ 0 ] ), + rand( x1[ 1 ] ), + rand( x1[ 2 ] ) + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function having an `ndarray` method which supports an offset for the output strided array (accessors)', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = toAccessorArray([ + PARAM1[ 0 ], // 0 + PARAM1[ 1 ], // 1 + PARAM1[ 2 ], // 2 + PARAM1[ 3 ], + PARAM1[ 4 ] + ]); + out = [ + 0.0, + 0.0, + 0.0, // 0 + 0.0, // 1 + 0.0 // 2 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random.ndarray( N, x1, 1, 0, toAccessorArray( out ), 1, 2 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + expected = [ + 0.0, + 0.0, + rand( x1.get( 0 ) ), + rand( x1.get( 1 ) ), + rand( x1.get( 2 ) ) + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function having an `ndarray` method which returns a reference to the output array', function test( t ) { + var random; + var actual; + var out; + var x1; + + random = factory(); + + x1 = [ PARAM1[ 0 ] ]; + out = zeros( 10, 'generic' ); + + actual = random.ndarray( out.length, x1, 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/chisquare/test/test.js b/strided/chisquare/test/test.js new file mode 100644 index 00000000..e7fde2ad --- /dev/null +++ b/strided/chisquare/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/chisquare/test/test.main.js b/strided/chisquare/test/test.main.js new file mode 100644 index 00000000..cf5ad5d6 --- /dev/null +++ b/strided/chisquare/test/test.main.js @@ -0,0 +1,176 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var zeros = require( '@stdlib/array/zeros' ); +var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +var randomArray = require( './../../../array/uniform' ); +var random = require( './../lib' ); + + +// VARIABLES // + +// Valid values for PRNG parameters: +var PARAM1 = randomArray( 10, 2.0, 5.0, { + 'dtype': 'generic' +}); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof random, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function fills a strided array with pseudorandom numbers', function test( t ) { + var out; + var x1; + var N; + var i; + + N = 10; + + x1 = [ PARAM1[ 0 ] ]; + out = zeros( N, 'generic' ); + + random( N, x1, 0, out, 1 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out[ i ], 'number', 'returns expected value' ); + } + + x1 = randomArray( N, 2.0, 5.0, { + 'dtype': 'generic' + }); + out = zeros( N, 'generic' ); + + random( N, x1, 1, out, 1 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out[ i ], 'number', 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function fills a strided array with pseudorandom numbers (accessors)', function test( t ) { + var out; + var x1; + var N; + var i; + + N = 10; + + x1 = toAccessorArray( [ PARAM1[ 0 ] ] ); + out = zeros( N, 'generic' ); + + random( N, x1, 0, out, 1 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out[ i ], 'number', 'returns expected value' ); + } + + x1 = toAccessorArray( randomArray( N, 2.0, 5.0, { + 'dtype': 'generic' + })); + out = zeros( N, 'generic' ); + + random( N, x1, 1, out, 1 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out[ i ], 'number', 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns a reference to the output array', function test( t ) { + var actual; + var out; + var x1; + + x1 = [ PARAM1[ 0 ] ]; + out = zeros( 10, 'generic' ); + + actual = random( out.length, x1, 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/chisquare/test/test.ndarray.js b/strided/chisquare/test/test.ndarray.js new file mode 100644 index 00000000..cf372493 --- /dev/null +++ b/strided/chisquare/test/test.ndarray.js @@ -0,0 +1,176 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var zeros = require( '@stdlib/array/zeros' ); +var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +var randomArray = require( './../../../array/uniform' ); +var random = require( './../lib' ).ndarray; + + +// VARIABLES // + +// Valid values for PRNG parameters: +var PARAM1 = randomArray( 10, 2.0, 5.0, { + 'dtype': 'generic' +}); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof random, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function fills a strided array with pseudorandom numbers', function test( t ) { + var out; + var x1; + var N; + var i; + + N = 10; + + x1 = [ PARAM1[ 0 ] ]; + out = zeros( N, 'generic' ); + + random( N, x1, 0, 0, out, 1, 0 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out[ i ], 'number', 'returns expected value' ); + } + + x1 = randomArray( N, 2.0, 5.0, { + 'dtype': 'generic' + }); + out = zeros( N, 'generic' ); + + random( N, x1, 1, 0, out, 1, 0 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out[ i ], 'number', 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function fills a strided array with pseudorandom numbers (accessors)', function test( t ) { + var out; + var x1; + var N; + var i; + + N = 10; + + x1 = toAccessorArray( [ PARAM1[ 0 ] ] ); + out = toAccessorArray( zeros( N, 'generic' ) ); + + random( N, x1, 0, 0, out, 1, 0 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out.get( i ), 'number', 'returns expected value' ); + } + + x1 = toAccessorArray( randomArray( N, 2.0, 5.0, { + 'dtype': 'generic' + })); + out = toAccessorArray( zeros( N, 'generic' ) ); + + random( N, x1, 1, 0, out, 1, 0 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out.get( i ), 'number', 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns a reference to the output array', function test( t ) { + var actual; + var out; + var x1; + + x1 = [ PARAM1[ 0 ] ]; + out = zeros( 10, 'generic' ); + + actual = random( out.length, x1, 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 4efb1124..6c3a1057 100644 --- a/strided/lib/index.js +++ b/strided/lib/index.js @@ -81,6 +81,15 @@ setReadOnly( ns, 'betaprime', require( './../../strided/betaprime' ) ); */ setReadOnly( ns, 'chi', require( './../../strided/chi' ) ); +/** +* @name chisquare +* @memberof ns +* @readonly +* @type {Function} +* @see {@link module:@stdlib/random/strided/chisquare} +*/ +setReadOnly( ns, 'chisquare', require( './../../strided/chisquare' ) ); + /** * @name cosine * @memberof ns