@stdlib/random-base-chi
Version:
Chi distributed pseudorandom numbers.
8 lines (7 loc) • 2.32 kB
JavaScript
;var c=function(a,t){return function(){return t||a((t={exports:{}}).exports,t),t.exports}};var p=c(function(C,q){
var s=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),o=require('@stdlib/utils-define-nonenumerable-read-only-accessor/dist'),v=require('@stdlib/utils-define-nonenumerable-read-write-accessor/dist'),j=require('@stdlib/assert-is-positive-number/dist').isPrimitive,l=require('@stdlib/assert-is-plain-object/dist'),f=require('@stdlib/assert-is-function/dist'),m=require('@stdlib/assert-has-own-property/dist'),h=require('@stdlib/utils-constant-function/dist'),x=require('@stdlib/utils-noop/dist'),F=require('@stdlib/math-base-assert-is-nan/dist'),u=require('@stdlib/random-base-chisquare/dist').factory,G=require('@stdlib/array-to-json/dist'),d=require('@stdlib/math-base-special-sqrt/dist'),g=require('@stdlib/error-tools-fmtprodmsg/dist');function J(){var a,t,r,e,i;if(arguments.length===0)a=u();else if(arguments.length===1&&l(arguments[0]))if(r=arguments[0],m(r,"prng")){if(!f(r.prng))throw new TypeError(g('0o56u',"prng",r.prng));a=u({prng:r.prng})}else a=u(r);else{if(i=arguments[0],!j(i))throw new TypeError(g('0o571',i));if(arguments.length>1){if(r=arguments[1],!l(r))throw new TypeError(g('0o52V',r));if(m(r,"prng")){if(!f(r.prng))throw new TypeError(g('0o56u',"prng",r.prng));a=u(i,{prng:r.prng})}else a=u(i,r)}else a=u(i)}return i===void 0?e=T:e=A,t=a.PRNG,s(e,"NAME","chi"),r&&r.prng?(s(e,"seed",null),s(e,"seedLength",null),v(e,"state",h(null),x),s(e,"stateLength",null),s(e,"byteLength",null),s(e,"toJSON",h(null))):(o(e,"seed",O),o(e,"seedLength",N),v(e,"state",R,E),o(e,"stateLength",S),o(e,"byteLength",w),s(e,"toJSON",P)),s(e,"PRNG",t),e;function O(){return t.seed}function N(){return t.seedLength}function S(){return t.stateLength}function w(){return t.byteLength}function R(){return t.state}function E(n){t.state=n}function P(){var n={};return n.type="PRNG",n.name=e.NAME,n.state=G(t.state),i===void 0?n.params=[]:n.params=[i],n}function A(){return d(a())}function T(n){return F(n)||n<=0?NaN:d(a(n))}}q.exports=J
});var b=c(function(D,y){
var M=p(),V=M();y.exports=V
});var z=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),L=b(),W=p();z(L,"factory",W);module.exports=L;
/** @license Apache-2.0 */
//# sourceMappingURL=index.js.map