-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
18 lines (18 loc) · 5.35 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"use strict";var g=function(e,a){return function(){return a||e((a={exports:{}}).exports,a),a.exports}};var E=g(function(De,O){
var R=require('@stdlib/constants-float64-pinf/dist'),U=require('@stdlib/math-base-assert-is-integer/dist');function G(e){return typeof e=="object"&&e!==null&&typeof e.length=="number"&&U(e.length)&&e.length>=0&&e.length<R}O.exports=G
});var x=g(function(Se,T){
var m=require('@stdlib/ndarray-defaults/dist');function _(){return{casting:m.get("casting"),copy:!1,dtype:m.get("dtypes.default"),flatten:!0,mode:m.get("index_mode"),ndmin:0,order:m.get("order"),readonly:!1}}T.exports=_
});var k=g(function(Ae,j){
var H=require('@stdlib/ndarray-base-buffer-ctors/dist'),J=require('@stdlib/buffer-alloc-unsafe/dist');function K(e,a,r){var o,i,t;if(o=H(r),r==="generic")for(i=[],t=0;t<a;t++)i.push(e[t]);else if(r==="binary")for(i=J(a),t=0;t<a;t++)i[t]=e[t];else for(i=new o(a),t=0;t<a;t++)i[t]=e[t];return i}j.exports=K
});var D=g(function(Ne,B){
var Q=require('@stdlib/ndarray-base-buffer-ctors/dist'),W=require('@stdlib/buffer-alloc-unsafe/dist');function X(e){var a,r,o;for(a=e.length,r=[],o=0;o<a;o++)r.push(e.get(o));return r}function Y(e){var a,r,o;for(a=e.length,r=W(a),o=0;o<a;o++)r[o]=e.get(o);return r}function Z(e,a){var r,o,i,t;for(r=Q(a),o=e.length,i=new r(o),t=0;t<o;t++)i[t]=e.get(t);return i}function $(e,a){return a==="generic"?X(e):a==="binary"?Y(e):Z(e,a)}B.exports=$
});var A=g(function(Ce,S){
function ee(e,a,r){var o,i;for(o=[],i=0;i<r-e;i++)o.push(1);for(i=0;i<e;i++)o.push(a[i]);return o}S.exports=ee
});var C=g(function(Ve,N){
var re=require('@stdlib/math-base-special-abs/dist');function ie(e,a,r,o){var i,t,u,n,f;if(t=r.length,f=e-t,i=[],o==="row-major"){for(u=re(r[0])*a[f],n=0;n<f;n++)i.push(u);for(n=0;n<t;n++)i.push(r[n])}else{for(n=0;n<f;n++)i.push(1);for(n=0;n<t;n++)i.push(r[n])}return i}N.exports=ie
});var M=g(function(Le,I){
var d=require('@stdlib/assert-has-own-property/dist'),V=require('@stdlib/assert-is-plain-object/dist'),L=require('@stdlib/assert-is-boolean/dist').isPrimitive,te=require('@stdlib/assert-is-array/dist'),ae=require('@stdlib/assert-is-nonnegative-integer/dist').isPrimitive,ne=require('@stdlib/assert-is-ndarray-like/dist'),oe=require('@stdlib/ndarray-base-shape2strides/dist'),se=require('@stdlib/ndarray-base-strides2offset/dist'),ue=require('@stdlib/ndarray-base-strides2order/dist'),h=require('@stdlib/ndarray-base-numel/dist'),fe=require('@stdlib/ndarray-ctor/dist'),pe=require('@stdlib/ndarray-base-assert-is-data-type/dist'),de=require('@stdlib/ndarray-base-assert-is-order/dist'),le=require('@stdlib/ndarray-base-assert-is-casting-mode/dist'),ve=require('@stdlib/ndarray-base-assert-is-allowed-data-type-cast/dist'),ce=require('@stdlib/ndarray-base-buffer/dist'),ge=require('@stdlib/ndarray-base-buffer-dtype/dist'),ye=require('@stdlib/ndarray-dtype/dist'),me=require('@stdlib/ndarray-shape/dist'),P=require('@stdlib/ndarray-strides/dist'),he=require('@stdlib/ndarray-offset/dist'),z=require('@stdlib/ndarray-order/dist'),qe=require('@stdlib/ndarray-data-buffer/dist'),F=require('@stdlib/array-shape/dist'),we=require('@stdlib/array-base-flatten/dist'),p=require('@stdlib/error-tools-fmtprodmsg/dist'),q=E(),be=x(),Oe=k(),Ee=D(),Te=A(),xe=C(),l=be();function je(){var e,a,r,o,i,t,u,n,f,v,s,w,c,b,y;if(arguments.length===1)if(q(arguments[0]))r=arguments[0],e={};else{if(e=arguments[0],!V(e))throw new TypeError(p('0hT56',e));if(d(e,"buffer")&&(r=e.buffer,!q(r)))throw new TypeError(p('0hT57',"buffer",r))}else{if(r=arguments[0],!q(r))throw new TypeError(p('0hT58',r));if(e=arguments[1],!V(e))throw new TypeError(p('0hT2V',e))}if(r&&(ne(r)?(u=ye(r),y=!0):(u=ge(r),y=!1)),v={},s={},d(e,"casting")){if(s.casting=e.casting,!le(s.casting))throw new TypeError(p('0hT59',"casting",s.casting))}else s.casting=l.casting;if(d(e,"flatten")){if(s.flatten=e.flatten,!L(s.flatten))throw new TypeError(p('0hT2o',"flatten",s.flatten))}else s.flatten=l.flatten;if(d(e,"ndmin")){if(s.ndmin=e.ndmin,!ae(s.ndmin))throw new TypeError(p('0hT2t',"ndmin",s.ndmin))}else s.ndmin=l.ndmin;if(d(e,"dtype")){if(t=e.dtype,!pe(t))throw new TypeError(p('0hTBf',"dtype",t));if(u&&!ve(u,t,s.casting))throw new Error(p('0hT5B',s.casting,u,t))}else u?!y&&u==="generic"?t=l.dtype:t=u:t=l.dtype;if(d(e,"order")){if(i=e.order,i==="any"||i==="same")y?i==="any"?(b=ue(P(r)),b===3?i=l.order:i=z(r)):i==="same"&&(i=z(r)):i=l.order;else if(!de(i))throw new TypeError(p('0hT5C',"order",i))}else i=l.order;if(d(e,"mode")?v.mode=e.mode:v.mode=l.mode,d(e,"submode")?v.submode=e.submode:v.submode=[v.mode],d(e,"readonly")?v.readonly=e.readonly:v.readonly=l.readonly,d(e,"copy")){if(s.copy=e.copy,!L(s.copy))throw new TypeError(p('0hT2o',"copy",s.copy))}else s.copy=l.copy;if(d(e,"shape")){if(n=e.shape,!q(n))throw new TypeError(p('0hT5D',"shape",n));f=n.length,c=h(n)}else if(r)y?(n=me(r),f=n.length,c=h(n)):s.flatten&&te(r)?(n=F(r),w=n,f=n.length,c=h(n)):(f=1,c=r.length,n=[c]);else throw new Error(p('0hT0X'));if(f<s.ndmin&&(n=Te(f,n,s.ndmin),f=s.ndmin),y){if(h(r.shape)!==c)throw new RangeError(p('0hT0Y'));u!==t||s.copy?r=Ee(r,t):(a=P(r),o=he(r),r=qe(r),a.length<f&&(a=xe(f,n,a,i)))}else if(r){if(u==="generic"&&s.flatten&&(r=we(r,w||F(r),!1)),r.length!==c)throw new RangeError(p('0hT0Y'));(u!==t||s.copy)&&(r=Oe(r,c,t))}else r=ce(t,c);return a===void 0&&(a=oe(n,i),o=se(n,a)),new fe(t,r,n,a,o,i,v)}I.exports=je
});var ke=M();module.exports=ke;
/** @license Apache-2.0 */
/** @license Apache-2.0 */
//# sourceMappingURL=index.js.map