UNPKG

@stdlib/esm

Version:

ES module distribution for Stdlib, a standard library for JavaScript and Node.js.

3 lines 1.08 kB
// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 import r from"./../../../utils/define-nonenumerable-read-only-property.js";import e from"./../../../math/base/assert/is-negative-zero.js";import t from"./../../../math/base/assert/is-nan.js";var n=[701,301,132,57,23,10,4,1],o=e,a=t,f=n,i=f.length;function s(r,e,t,n,s,m){var u,l,p,v,d,h,b,g,j,y;if(r<=0||0===e)return t;for(e<0&&(n*=-1,m*=-1),u=n<0?(1-r)*n:0,l=m<0?(1-r)*m:0,g=0;g<i;g++)for(j=v=f[g];j<r;j++)if(d=t[u+j*n],!a(d)){for(h=s[l+j*m],p=o(d),y=j;y>=v&&(!((b=t[u+(y-v)*n])<=d)||p&&b===d);y-=v)t[u+y*n]=b,s[l+y*m]=s[l+(y-v)*m];t[u+y*n]=d,s[l+y*m]=h}return t}var m=e,u=t,l=n,p=l.length;function v(r,e,t,n,o,a,f,i){var s,v,d,h,b,g,j,y;if(r<=0||0===e)return t;for(e<0&&(o-=(r-1)*(n*=-1),i-=(r-1)*(f*=-1)),g=0;g<p;g++)for(j=v=l[g];j<r;j++)if(d=t[o+j*n],!u(d)){for(h=a[i+j*f],s=m(d),y=j;y>=v&&(!((b=t[o+(y-v)*n])<=d)||s&&b===d);y-=v)t[o+y*n]=b,a[i+y*f]=a[i+(y-v)*f];t[o+y*n]=d,a[i+y*f]=h}return t}var d=r,h=s,b=v;d(h,"ndarray",b);export default h; //# sourceMappingURL=dsort2sh.js.map