@stdlib/esm
Version:
ES module distribution for Stdlib, a standard library for JavaScript and Node.js.
3 lines • 3.06 kB
JavaScript
// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
import e from"./../../../../assert/is-nonnegative-integer.js";import t from"./../../../../utils/define-property.js";import r from"./../../../../utils/define-nonenumerable-read-only-property.js";import n from"./../../../../utils/define-nonenumerable-read-only-accessor.js";import i from"./kurtosis.js";import o from"./mean.js";import a from"./mode.js";import s from"./skewness.js";import u from"./stdev.js";import l from"./variance.js";import f from"./cdf.js";import m from"./logpmf.js";import p from"./pmf.js";import h from"./quantile.js";var g=e.isPrimitive,v=t,w=r,c=n,d=i,b=o,y=a,N=s,j=u,K=l,E=f,V=m,q=p,M=h;function R(e){return E(e,this.N,this.K,this.n)}function T(e){return V(e,this.N,this.K,this.n)}function k(e){return q(e,this.N,this.K,this.n)}function z(e){return M(e,this.N,this.K,this.n)}function P(e,t,r){if(!(this instanceof P))return new P(e,t,r);if(!g(e))throw new TypeError("invalid argument. Population size `N` must be a nonnegative integer. Value: `"+e+"`");if(!g(t))throw new TypeError("invalid argument. Subpopulation size `K` must be a nonnegative integer. Value: `"+t+"`");if(!g(r))throw new TypeError("invalid argument. Number of draws `n` must be a nonnegative integer. Value: `"+r+"`");if(t>e)throw new RangeError("invalid arguments. Subpopulation size `K` must be smaller than or equal to `N`.");if(r>e)throw new RangeError("invalid arguments. Number of draws `n` must be smaller than or equal to `N`.");return v(this,"N",{configurable:!1,enumerable:!0,get:function(){return e},set:function(n){if(!g(n))throw new TypeError("invalid value. Must be a nonnegative integer. Value: `"+n+"`");if(t>n)throw new RangeError("invalid value. Must be larger than or equal to `K`. Value: `"+n+"`");if(r>n)throw new RangeError("invalid value. Must be larger than or equal to `n`. Value: `"+n+"`");e=n}}),v(this,"K",{configurable:!1,enumerable:!0,get:function(){return t},set:function(r){if(!g(r))throw new TypeError("invalid value. Must be a nonnegative integer. Value: `"+r+"`");if(r>e)throw new RangeError("invalid value. Must be smaller than or equal to `N`. Value: `"+r+"`");t=r}}),v(this,"n",{configurable:!1,enumerable:!0,get:function(){return r},set:function(t){if(!g(t))throw new TypeError("invalid value. Must be a nonnegative integer. Value: `"+t+"`");if(t>e)throw new RangeError("invalid value. Must be smaller than or equal to `N`. Value: `"+t+"`");r=t}}),this}c(P.prototype,"kurtosis",(function(){return d(this.N,this.K,this.n)})),c(P.prototype,"mean",(function(){return b(this.N,this.K,this.n)})),c(P.prototype,"mode",(function(){return y(this.N,this.K,this.n)})),c(P.prototype,"skewness",(function(){return N(this.N,this.K,this.n)})),c(P.prototype,"stdev",(function(){return j(this.N,this.K,this.n)})),c(P.prototype,"variance",(function(){return K(this.N,this.K,this.n)})),w(P.prototype,"cdf",R),w(P.prototype,"logpmf",T),w(P.prototype,"pmf",k),w(P.prototype,"quantile",z);var S=P;export default S;
//# sourceMappingURL=ctor.js.map