diff --git a/CHANGELOG.md b/CHANGELOG.md index 18a4fb2..2009712 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@
-## Unreleased (2024-09-14) +## Unreleased (2024-09-16)
@@ -21,6 +21,7 @@ ### Bug Fixes +- [`a90c34d`](https://github.com/stdlib-js/stdlib/commit/a90c34d316f09ce5dfe165439fbcb2785fcea5a0) - update error message - [`8b1f86b`](https://github.com/stdlib-js/stdlib/commit/8b1f86b855e9f11a36ccf7f58a611650bf210078) - prevent writing to read-only ndarrays
@@ -33,6 +34,7 @@
+- [`a90c34d`](https://github.com/stdlib-js/stdlib/commit/a90c34d316f09ce5dfe165439fbcb2785fcea5a0) - **fix:** update error message _(by Athan Reines)_ - [`2d7e925`](https://github.com/stdlib-js/stdlib/commit/2d7e9251e02cba556ad7e8b40ef90d5190d0d719) - **feat:** add support for stacks in `blas/sswap` [(#2898)](https://github.com/stdlib-js/stdlib/pull/2898) _(by Aman Bhansali, Athan Reines)_ - [`8b1f86b`](https://github.com/stdlib-js/stdlib/commit/8b1f86b855e9f11a36ccf7f58a611650bf210078) - **fix:** prevent writing to read-only ndarrays _(by Athan Reines)_ - [`2e25339`](https://github.com/stdlib-js/stdlib/commit/2e2533970e09cb59f3533d474ec32756f4ca4f81) - **feat:** add support for batched computation _(by Athan Reines)_ diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 8610d91..ecfde1e 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -2,6 +2,7 @@ # # Contributors listed in alphabetical order. +Aayush Khanna <96649223+aayush0325@users.noreply.github.com> Adarsh Palaskar Aditya Sapra AgPriyanshu18 <113460573+AgPriyanshu18@users.noreply.github.com> diff --git a/dist/index.js b/dist/index.js index e55a2ec..c44d8f2 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,4 +1,4 @@ -"use strict";var T=function(n,r){return function(){return r||n((r={exports:{}}).exports,r),r.exports}};var E=T(function(C,b){"use strict";var w=require("@stdlib/assert-is-float64ndarray-like"),x=require("@stdlib/assert-is-negative-integer").isPrimitive,p=require("@stdlib/ndarray-base-assert-is-read-only"),V=require("@stdlib/array-base-assert-has-equal-values-indexed"),S=require("@stdlib/math-base-special-fast-min"),k=require("@stdlib/array-base-without"),q=require("@stdlib/ndarray-base-ndarraylike2ndarray"),F=require("@stdlib/ndarray-base-normalize-index"),c=require("@stdlib/ndarray-iter-stacks"),I=require("@stdlib/ndarray-base-numel"),y=require("@stdlib/blas-base-dswap").ndarray,s=require("@stdlib/string-format");function N(n,r){var e,a,u,g,h,t,i,o,v,d,l,f,m;if(!w(n))throw new TypeError(s("invalid argument. First argument must be an ndarray containing double-precision floating-point numbers. Value: `%s`.",n));if(!w(r))throw new TypeError(s("invalid argument. Second argument must be an ndarray containing double-precision floating-point numbers. Value: `%s`.",r));if(p(n)||p(r))throw new Error("invalid argument. Cannot write to read-only array.");if(t=q(n),i=q(r),a=t.shape,u=i.shape,a.length<1)throw new TypeError(s("invalid argument. First argument must have at least one dimension."));if(u.length<1)throw new TypeError(s("invalid argument. Second argument must have at least one dimension."));if(!V(a,u))throw new Error("invalid arguments. The first and second arguments must have the shape.");if(arguments.length>2){if(e=arguments[2],!x(e))throw new TypeError(s("invalid argument. Third argument must be a negative integer. Value: `%s`.",e))}else e=-1;if(d=S(a.length,u.length)-1,e=F(e,d),e===-1)throw new RangeError(s("invalid argument. Third argument must be a value on the interval: [%d,%d]. Value: `%d`.",-d,-1,arguments[2]));if(l=a[e],a.length===1)return y(l,t.data,t.strides[0],t.offset,i.data,i.strides[0],i.offset),r;for(f=I(k(a,e)),g=c(t,[e]),h=c(i,[e]),m=0;m2){if(e=arguments[2],!x(e))throw new TypeError(s("invalid argument. Third argument must be a negative integer. Value: `%s`.",e))}else e=-1;if(d=S(a.length,u.length)-1,e=F(e,d),e===-1)throw new RangeError(s("invalid argument. Third argument must be a value on the interval: [%d,%d]. Value: `%d`.",-d,-1,arguments[2]));if(m=a[e],a.length===1)return y(m,t.data,t.strides[0],t.offset,i.data,i.strides[0],i.offset),r;for(f=I(k(a,e)),g=c(t,[e]),h=c(i,[e]),l=0;l[ 2.0, 6.0, -1.0, -4.0, 8.0 ]\n*\n* var ybuf = y.data;\n* // returns [ 4.0, 2.0, -3.0, 5.0, -1.0 ]\n*/\nfunction dswap( x, y ) {\n\tvar dim;\n\tvar xsh;\n\tvar ysh;\n\tvar xit;\n\tvar yit;\n\tvar xc;\n\tvar yc;\n\tvar vx;\n\tvar vy;\n\tvar dm;\n\tvar S;\n\tvar N;\n\tvar i;\n\tif ( !isFloat64ndarrayLike( x ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ndarray containing double-precision floating-point numbers. Value: `%s`.', x ) );\n\t}\n\tif ( !isFloat64ndarrayLike( y ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an ndarray containing double-precision floating-point numbers. Value: `%s`.', y ) );\n\t}\n\tif ( isReadOnly( x ) || isReadOnly( y ) ) {\n\t\tthrow new Error( 'invalid argument. Cannot write to read-only array.' );\n\t}\n\t// Convert the input arrays to \"base\" ndarrays:\n\txc = ndarraylike2ndarray( x );\n\tyc = ndarraylike2ndarray( y );\n\n\t// Resolve the input array shapes:\n\txsh = xc.shape;\n\tysh = yc.shape;\n\n\t// Validate that we've been provided non-zero-dimensional arrays...\n\tif ( xsh.length < 1 ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must have at least one dimension.' ) );\n\t}\n\tif ( ysh.length < 1 ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must have at least one dimension.' ) );\n\t}\n\t// Validate that the arrays have the same shape...\n\tif ( !hasEqualValues( xsh, ysh ) ) {\n\t\tthrow new Error( 'invalid arguments. The first and second arguments must have the shape.' );\n\t}\n\t// Validate that the dimension argument is a negative integer...\n\tif ( arguments.length > 2 ) {\n\t\tdim = arguments[ 2 ];\n\t\tif ( !isNegativeInteger( dim ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a negative integer. Value: `%s`.', dim ) );\n\t\t}\n\t} else {\n\t\tdim = -1;\n\t}\n\t// Validate that a provided dimension index is within bounds...\n\tdm = min( xsh.length, ysh.length ) - 1;\n\tdim = normalizeIndex( dim, dm );\n\tif ( dim === -1 ) {\n\t\tthrow new RangeError( format( 'invalid argument. Third argument must be a value on the interval: [%d,%d]. Value: `%d`.', -dm, -1, arguments[ 2 ] ) );\n\t}\n\t// Resolve the size of the interchange dimension:\n\tS = xsh[ dim ];\n\n\t// If we are only provided one-dimensional input arrays, we can skip iterating over stacks...\n\tif ( xsh.length === 1 ) {\n\t\tbase( S, xc.data, xc.strides[0], xc.offset, yc.data, yc.strides[0], yc.offset ); // eslint-disable-line max-len\n\t\treturn y;\n\t}\n\t// Resolve the number of stacks:\n\tN = numel( without( xsh, dim ) );\n\n\t// Create iterators for iterating over stacks of vectors:\n\txit = nditerStacks( xc, [ dim ] );\n\tyit = nditerStacks( yc, [ dim ] );\n\n\t// Interchange each pair of vectors...\n\tfor ( i = 0; i < N; i++ ) {\n\t\tvx = xit.next().value;\n\t\tvy = yit.next().value;\n\t\tbase( S, vx.data, vx.strides[0], vx.offset, vy.data, vy.strides[0], vy.offset ); // eslint-disable-line max-len\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 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 interchange two double-precision floating-point vectors.\n*\n* @module @stdlib/blas-dswap\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n* var array = require( '@stdlib/ndarray-array' );\n* var dswap = require( '@stdlib/blas-dswap' );\n*\n* var x = array( new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) );\n* var y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) );\n*\n* dswap( x, y );\n*\n* var xbuf = x.data;\n* // returns [ 2.0, 6.0, -1.0, -4.0, 8.0 ]\n*\n* var ybuf = y.data;\n* // returns [ 4.0, 2.0, -3.0, 5.0, -1.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAuB,QAAS,uCAAwC,EACxEC,EAAoB,QAAS,oCAAqC,EAAE,YACpEC,EAAa,QAAS,0CAA2C,EACjEC,EAAiB,QAAS,oDAAqD,EAC/EC,EAAM,QAAS,oCAAqC,EACpDC,EAAU,QAAS,4BAA6B,EAChDC,EAAsB,QAAS,0CAA2C,EAC1EC,EAAiB,QAAS,sCAAuC,EACjEC,EAAe,QAAS,6BAA8B,EACtDC,EAAQ,QAAS,4BAA6B,EAC9CC,EAAO,QAAS,yBAA0B,EAAE,QAC5CC,EAAS,QAAS,uBAAwB,EAmC9C,SAASC,EAAOC,EAAGC,EAAI,CACtB,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACJ,GAAK,CAAC3B,EAAsBa,CAAE,EAC7B,MAAM,IAAI,UAAWF,EAAQ,uHAAwHE,CAAE,CAAE,EAE1J,GAAK,CAACb,EAAsBc,CAAE,EAC7B,MAAM,IAAI,UAAWH,EAAQ,wHAAyHG,CAAE,CAAE,EAE3J,GAAKZ,EAAYW,CAAE,GAAKX,EAAYY,CAAE,EACrC,MAAM,IAAI,MAAO,oDAAqD,EAWvE,GARAM,EAAKd,EAAqBO,CAAE,EAC5BQ,E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AUa,IC5GjB,IAAIgB,EAAO,IAKX,OAAO,QAAUA", + "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 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 isFloat64ndarrayLike = require( '@stdlib/assert-is-float64ndarray-like' );\nvar isNegativeInteger = require( '@stdlib/assert-is-negative-integer' ).isPrimitive;\nvar isReadOnly = require( '@stdlib/ndarray-base-assert-is-read-only' );\nvar hasEqualValues = require( '@stdlib/array-base-assert-has-equal-values-indexed' );\nvar min = require( '@stdlib/math-base-special-fast-min' );\nvar without = require( '@stdlib/array-base-without' );\nvar ndarraylike2ndarray = require( '@stdlib/ndarray-base-ndarraylike2ndarray' );\nvar normalizeIndex = require( '@stdlib/ndarray-base-normalize-index' );\nvar nditerStacks = require( '@stdlib/ndarray-iter-stacks' );\nvar numel = require( '@stdlib/ndarray-base-numel' );\nvar base = require( '@stdlib/blas-base-dswap' ).ndarray;\nvar format = require( '@stdlib/string-format' );\n\n\n// MAIN //\n\n/**\n* Interchanges two double-precision floating-point vectors.\n*\n* @param {ndarrayLike} x - first input array\n* @param {ndarrayLike} y - second input array\n* @param {NegativeInteger} [dim] - dimension along which to interchange elements\n* @throws {TypeError} first argument must be a ndarray containing double-precision floating-point numbers\n* @throws {TypeError} first argument must have at least one dimension\n* @throws {TypeError} second argument must be a ndarray containing double-precision floating-point numbers\n* @throws {TypeError} second argument must have at least one dimension\n* @throws {Error} both input arrays must have the same shape\n* @throws {RangeError} third argument is out-of-bounds\n* @throws {Error} cannot write to read-only array\n* @returns {ndarrayLike} `y`\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n* var array = require( '@stdlib/ndarray-array' );\n*\n* var x = array( new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) );\n* var y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) );\n*\n* dswap( x, y );\n*\n* var xbuf = x.data;\n* // returns [ 2.0, 6.0, -1.0, -4.0, 8.0 ]\n*\n* var ybuf = y.data;\n* // returns [ 4.0, 2.0, -3.0, 5.0, -1.0 ]\n*/\nfunction dswap( x, y ) {\n\tvar dim;\n\tvar xsh;\n\tvar ysh;\n\tvar xit;\n\tvar yit;\n\tvar xc;\n\tvar yc;\n\tvar vx;\n\tvar vy;\n\tvar dm;\n\tvar S;\n\tvar N;\n\tvar i;\n\tif ( !isFloat64ndarrayLike( x ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ndarray containing double-precision floating-point numbers. Value: `%s`.', x ) );\n\t}\n\tif ( !isFloat64ndarrayLike( y ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an ndarray containing double-precision floating-point numbers. Value: `%s`.', y ) );\n\t}\n\tif ( isReadOnly( x ) || isReadOnly( y ) ) {\n\t\tthrow new Error( 'invalid argument. Cannot write to read-only array.' );\n\t}\n\t// Convert the input arrays to \"base\" ndarrays:\n\txc = ndarraylike2ndarray( x );\n\tyc = ndarraylike2ndarray( y );\n\n\t// Resolve the input array shapes:\n\txsh = xc.shape;\n\tysh = yc.shape;\n\n\t// Validate that we've been provided non-zero-dimensional arrays...\n\tif ( xsh.length < 1 ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must have at least one dimension.' ) );\n\t}\n\tif ( ysh.length < 1 ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must have at least one dimension.' ) );\n\t}\n\t// Validate that the arrays have the same shape...\n\tif ( !hasEqualValues( xsh, ysh ) ) {\n\t\tthrow new Error( 'invalid arguments. The first and second arguments must have the same shape.' );\n\t}\n\t// Validate that the dimension argument is a negative integer...\n\tif ( arguments.length > 2 ) {\n\t\tdim = arguments[ 2 ];\n\t\tif ( !isNegativeInteger( dim ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a negative integer. Value: `%s`.', dim ) );\n\t\t}\n\t} else {\n\t\tdim = -1;\n\t}\n\t// Validate that a provided dimension index is within bounds...\n\tdm = min( xsh.length, ysh.length ) - 1;\n\tdim = normalizeIndex( dim, dm );\n\tif ( dim === -1 ) {\n\t\tthrow new RangeError( format( 'invalid argument. Third argument must be a value on the interval: [%d,%d]. Value: `%d`.', -dm, -1, arguments[ 2 ] ) );\n\t}\n\t// Resolve the size of the interchange dimension:\n\tS = xsh[ dim ];\n\n\t// If we are only provided one-dimensional input arrays, we can skip iterating over stacks...\n\tif ( xsh.length === 1 ) {\n\t\tbase( S, xc.data, xc.strides[0], xc.offset, yc.data, yc.strides[0], yc.offset ); // eslint-disable-line max-len\n\t\treturn y;\n\t}\n\t// Resolve the number of stacks:\n\tN = numel( without( xsh, dim ) );\n\n\t// Create iterators for iterating over stacks of vectors:\n\txit = nditerStacks( xc, [ dim ] );\n\tyit = nditerStacks( yc, [ dim ] );\n\n\t// Interchange each pair of vectors...\n\tfor ( i = 0; i < N; i++ ) {\n\t\tvx = xit.next().value;\n\t\tvy = yit.next().value;\n\t\tbase( S, vx.data, vx.strides[0], vx.offset, vy.data, vy.strides[0], vy.offset ); // eslint-disable-line max-len\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dswap;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 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 interchange two double-precision floating-point vectors.\n*\n* @module @stdlib/blas-dswap\n*\n* @example\n* var Float64Array = require( '@stdlib/array-float64' );\n* var array = require( '@stdlib/ndarray-array' );\n* var dswap = require( '@stdlib/blas-dswap' );\n*\n* var x = array( new Float64Array( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) );\n* var y = array( new Float64Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) );\n*\n* dswap( x, y );\n*\n* var xbuf = x.data;\n* // returns [ 2.0, 6.0, -1.0, -4.0, 8.0 ]\n*\n* var ybuf = y.data;\n* // returns [ 4.0, 2.0, -3.0, 5.0, -1.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], + "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAuB,QAAS,uCAAwC,EACxEC,EAAoB,QAAS,oCAAqC,EAAE,YACpEC,EAAa,QAAS,0CAA2C,EACjEC,EAAiB,QAAS,oDAAqD,EAC/EC,EAAM,QAAS,oCAAqC,EACpDC,EAAU,QAAS,4BAA6B,EAChDC,EAAsB,QAAS,0CAA2C,EAC1EC,EAAiB,QAAS,sCAAuC,EACjEC,EAAe,QAAS,6BAA8B,EACtDC,EAAQ,QAAS,4BAA6B,EAC9CC,EAAO,QAAS,yBAA0B,EAAE,QAC5CC,EAAS,QAAS,uBAAwB,EAmC9C,SAASC,EAAOC,EAAGC,EAAI,CACtB,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACJ,GAAK,CAAC3B,EAAsBa,CAAE,EAC7B,MAAM,IAAI,UAAWF,EAAQ,uHAAwHE,CAAE,CAAE,EAE1J,GAAK,CAACb,EAAsBc,CAAE,EAC7B,MAAM,IAA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AAE,MAChBT,EAAMe,EAAGH,EAAG,KAAMA,EAAG,QAAQ,CAAC,EAAGA,EAAG,OAAQC,EAAG,KAAMA,EAAG,QAAQ,CAAC,EAAGA,EAAG,MAAO,EAE/E,OAAOT,CACR,CAKAf,EAAO,QAAUa,IC5GjB,IAAIgB,EAAO,IAKX,OAAO,QAAUA", "names": ["require_main", "__commonJSMin", "exports", "module", "isFloat64ndarrayLike", "isNegativeInteger", "isReadOnly", "hasEqualValues", "min", "without", "ndarraylike2ndarray", "normalizeIndex", "nditerStacks", "numel", "base", "format", "dswap", "x", "y", "dim", "xsh", "ysh", "xit", "yit", "xc", "yc", "vx", "vy", "dm", "S", "N", "i", "main"] } diff --git a/lib/main.js b/lib/main.js index 22b61bb..fb51c7b 100644 --- a/lib/main.js +++ b/lib/main.js @@ -106,7 +106,7 @@ function dswap( x, y ) { } // Validate that the arrays have the same shape... if ( !hasEqualValues( xsh, ysh ) ) { - throw new Error( 'invalid arguments. The first and second arguments must have the shape.' ); + throw new Error( 'invalid arguments. The first and second arguments must have the same shape.' ); } // Validate that the dimension argument is a negative integer... if ( arguments.length > 2 ) {