@stdlib/blas-base-scopy
Advanced tools
+6
-6
@@ -1,7 +0,7 @@ | ||
| "use strict";var p=function(n,e){return function(){return e||n((e={exports:{}}).exports,e),e.exports}};var j=p(function(F,l){ | ||
| var q=8;function g(n,e,f,u,a){var o,t,i,r;if(n<=0)return u;if(f===1&&a===1){if(i=n%q,i>0)for(r=0;r<i;r++)u[r]=e[r];if(n<q)return u;for(r=i;r<n;r+=q)u[r]=e[r],u[r+1]=e[r+1],u[r+2]=e[r+2],u[r+3]=e[r+3],u[r+4]=e[r+4],u[r+5]=e[r+5],u[r+6]=e[r+6],u[r+7]=e[r+7];return u}for(f<0?o=(1-n)*f:o=0,a<0?t=(1-n)*a:t=0,r=0;r<n;r++)u[t]=e[o],o+=f,t+=a;return u}l.exports=g | ||
| });var R=p(function(G,M){ | ||
| var s=8;function h(n,e,f,u,a,o,t){var i,r,c,v;if(n<=0)return a;if(i=u,r=t,f===1&&o===1){if(c=n%s,c>0)for(v=0;v<c;v++)a[r]=e[i],i+=f,r+=o;if(n<s)return a;for(v=c;v<n;v+=s)a[r]=e[i],a[r+1]=e[i+1],a[r+2]=e[i+2],a[r+3]=e[i+3],a[r+4]=e[i+4],a[r+5]=e[i+5],a[r+6]=e[i+6],a[r+7]=e[i+7],i+=s,r+=s;return a}for(v=0;v<n;v++)a[r]=e[i],i+=f,r+=o;return a}M.exports=h | ||
| });var O=p(function(H,E){ | ||
| var k=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),_=j(),w=R();k(_,"ndarray",w);E.exports=_ | ||
| "use strict";var q=function(u,r){return function(){return r||u((r={exports:{}}).exports,r),r.exports}};var p=q(function(F,j){ | ||
| var o=8;function d(u,r,n,s,e,v,f){var a,i,c,t;if(u<=0)return e;if(a=s,i=f,n===1&&v===1){if(c=u%o,c>0)for(t=0;t<c;t++)e[i]=r[a],a+=n,i+=v;if(u<o)return e;for(t=c;t<u;t+=o)e[i]=r[a],e[i+1]=r[a+1],e[i+2]=r[a+2],e[i+3]=r[a+3],e[i+4]=r[a+4],e[i+5]=r[a+5],e[i+6]=r[a+6],e[i+7]=r[a+7],a+=o,i+=o;return e}for(t=0;t<u;t++)e[i]=r[a],a+=n,i+=v;return e}j.exports=d | ||
| });var _=q(function(G,R){ | ||
| var l=require('@stdlib/strided-base-stride2offset/dist'),g=p();function h(u,r,n,s,e){var v,f;return u<=0?s:(v=l(u,n),f=l(u,e),g(u,r,n,v,s,e,f))}R.exports=h | ||
| });var O=q(function(H,M){ | ||
| var k=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),E=_(),w=p();k(E,"ndarray",w);M.exports=E | ||
| });var z=require("path").join,A=require('@stdlib/utils-try-require/dist'),B=require('@stdlib/assert-is-error/dist'),C=O(),m,b=A(z(__dirname,"./native.js"));B(b)?m=C:m=b;module.exports=m; | ||
@@ -8,0 +8,0 @@ /** @license Apache-2.0 */ |
| { | ||
| "version": 3, | ||
| "sources": ["../lib/scopy.js", "../lib/ndarray.js", "../lib/main.js", "../lib/index.js"], | ||
| "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Copies values from `x` into `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array-float32' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* scopy( x.length, x, 1, y, 1 );\n* // y => <Float32Array>[ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction scopy( N, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ i ] = x[ i ];\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ i ] = x[ i ];\n\t\t\ty[ i+1 ] = x[ i+1 ];\n\t\t\ty[ i+2 ] = x[ i+2 ];\n\t\t\ty[ i+3 ] = x[ i+3 ];\n\t\t\ty[ i+4 ] = x[ i+4 ];\n\t\t\ty[ i+5 ] = x[ i+5 ];\n\t\t\ty[ i+6 ] = x[ i+6 ];\n\t\t\ty[ i+7 ] = x[ i+7 ];\n\t\t}\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] = x[ ix ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Copies values from `x` into `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array-float32' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* scopy( x.length, x, 1, 0, y, 1, 0 );\n* // y => <Float32Array>[ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction scopy( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ iy ] = x[ ix ];\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ iy ] = x[ ix ];\n\t\t\ty[ iy+1 ] = x[ ix+1 ];\n\t\t\ty[ iy+2 ] = x[ ix+2 ];\n\t\t\ty[ iy+3 ] = x[ ix+3 ];\n\t\t\ty[ iy+4 ] = x[ ix+4 ];\n\t\t\ty[ iy+5 ] = x[ ix+5 ];\n\t\t\ty[ iy+6 ] = x[ ix+6 ];\n\t\t\ty[ iy+7 ] = x[ ix+7 ];\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn y;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] = x[ ix ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See 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 scopy = require( './scopy.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( scopy, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = scopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to copy values from `x` into `y`.\n*\n* @module @stdlib/blas-base-scopy\n*\n* @example\n* var Float32Array = require( '@stdlib/array-float32' );\n* var scopy = require( '@stdlib/blas-base-scopy' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* scopy( x.length, x, 1, y, 1 );\n* // y => <Float32Array>[ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array-float32' );\n* var scopy = require( '@stdlib/blas-base-scopy' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* scopy.ndarray( x.length, x, 1, 0, y, 1, 0 );\n* // y => <Float32Array>[ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils-try-require' );\nvar isError = require( '@stdlib/assert-is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar scopy;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tscopy = main;\n} else {\n\tscopy = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scopy;\n\n// exports: { \"ndarray\": \"scopy.ndarray\" }\n"], | ||
| "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAI,EAwBR,SAASC,EAAOC,EAAGC,EAAGC,EAASC,EAAGC,EAAU,CAC3C,IAAIC,EACAC,EACAC,EACAC,EACJ,GAAKR,GAAK,EACT,OAAOG,EAGR,GAAKD,IAAY,GAAKE,IAAY,EAAI,CAIrC,GAHAG,EAAIP,EAAIF,EAGHS,EAAI,EACR,IAAMC,EAAI,EAAGA,EAAID,EAAGC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AAKL,EAAIF,EACR,OAAOM,EAER,IAAMM,EAAID,EAAGC,EAAIV,EAAGU,GAAKZ,EACxBM,EAAGI,CAAG,EAAIP,EAAGM,CAAG,EAChBH,EAAGI,EAAG,CAAE,EAAIP,EAAGM,EAAG,CAAE,EACpBH,EAAGI,EAAG,CAAE,EAAIP,EAAGM,EAAG,CAAE,EACpBH,EAAGI,EAAG,CAAE,EAAIP,EAAGM,EAAG,CAAE,EACpBH,EAAGI,EAAG,CAAE,EAAIP,EAAGM,EAAG,CAAE,EACpBH,EAAGI,EAAG,CAAE,EAAIP,EAAGM,EAAG,CAAE,EACpBH,EAAGI,EAAG,CAAE,EAAIP,EAAGM,EAAG,CAAE,EACpBH,EAAGI,EAAG,CAAE,EAAIP,EAAGM,EAAG,CAAE,EACpBA,GAAMT,EACNU,GAAMV,EAEP,OAAOM,CACR,CACA,IAAMM,EAAI,EAAGA,EAAIV,EAAGU,IACnBN,EAAGI,CAAG,EAAIP,EAAGM,CAAG,EAChBA,GAAML,EACNM,GAAMH,EAEP,OAAOD,CACR,CAKAP,EAAO,QAAUE,ICnGjB,IAAAY,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAc,QAAS,uDAAwD,EAC/EC,EAAQ,IACRC,EAAU,IAKdF,EAAaC,EAAO,UAAWC,CAAQ,EAKvCH,EAAO,QAAUE,ICcjB,IAAIE,EAAO,QAAS,MAAO,EAAE,KACzBC,EAAa,QAAS,2BAA4B,EAClDC,EAAU,QAAS,yBAA0B,EAC7CC,EAAO,IAKPC,EACAC,EAAMJ,EAAYD,EAAM,UAAW,aAAc,CAAE,EAClDE,EAASG,CAAI,EACjBD,EAAQD,EAERC,EAAQC,EAMT,OAAO,QAAUD", | ||
| "names": ["require_scopy", "__commonJSMin", "exports", "module", "M", "scopy", "N", "x", "strideX", "y", "strideY", "ix", "iy", "m", "i", "require_ndarray", "__commonJSMin", "exports", "module", "M", "scopy", "N", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "ix", "iy", "m", "i", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "scopy", "ndarray", "join", "tryRequire", "isError", "main", "scopy", "tmp"] | ||
| "sources": ["../lib/ndarray.js", "../lib/scopy.js", "../lib/main.js", "../lib/index.js"], | ||
| "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Copies values from `x` into `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array-float32' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* scopy( x.length, x, 1, 0, y, 1, 0 );\n* // y => <Float32Array>[ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction scopy( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar i;\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ iy ] = x[ ix ];\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ iy ] = x[ ix ];\n\t\t\ty[ iy+1 ] = x[ ix+1 ];\n\t\t\ty[ iy+2 ] = x[ ix+2 ];\n\t\t\ty[ iy+3 ] = x[ ix+3 ];\n\t\t\ty[ iy+4 ] = x[ ix+4 ];\n\t\t\ty[ iy+5 ] = x[ ix+5 ];\n\t\t\ty[ iy+6 ] = x[ ix+6 ];\n\t\t\ty[ iy+7 ] = x[ ix+7 ];\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn y;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] = x[ ix ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar stride2offset = require( '@stdlib/strided-base-stride2offset' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Copies values from `x` into `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Float32Array} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Float32Array} output array\n*\n* @example\n* var Float32Array = require( '@stdlib/array-float32' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* scopy( x.length, x, 1, y, 1 );\n* // y => <Float32Array>[ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction scopy( N, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tix = stride2offset( N, strideX );\n\tiy = stride2offset( N, strideY );\n\treturn ndarray( N, x, strideX, ix, y, strideY, iy );\n}\n\n\n// EXPORTS //\n\nmodule.exports = scopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See 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 scopy = require( './scopy.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( scopy, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = scopy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to copy values from `x` into `y`.\n*\n* @module @stdlib/blas-base-scopy\n*\n* @example\n* var Float32Array = require( '@stdlib/array-float32' );\n* var scopy = require( '@stdlib/blas-base-scopy' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* scopy( x.length, x, 1, y, 1 );\n* // y => <Float32Array>[ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array-float32' );\n* var scopy = require( '@stdlib/blas-base-scopy' );\n*\n* var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n* var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n*\n* scopy.ndarray( x.length, x, 1, 0, y, 1, 0 );\n* // y => <Float32Array>[ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\n\n// MODULES //\n\nvar join = require( 'path' ).join;\nvar tryRequire = require( '@stdlib/utils-try-require' );\nvar isError = require( '@stdlib/assert-is-error' );\nvar main = require( './main.js' );\n\n\n// MAIN //\n\nvar scopy;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tscopy = main;\n} else {\n\tscopy = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = scopy;\n\n// exports: { \"ndarray\": \"scopy.ndarray\" }\n"], | ||
| "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAI,EA0BR,SAASC,EAAOC,EAAGC,EAAGC,EAASC,EAASC,EAAGC,EAASC,EAAU,CAC7D,IAAIC,EACAC,EACAC,EACAC,EACJ,GAAKV,GAAK,EACT,OAAOI,EAMR,GAJ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AV,EAAO,QAAUG,IC7DjB,IAAAQ,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAc,QAAS,uDAAwD,EAC/EC,EAAQ,IACRC,EAAU,IAKdF,EAAaC,EAAO,UAAWC,CAAQ,EAKvCH,EAAO,QAAUE,ICcjB,IAAIE,EAAO,QAAS,MAAO,EAAE,KACzBC,EAAa,QAAS,2BAA4B,EAClDC,EAAU,QAAS,yBAA0B,EAC7CC,EAAO,IAKPC,EACAC,EAAMJ,EAAYD,EAAM,UAAW,aAAc,CAAE,EAClDE,EAASG,CAAI,EACjBD,EAAQD,EAERC,EAAQC,EAMT,OAAO,QAAUD", | ||
| "names": ["require_ndarray", "__commonJSMin", "exports", "module", "M", "scopy", "N", "x", "strideX", "offsetX", "y", "strideY", "offsetY", "ix", "iy", "m", "i", "require_scopy", "__commonJSMin", "exports", "module", "stride2offset", "ndarray", "scopy", "N", "x", "strideX", "y", "strideY", "ix", "iy", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "scopy", "ndarray", "join", "tryRequire", "isError", "main", "scopy", "tmp"] | ||
| } |
+6
-45
@@ -21,5 +21,6 @@ /** | ||
| // VARIABLES // | ||
| // MODULES // | ||
| var M = 8; | ||
| var stride2offset = require( '@stdlib/strided-base-stride2offset' ); | ||
| var ndarray = require( './ndarray.js' ); | ||
@@ -51,48 +52,8 @@ | ||
| var iy; | ||
| var m; | ||
| var i; | ||
| if ( N <= 0 ) { | ||
| return y; | ||
| } | ||
| // Use unrolled loops if both strides are equal to `1`... | ||
| if ( strideX === 1 && strideY === 1 ) { | ||
| m = N % M; | ||
| // If we have a remainder, run a clean-up loop... | ||
| if ( m > 0 ) { | ||
| for ( i = 0; i < m; i++ ) { | ||
| y[ i ] = x[ i ]; | ||
| } | ||
| } | ||
| if ( N < M ) { | ||
| return y; | ||
| } | ||
| for ( i = m; i < N; i += M ) { | ||
| y[ i ] = x[ i ]; | ||
| y[ i+1 ] = x[ i+1 ]; | ||
| y[ i+2 ] = x[ i+2 ]; | ||
| y[ i+3 ] = x[ i+3 ]; | ||
| y[ i+4 ] = x[ i+4 ]; | ||
| y[ i+5 ] = x[ i+5 ]; | ||
| y[ i+6 ] = x[ i+6 ]; | ||
| y[ i+7 ] = x[ i+7 ]; | ||
| } | ||
| return y; | ||
| } | ||
| if ( strideX < 0 ) { | ||
| ix = (1-N) * strideX; | ||
| } else { | ||
| ix = 0; | ||
| } | ||
| if ( strideY < 0 ) { | ||
| iy = (1-N) * strideY; | ||
| } else { | ||
| iy = 0; | ||
| } | ||
| for ( i = 0; i < N; i++ ) { | ||
| y[ iy ] = x[ ix ]; | ||
| ix += strideX; | ||
| iy += strideY; | ||
| } | ||
| return y; | ||
| ix = stride2offset( N, strideX ); | ||
| iy = stride2offset( N, strideY ); | ||
| return ndarray( N, x, strideX, ix, y, strideY, iy ); | ||
| } | ||
@@ -99,0 +60,0 @@ |
+210
-0
| { | ||
| "options": { | ||
| "task": "build", | ||
| "os": "linux", | ||
@@ -31,2 +32,3 @@ "blas": "", | ||
| { | ||
| "task": "build", | ||
| "os": "linux", | ||
@@ -52,3 +54,35 @@ "blas": "", | ||
| { | ||
| "task": "benchmark", | ||
| "os": "linux", | ||
| "blas": "", | ||
| "wasm": false, | ||
| "src": [ | ||
| "./src/scopy.c" | ||
| ], | ||
| "include": [ | ||
| "./include" | ||
| ], | ||
| "libraries": [], | ||
| "libpath": [], | ||
| "dependencies": [] | ||
| }, | ||
| { | ||
| "task": "examples", | ||
| "os": "linux", | ||
| "blas": "", | ||
| "wasm": false, | ||
| "src": [ | ||
| "./src/scopy.c" | ||
| ], | ||
| "include": [ | ||
| "./include" | ||
| ], | ||
| "libraries": [], | ||
| "libpath": [], | ||
| "dependencies": [] | ||
| }, | ||
| { | ||
| "task": "build", | ||
| "os": "linux", | ||
| "blas": "openblas", | ||
@@ -75,2 +109,40 @@ "wasm": false, | ||
| { | ||
| "task": "benchmark", | ||
| "os": "linux", | ||
| "blas": "openblas", | ||
| "wasm": false, | ||
| "src": [ | ||
| "./src/scopy_cblas.c" | ||
| ], | ||
| "include": [ | ||
| "./include" | ||
| ], | ||
| "libraries": [ | ||
| "-lopenblas", | ||
| "-lpthread" | ||
| ], | ||
| "libpath": [], | ||
| "dependencies": [] | ||
| }, | ||
| { | ||
| "task": "examples", | ||
| "os": "linux", | ||
| "blas": "openblas", | ||
| "wasm": false, | ||
| "src": [ | ||
| "./src/scopy_cblas.c" | ||
| ], | ||
| "include": [ | ||
| "./include" | ||
| ], | ||
| "libraries": [ | ||
| "-lopenblas", | ||
| "-lpthread" | ||
| ], | ||
| "libpath": [], | ||
| "dependencies": [] | ||
| }, | ||
| { | ||
| "task": "build", | ||
| "os": "mac", | ||
@@ -96,3 +168,35 @@ "blas": "", | ||
| { | ||
| "task": "benchmark", | ||
| "os": "mac", | ||
| "blas": "", | ||
| "wasm": false, | ||
| "src": [ | ||
| "./src/scopy.c" | ||
| ], | ||
| "include": [ | ||
| "./include" | ||
| ], | ||
| "libraries": [], | ||
| "libpath": [], | ||
| "dependencies": [] | ||
| }, | ||
| { | ||
| "task": "examples", | ||
| "os": "mac", | ||
| "blas": "", | ||
| "wasm": false, | ||
| "src": [ | ||
| "./src/scopy.c" | ||
| ], | ||
| "include": [ | ||
| "./include" | ||
| ], | ||
| "libraries": [], | ||
| "libpath": [], | ||
| "dependencies": [] | ||
| }, | ||
| { | ||
| "task": "build", | ||
| "os": "mac", | ||
| "blas": "apple_accelerate_framework", | ||
@@ -118,3 +222,39 @@ "wasm": false, | ||
| { | ||
| "task": "benchmark", | ||
| "os": "mac", | ||
| "blas": "apple_accelerate_framework", | ||
| "wasm": false, | ||
| "src": [ | ||
| "./src/scopy_cblas.c" | ||
| ], | ||
| "include": [ | ||
| "./include" | ||
| ], | ||
| "libraries": [ | ||
| "-lblas" | ||
| ], | ||
| "libpath": [], | ||
| "dependencies": [] | ||
| }, | ||
| { | ||
| "task": "examples", | ||
| "os": "mac", | ||
| "blas": "apple_accelerate_framework", | ||
| "wasm": false, | ||
| "src": [ | ||
| "./src/scopy_cblas.c" | ||
| ], | ||
| "include": [ | ||
| "./include" | ||
| ], | ||
| "libraries": [ | ||
| "-lblas" | ||
| ], | ||
| "libpath": [], | ||
| "dependencies": [] | ||
| }, | ||
| { | ||
| "task": "build", | ||
| "os": "mac", | ||
| "blas": "openblas", | ||
@@ -141,2 +281,40 @@ "wasm": false, | ||
| { | ||
| "task": "benchmark", | ||
| "os": "mac", | ||
| "blas": "openblas", | ||
| "wasm": false, | ||
| "src": [ | ||
| "./src/scopy_cblas.c" | ||
| ], | ||
| "include": [ | ||
| "./include" | ||
| ], | ||
| "libraries": [ | ||
| "-lopenblas", | ||
| "-lpthread" | ||
| ], | ||
| "libpath": [], | ||
| "dependencies": [] | ||
| }, | ||
| { | ||
| "task": "examples", | ||
| "os": "mac", | ||
| "blas": "openblas", | ||
| "wasm": false, | ||
| "src": [ | ||
| "./src/scopy_cblas.c" | ||
| ], | ||
| "include": [ | ||
| "./include" | ||
| ], | ||
| "libraries": [ | ||
| "-lopenblas", | ||
| "-lpthread" | ||
| ], | ||
| "libpath": [], | ||
| "dependencies": [] | ||
| }, | ||
| { | ||
| "task": "build", | ||
| "os": "win", | ||
@@ -161,2 +339,34 @@ "blas": "", | ||
| { | ||
| "task": "benchmark", | ||
| "os": "win", | ||
| "blas": "", | ||
| "wasm": false, | ||
| "src": [ | ||
| "./src/scopy.c" | ||
| ], | ||
| "include": [ | ||
| "./include" | ||
| ], | ||
| "libraries": [], | ||
| "libpath": [], | ||
| "dependencies": [] | ||
| }, | ||
| { | ||
| "task": "examples", | ||
| "os": "win", | ||
| "blas": "", | ||
| "wasm": false, | ||
| "src": [ | ||
| "./src/scopy.c" | ||
| ], | ||
| "include": [ | ||
| "./include" | ||
| ], | ||
| "libraries": [], | ||
| "libpath": [], | ||
| "dependencies": [] | ||
| }, | ||
| { | ||
| "task": "build", | ||
| "os": "", | ||
@@ -163,0 +373,0 @@ "blas": "", |
+9
-8
| { | ||
| "name": "@stdlib/blas-base-scopy", | ||
| "version": "0.2.1", | ||
| "version": "0.2.2", | ||
| "description": "Copy values from x into y.", | ||
@@ -37,10 +37,11 @@ "license": "Apache-2.0", | ||
| "dependencies": { | ||
| "@stdlib/assert-is-error": "^0.2.1", | ||
| "@stdlib/napi-argv": "^0.2.1", | ||
| "@stdlib/napi-argv-int64": "^0.2.1", | ||
| "@stdlib/assert-is-error": "^0.2.2", | ||
| "@stdlib/napi-argv": "^0.2.2", | ||
| "@stdlib/napi-argv-int64": "^0.2.2", | ||
| "@stdlib/napi-argv-strided-float32array": "^0.2.1", | ||
| "@stdlib/napi-export": "^0.2.1", | ||
| "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.1", | ||
| "@stdlib/utils-library-manifest": "^0.2.1", | ||
| "@stdlib/utils-try-require": "^0.2.1" | ||
| "@stdlib/napi-export": "^0.2.2", | ||
| "@stdlib/strided-base-stride2offset": "^0.1.0", | ||
| "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2", | ||
| "@stdlib/utils-library-manifest": "^0.2.2", | ||
| "@stdlib/utils-try-require": "^0.2.2" | ||
| }, | ||
@@ -47,0 +48,0 @@ "devDependencies": {}, |
+2
-2
@@ -239,4 +239,4 @@ <!-- | ||
| [test-image]: https://github.com/stdlib-js/blas-base-scopy/actions/workflows/test.yml/badge.svg?branch=v0.2.1 | ||
| [test-url]: https://github.com/stdlib-js/blas-base-scopy/actions/workflows/test.yml?query=branch:v0.2.1 | ||
| [test-image]: https://github.com/stdlib-js/blas-base-scopy/actions/workflows/test.yml/badge.svg?branch=v0.2.2 | ||
| [test-url]: https://github.com/stdlib-js/blas-base-scopy/actions/workflows/test.yml?query=branch:v0.2.2 | ||
@@ -243,0 +243,0 @@ [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/blas-base-scopy/main.svg |
+0
-1
@@ -29,3 +29,2 @@ /** | ||
| * | ||
| * @private | ||
| * @param env environment under which the function is invoked | ||
@@ -32,0 +31,0 @@ * @param info callback data |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
837
24.55%65947
-2.08%9
12.5%25
-3.85%+ Added
Updated
Updated
Updated