@stdlib/ndarray-base-strides2order 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/NOTICE CHANGED
@@ -1 +1 @@
1
- Copyright (c) 2016-2024 The Stdlib Authors.
1
+ Copyright (c) 2016-2026 The Stdlib Authors.
package/README.md CHANGED
@@ -192,7 +192,7 @@ See [LICENSE][stdlib-license].
192
192
 
193
193
  ## Copyright
194
194
 
195
- Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
195
+ Copyright © 2016-2026. The Stdlib [Authors][stdlib-authors].
196
196
 
197
197
  </section>
198
198
 
@@ -205,8 +205,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
205
205
  [npm-image]: http://img.shields.io/npm/v/@stdlib/ndarray-base-strides2order.svg
206
206
  [npm-url]: https://npmjs.org/package/@stdlib/ndarray-base-strides2order
207
207
 
208
- [test-image]: https://github.com/stdlib-js/ndarray-base-strides2order/actions/workflows/test.yml/badge.svg?branch=v0.2.2
209
- [test-url]: https://github.com/stdlib-js/ndarray-base-strides2order/actions/workflows/test.yml?query=branch:v0.2.2
208
+ [test-image]: https://github.com/stdlib-js/ndarray-base-strides2order/actions/workflows/test.yml/badge.svg?branch=v0.2.3
209
+ [test-url]: https://github.com/stdlib-js/ndarray-base-strides2order/actions/workflows/test.yml?query=branch:v0.2.3
210
210
 
211
211
  [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/ndarray-base-strides2order/main.svg
212
212
  [coverage-url]: https://codecov.io/github/stdlib-js/ndarray-base-strides2order?branch=main
@@ -218,8 +218,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
218
218
 
219
219
  -->
220
220
 
221
- [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
222
- [chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
221
+ [chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
222
+ [chat-url]: https://stdlib.zulipchat.com
223
223
 
224
224
  [stdlib]: https://github.com/stdlib-js/stdlib
225
225
 
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../lib/main.js", "../lib/index.js"],
4
- "sourcesContent": ["/**\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 abs = require( '@stdlib/math-base-special-abs' );\n\n\n// MAIN //\n\n/**\n* Determines the order of a multidimensional array based on a provided stride array.\n*\n* @param {IntegerArray} strides - stride array\n* @returns {integer} order\n*\n* @example\n* var strides2order = require( '@stdlib/ndarray-base-strides2order' );\n*\n* var order = strides2order( [ 2, 1 ] );\n* // returns 1\n*\n* order = strides2order( [ 1, 2 ] );\n* // returns 2\n*\n* order = strides2order( [ 1, 1, 1 ] );\n* // returns 3\n*\n* order = strides2order( [ 2, 3, 1 ] );\n* // returns 0\n*/\nfunction strides2order( strides ) {\n\tvar column;\n\tvar ndims;\n\tvar row;\n\tvar s1;\n\tvar s2;\n\tvar i;\n\n\tndims = strides.length;\n\tif ( ndims === 0 ) {\n\t\treturn 0|0; // 'none'\n\t}\n\tcolumn = true;\n\trow = true;\n\n\ts1 = abs( strides[ 0 ] );\n\tfor ( i = 1; i < ndims; i++ ) {\n\t\ts2 = abs( strides[ i ] );\n\t\tif ( column && s2 < s1 ) {\n\t\t\tcolumn = false;\n\t\t} else if ( row && s2 > s1 ) {\n\t\t\trow = false;\n\t\t}\n\t\tif ( row || column ) {\n\t\t\ts1 = s2;\n\t\t} else {\n\t\t\treturn 0|0; // 'none'\n\t\t}\n\t}\n\tif ( row && column ) {\n\t\treturn 3|0; // 'both'\n\t}\n\tif ( row ) {\n\t\treturn 1|0; // 'row-major'\n\t}\n\treturn 2|0; // 'column-major'\n}\n\n\n// EXPORTS //\n\nmodule.exports = strides2order;\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* Determine the order of a multidimensional array based on a provided stride array.\n*\n* @module @stdlib/ndarray-base-strides2order\n*\n* @example\n* var strides2order = require( '@stdlib/ndarray-base-strides2order' );\n*\n* var order = strides2order( [ 2, 1 ] );\n* // returns 1\n*\n* order = strides2order( [ 1, 2 ] );\n* // returns 2\n*\n* order = strides2order( [ 1, 1, 1 ] );\n* // returns 3\n*\n* order = strides2order( [ 2, 3, 1 ] );\n* // returns 0\n*/\n\n// MODULES //\n\nvar strides2order = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = strides2order;\n"],
5
- "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAM,QAAS,+BAAgC,EA0BnD,SAASC,EAAeC,EAAU,CACjC,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EAGJ,GADAJ,EAAQF,EAAQ,OACXE,IAAU,EACd,MAAO,GAMR,IAJAD,EAAS,GACTE,EAAM,GAENC,EAAKN,EAAKE,EAAS,CAAE,CAAE,EACjBM,EAAI,EAAGA,EAAIJ,EAAOI,IAOvB,GANAD,EAAKP,EAAKE,EAASM,CAAE,CAAE,EAClBL,GAAUI,EAAKD,EACnBH,EAAS,GACEE,GAAOE,EAAKD,IACvBD,EAAM,IAEFA,GAAOF,EACXG,EAAKC,MAEL,OAAO,GAGT,OAAKF,GAAOF,EACJ,EAEHE,EACG,EAED,CACR,CAKAN,EAAO,QAAUE,IC9CjB,IAAIQ,EAAgB,IAKpB,OAAO,QAAUA",
4
+ "sourcesContent": ["/**\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 abs = require( '@stdlib/math-base-special-abs' );\n\n\n// MAIN //\n\n/**\n* Determines the order of a multidimensional array based on a provided stride array.\n*\n* @param {IntegerArray} strides - stride array\n* @returns {integer} order\n*\n* @example\n* var order = strides2order( [ 2, 1 ] );\n* // returns 1\n*\n* order = strides2order( [ 1, 2 ] );\n* // returns 2\n*\n* order = strides2order( [ 1, 1, 1 ] );\n* // returns 3\n*\n* order = strides2order( [ 2, 3, 1 ] );\n* // returns 0\n*/\nfunction strides2order( strides ) {\n\tvar column;\n\tvar ndims;\n\tvar row;\n\tvar s1;\n\tvar s2;\n\tvar i;\n\n\tndims = strides.length;\n\tif ( ndims === 0 ) {\n\t\treturn 0|0; // 'none'\n\t}\n\tcolumn = true;\n\trow = true;\n\n\ts1 = abs( strides[ 0 ] );\n\tfor ( i = 1; i < ndims; i++ ) {\n\t\ts2 = abs( strides[ i ] );\n\t\tif ( column && s2 < s1 ) {\n\t\t\tcolumn = false;\n\t\t} else if ( row && s2 > s1 ) {\n\t\t\trow = false;\n\t\t}\n\t\tif ( row || column ) {\n\t\t\ts1 = s2;\n\t\t} else {\n\t\t\treturn 0|0; // 'none'\n\t\t}\n\t}\n\tif ( row && column ) {\n\t\treturn 3|0; // 'both'\n\t}\n\tif ( row ) {\n\t\treturn 1|0; // 'row-major'\n\t}\n\treturn 2|0; // 'column-major'\n}\n\n\n// EXPORTS //\n\nmodule.exports = strides2order;\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* Determine the order of a multidimensional array based on a provided stride array.\n*\n* @module @stdlib/ndarray-base-strides2order\n*\n* @example\n* var strides2order = require( '@stdlib/ndarray-base-strides2order' );\n*\n* var order = strides2order( [ 2, 1 ] );\n* // returns 1\n*\n* order = strides2order( [ 1, 2 ] );\n* // returns 2\n*\n* order = strides2order( [ 1, 1, 1 ] );\n* // returns 3\n*\n* order = strides2order( [ 2, 3, 1 ] );\n* // returns 0\n*/\n\n// MODULES //\n\nvar strides2order = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = strides2order;\n"],
5
+ "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAM,QAAS,+BAAgC,EAwBnD,SAASC,EAAeC,EAAU,CACjC,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EAGJ,GADAJ,EAAQF,EAAQ,OACXE,IAAU,EACd,MAAO,GAMR,IAJAD,EAAS,GACTE,EAAM,GAENC,EAAKN,EAAKE,EAAS,CAAE,CAAE,EACjBM,EAAI,EAAGA,EAAIJ,EAAOI,IAOvB,GANAD,EAAKP,EAAKE,EAASM,CAAE,CAAE,EAClBL,GAAUI,EAAKD,EACnBH,EAAS,GACEE,GAAOE,EAAKD,IACvBD,EAAM,IAEFA,GAAOF,EACXG,EAAKC,MAEL,OAAO,GAGT,OAAKF,GAAOF,EACJ,EAEHE,EACG,EAED,CACR,CAKAN,EAAO,QAAUE,IC5CjB,IAAIQ,EAAgB,IAKpB,OAAO,QAAUA",
6
6
  "names": ["require_main", "__commonJSMin", "exports", "module", "abs", "strides2order", "strides", "column", "ndims", "row", "s1", "s2", "i", "strides2order"]
7
7
  }
package/lib/main.js CHANGED
@@ -32,8 +32,6 @@ var abs = require( '@stdlib/math-base-special-abs' );
32
32
  * @returns {integer} order
33
33
  *
34
34
  * @example
35
- * var strides2order = require( '@stdlib/ndarray-base-strides2order' );
36
- *
37
35
  * var order = strides2order( [ 2, 1 ] );
38
36
  * // returns 1
39
37
  *
package/manifest.json CHANGED
@@ -1,38 +1,38 @@
1
1
  {
2
- "options": {},
3
- "fields": [
4
- {
5
- "field": "src",
6
- "resolve": true,
7
- "relative": true
8
- },
9
- {
10
- "field": "include",
11
- "resolve": true,
12
- "relative": true
13
- },
14
- {
15
- "field": "libraries",
16
- "resolve": false,
17
- "relative": false
18
- },
19
- {
20
- "field": "libpath",
21
- "resolve": true,
22
- "relative": false
23
- }
24
- ],
25
- "confs": [
26
- {
27
- "src": [
28
- "./src/main.c"
29
- ],
30
- "include": [
31
- "./include"
32
- ],
33
- "libraries": [],
34
- "libpath": [],
35
- "dependencies": []
36
- }
37
- ]
2
+ "options": {},
3
+ "fields": [
4
+ {
5
+ "field": "src",
6
+ "resolve": true,
7
+ "relative": true
8
+ },
9
+ {
10
+ "field": "include",
11
+ "resolve": true,
12
+ "relative": true
13
+ },
14
+ {
15
+ "field": "libraries",
16
+ "resolve": false,
17
+ "relative": false
18
+ },
19
+ {
20
+ "field": "libpath",
21
+ "resolve": true,
22
+ "relative": false
23
+ }
24
+ ],
25
+ "confs": [
26
+ {
27
+ "src": [
28
+ "./src/main.c"
29
+ ],
30
+ "include": [
31
+ "./include"
32
+ ],
33
+ "libraries": [],
34
+ "libpath": [],
35
+ "dependencies": []
36
+ }
37
+ ]
38
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stdlib/ndarray-base-strides2order",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Determine the order of a multidimensional array based on a provided stride array.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -32,7 +32,7 @@
32
32
  "url": "https://github.com/stdlib-js/stdlib/issues"
33
33
  },
34
34
  "dependencies": {
35
- "@stdlib/math-base-special-abs": "^0.2.1"
35
+ "@stdlib/math-base-special-abs": "^0.2.2"
36
36
  },
37
37
  "devDependencies": {},
38
38
  "engines": {
@@ -74,7 +74,6 @@
74
74
  "utils",
75
75
  "util"
76
76
  ],
77
- "__stdlib__": {},
78
77
  "funding": {
79
78
  "type": "opencollective",
80
79
  "url": "https://opencollective.com/stdlib"