@stdlib/blas-ext-base-srev 0.2.1 → 0.3.0
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 +1 -1
- package/README.md +137 -39
- package/dist/index.js +7 -7
- package/dist/index.js.map +4 -4
- package/docs/types/index.d.ts +9 -9
- package/include/stdlib/blas/ext/base/srev.h +7 -5
- package/lib/ndarray.js +10 -10
- package/lib/ndarray.native.js +5 -11
- package/lib/srev.js +5 -68
- package/lib/srev.native.js +3 -3
- package/manifest.json +76 -38
- package/package.json +12 -7
- package/src/addon.c +60 -0
- package/src/{srev.c → main.c} +36 -24
- package/include.gypi +0 -53
- package/src/addon.cpp +0 -115
package/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2026 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -53,9 +53,9 @@ npm install @stdlib/blas-ext-base-srev
|
|
|
53
53
|
var srev = require( '@stdlib/blas-ext-base-srev' );
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
#### srev( N, x,
|
|
56
|
+
#### srev( N, x, strideX )
|
|
57
57
|
|
|
58
|
-
Reverses a single-precision floating-point strided array
|
|
58
|
+
Reverses a single-precision floating-point strided array in-place.
|
|
59
59
|
|
|
60
60
|
```javascript
|
|
61
61
|
var Float32Array = require( '@stdlib/array-float32' );
|
|
@@ -70,18 +70,16 @@ The function has the following parameters:
|
|
|
70
70
|
|
|
71
71
|
- **N**: number of indexed elements.
|
|
72
72
|
- **x**: input [`Float32Array`][@stdlib/array/float32].
|
|
73
|
-
- **
|
|
73
|
+
- **strideX**: stride length.
|
|
74
74
|
|
|
75
|
-
The `N` and
|
|
75
|
+
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to reverse every other element:
|
|
76
76
|
|
|
77
77
|
```javascript
|
|
78
78
|
var Float32Array = require( '@stdlib/array-float32' );
|
|
79
|
-
var floor = require( '@stdlib/math-base-special-floor' );
|
|
80
79
|
|
|
81
80
|
var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );
|
|
82
|
-
var N = floor( x.length / 2 );
|
|
83
81
|
|
|
84
|
-
srev(
|
|
82
|
+
srev( 4, x, 2 );
|
|
85
83
|
// x => <Float32Array>[ -1.0, 1.0, 4.0, -5.0, 3.0, 0.0, -2.0, -3.0 ]
|
|
86
84
|
```
|
|
87
85
|
|
|
@@ -89,23 +87,21 @@ Note that indexing is relative to the first index. To introduce an offset, use [
|
|
|
89
87
|
|
|
90
88
|
```javascript
|
|
91
89
|
var Float32Array = require( '@stdlib/array-float32' );
|
|
92
|
-
var floor = require( '@stdlib/math-base-special-floor' );
|
|
93
90
|
|
|
94
91
|
// Initial array...
|
|
95
92
|
var x0 = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );
|
|
96
93
|
|
|
97
94
|
// Create an offset view...
|
|
98
95
|
var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
|
|
99
|
-
var N = floor( x0.length/2 );
|
|
100
96
|
|
|
101
97
|
// Reverse every other element...
|
|
102
|
-
srev(
|
|
98
|
+
srev( 3, x1, 2 );
|
|
103
99
|
// x0 => <Float32Array>[ 1.0, -6.0, 3.0, -4.0, 5.0, -2.0 ]
|
|
104
100
|
```
|
|
105
101
|
|
|
106
|
-
#### srev.ndarray( N, x,
|
|
102
|
+
#### srev.ndarray( N, x, strideX, offsetX )
|
|
107
103
|
|
|
108
|
-
Reverses a single-precision floating-point strided array
|
|
104
|
+
Reverses a single-precision floating-point strided array in-place using alternative indexing semantics.
|
|
109
105
|
|
|
110
106
|
```javascript
|
|
111
107
|
var Float32Array = require( '@stdlib/array-float32' );
|
|
@@ -118,9 +114,9 @@ srev.ndarray( x.length, x, 1, 0 );
|
|
|
118
114
|
|
|
119
115
|
The function has the following additional parameters:
|
|
120
116
|
|
|
121
|
-
- **
|
|
117
|
+
- **offsetX**: starting index.
|
|
122
118
|
|
|
123
|
-
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying
|
|
119
|
+
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of the strided array:
|
|
124
120
|
|
|
125
121
|
```javascript
|
|
126
122
|
var Float32Array = require( '@stdlib/array-float32' );
|
|
@@ -139,7 +135,7 @@ srev.ndarray( 3, x, 1, x.length-3 );
|
|
|
139
135
|
|
|
140
136
|
## Notes
|
|
141
137
|
|
|
142
|
-
- If `N <= 0`, both functions return
|
|
138
|
+
- If `N <= 0`, both functions return the strided array unchanged.
|
|
143
139
|
- Where possible, one should "reverse" a strided array by negating its stride, which is an `O(1)` operation, in contrast to performing an in-place reversal, which is `O(N)`. However, in certain circumstances, this is not tenable, particularly when interfacing with libraries which assume and/or expect a specific memory layout (e.g., strided array elements arranged in memory in ascending order). In general, when working with strided arrays, only perform an in-place reversal when strictly necessary.
|
|
144
140
|
|
|
145
141
|
</section>
|
|
@@ -153,27 +149,12 @@ srev.ndarray( 3, x, 1, x.length-3 );
|
|
|
153
149
|
<!-- eslint no-undef: "error" -->
|
|
154
150
|
|
|
155
151
|
```javascript
|
|
156
|
-
var
|
|
157
|
-
var randu = require( '@stdlib/random-base-randu' );
|
|
158
|
-
var Float32Array = require( '@stdlib/array-float32' );
|
|
152
|
+
var discreteUniform = require( '@stdlib/random-array-discrete-uniform' );
|
|
159
153
|
var srev = require( '@stdlib/blas-ext-base-srev' );
|
|
160
154
|
|
|
161
|
-
var
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
var i;
|
|
165
|
-
|
|
166
|
-
x = new Float32Array( 10 );
|
|
167
|
-
for ( i = 0; i < x.length; i++ ) {
|
|
168
|
-
rand = round( randu()*100.0 );
|
|
169
|
-
sign = randu();
|
|
170
|
-
if ( sign < 0.5 ) {
|
|
171
|
-
sign = -1.0;
|
|
172
|
-
} else {
|
|
173
|
-
sign = 1.0;
|
|
174
|
-
}
|
|
175
|
-
x[ i ] = sign * rand;
|
|
176
|
-
}
|
|
155
|
+
var x = discreteUniform( 10, -100, 100, {
|
|
156
|
+
'dtype': 'float32'
|
|
157
|
+
});
|
|
177
158
|
console.log( x );
|
|
178
159
|
|
|
179
160
|
srev( x.length, x, 1 );
|
|
@@ -184,6 +165,123 @@ console.log( x );
|
|
|
184
165
|
|
|
185
166
|
<!-- /.examples -->
|
|
186
167
|
|
|
168
|
+
<!-- C interface documentation. -->
|
|
169
|
+
|
|
170
|
+
* * *
|
|
171
|
+
|
|
172
|
+
<section class="c">
|
|
173
|
+
|
|
174
|
+
## C APIs
|
|
175
|
+
|
|
176
|
+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
|
|
177
|
+
|
|
178
|
+
<section class="intro">
|
|
179
|
+
|
|
180
|
+
</section>
|
|
181
|
+
|
|
182
|
+
<!-- /.intro -->
|
|
183
|
+
|
|
184
|
+
<!-- C usage documentation. -->
|
|
185
|
+
|
|
186
|
+
<section class="usage">
|
|
187
|
+
|
|
188
|
+
### Usage
|
|
189
|
+
|
|
190
|
+
```c
|
|
191
|
+
#include "stdlib/blas/ext/base/srev.h"
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
#### stdlib_strided_srev( N, \*X, strideX )
|
|
195
|
+
|
|
196
|
+
Reverses a single-precision floating-point strided array in-place.
|
|
197
|
+
|
|
198
|
+
```c
|
|
199
|
+
float x[] = { 1.0f, 2.0f, 3.0f, 4.0f };
|
|
200
|
+
|
|
201
|
+
stdlib_strided_srev( 4, x, 1 );
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
The function accepts the following arguments:
|
|
205
|
+
|
|
206
|
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
|
|
207
|
+
- **X**: `[inout] float*` input array.
|
|
208
|
+
- **strideX**: `[in] CBLAS_INT` stride length.
|
|
209
|
+
|
|
210
|
+
```c
|
|
211
|
+
void stdlib_strided_srev( const CBLAS_INT N, float *X, const CBLAS_INT strideX );
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
#### stdlib_strided_srev_ndarray( N, \*X, strideX, offsetX )
|
|
215
|
+
|
|
216
|
+
Reverses a single-precision floating-point strided array in-place using alternative indexing semantics.
|
|
217
|
+
|
|
218
|
+
```c
|
|
219
|
+
float x[] = { 1.0f, 2.0f, 3.0f, 4.0f };
|
|
220
|
+
|
|
221
|
+
stdlib_strided_srev_ndarray( 4, x, 1, 0 );
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
The function accepts the following arguments:
|
|
225
|
+
|
|
226
|
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
|
|
227
|
+
- **X**: `[inout] float*` input array.
|
|
228
|
+
- **strideX**: `[in] CBLAS_INT` stride length.
|
|
229
|
+
- **offsetX**: `[in] CBLAS_INT` starting index.
|
|
230
|
+
|
|
231
|
+
```c
|
|
232
|
+
void stdlib_strided_srev_ndarray( const CBLAS_INT N, float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX );
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
</section>
|
|
236
|
+
|
|
237
|
+
<!-- /.usage -->
|
|
238
|
+
|
|
239
|
+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
|
|
240
|
+
|
|
241
|
+
<section class="notes">
|
|
242
|
+
|
|
243
|
+
</section>
|
|
244
|
+
|
|
245
|
+
<!-- /.notes -->
|
|
246
|
+
|
|
247
|
+
<!-- C API usage examples. -->
|
|
248
|
+
|
|
249
|
+
<section class="examples">
|
|
250
|
+
|
|
251
|
+
### Examples
|
|
252
|
+
|
|
253
|
+
```c
|
|
254
|
+
#include "stdlib/blas/ext/base/srev.h"
|
|
255
|
+
#include <stdio.h>
|
|
256
|
+
|
|
257
|
+
int main( void ) {
|
|
258
|
+
// Create a strided array:
|
|
259
|
+
float x[] = { 1.0f, -2.0f, 3.0f, -4.0f, 5.0f, -6.0f, 7.0f, -8.0f };
|
|
260
|
+
|
|
261
|
+
// Specify the number of elements:
|
|
262
|
+
const int N = 8;
|
|
263
|
+
|
|
264
|
+
// Specify a stride:
|
|
265
|
+
const int strideX = 1;
|
|
266
|
+
|
|
267
|
+
// Reverse the array:
|
|
268
|
+
stdlib_strided_srev( N, x, strideX );
|
|
269
|
+
|
|
270
|
+
// Print the result:
|
|
271
|
+
for ( int i = 0; i < 8; i++ ) {
|
|
272
|
+
printf( "x[ %i ] = %f\n", i, x[ i ] );
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
</section>
|
|
278
|
+
|
|
279
|
+
<!-- /.examples -->
|
|
280
|
+
|
|
281
|
+
</section>
|
|
282
|
+
|
|
283
|
+
<!-- /.c -->
|
|
284
|
+
|
|
187
285
|
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
|
|
188
286
|
|
|
189
287
|
<section class="related">
|
|
@@ -225,7 +323,7 @@ See [LICENSE][stdlib-license].
|
|
|
225
323
|
|
|
226
324
|
## Copyright
|
|
227
325
|
|
|
228
|
-
Copyright © 2016-
|
|
326
|
+
Copyright © 2016-2026. The Stdlib [Authors][stdlib-authors].
|
|
229
327
|
|
|
230
328
|
</section>
|
|
231
329
|
|
|
@@ -238,8 +336,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
238
336
|
[npm-image]: http://img.shields.io/npm/v/@stdlib/blas-ext-base-srev.svg
|
|
239
337
|
[npm-url]: https://npmjs.org/package/@stdlib/blas-ext-base-srev
|
|
240
338
|
|
|
241
|
-
[test-image]: https://github.com/stdlib-js/blas-ext-base-srev/actions/workflows/test.yml/badge.svg?branch=v0.
|
|
242
|
-
[test-url]: https://github.com/stdlib-js/blas-ext-base-srev/actions/workflows/test.yml?query=branch:v0.
|
|
339
|
+
[test-image]: https://github.com/stdlib-js/blas-ext-base-srev/actions/workflows/test.yml/badge.svg?branch=v0.3.0
|
|
340
|
+
[test-url]: https://github.com/stdlib-js/blas-ext-base-srev/actions/workflows/test.yml?query=branch:v0.3.0
|
|
243
341
|
|
|
244
342
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/blas-ext-base-srev/main.svg
|
|
245
343
|
[coverage-url]: https://codecov.io/github/stdlib-js/blas-ext-base-srev?branch=main
|
|
@@ -251,8 +349,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
251
349
|
|
|
252
350
|
-->
|
|
253
351
|
|
|
254
|
-
[chat-image]: https://img.shields.io/
|
|
255
|
-
[chat-url]: https://
|
|
352
|
+
[chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
|
|
353
|
+
[chat-url]: https://stdlib.zulipchat.com
|
|
256
354
|
|
|
257
355
|
[stdlib]: https://github.com/stdlib-js/stdlib
|
|
258
356
|
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
var
|
|
3
|
-
});var
|
|
4
|
-
var
|
|
5
|
-
});var
|
|
6
|
-
var
|
|
7
|
-
});var
|
|
1
|
+
"use strict";var f=function(v,r){return function(){return r||v((r={exports:{}}).exports,r),r.exports}};var q=f(function(D,p){
|
|
2
|
+
var M=require('@stdlib/math-base-special-floor/dist'),s=3;function O(v,r,u,E){var i,e,a,o,n,t;if(v<=0)return r;if(n=M(v/2),e=E,u===1){if(o=n%s,a=e+v-1,o>0)for(t=0;t<o;t++)i=r[e],r[e]=r[a],r[a]=i,e+=u,a-=u;if(n<s)return r;for(t=o;t<n;t+=s)i=r[e],r[e]=r[a],r[a]=i,i=r[e+1],r[e+1]=r[a-1],r[a-1]=i,i=r[e+2],r[e+2]=r[a-2],r[a-2]=i,e+=s,a-=s;return r}for(a=e+(v-1)*u,t=0;t<n;t++)i=r[e],r[e]=r[a],r[a]=i,e+=u,a-=u;return r}p.exports=O
|
|
3
|
+
});var m=f(function(F,y){
|
|
4
|
+
var b=require('@stdlib/strided-base-stride2offset/dist'),d=q();function g(v,r,u){return d(v,r,u,b(v,u))}y.exports=g
|
|
5
|
+
});var R=f(function(G,l){
|
|
6
|
+
var h=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),j=m(),k=q();h(j,"ndarray",k);l.exports=j
|
|
7
|
+
});var w=require("path").join,z=require('@stdlib/utils-try-require/dist'),A=require('@stdlib/assert-is-error/dist'),B=R(),c,_=z(w(__dirname,"./native.js"));A(_)?c=B:c=_;module.exports=c;
|
|
8
8
|
/** @license Apache-2.0 */
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../lib/
|
|
4
|
-
"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 floor = require( '@stdlib/math-base-special-floor' );\n\n\n// VARIABLES //\n\nvar M = 3;\n\n\n// MAIN //\n\n/**\n* Reverses a single-precision floating-point strided array in-place.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} stride - index
|
|
5
|
-
"mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAQ,QAAS,iCAAkC,EAKnDC,EAAI,
|
|
6
|
-
"names": ["
|
|
3
|
+
"sources": ["../lib/ndarray.js", "../lib/srev.js", "../lib/main.js", "../lib/index.js"],
|
|
4
|
+
"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 floor = require( '@stdlib/math-base-special-floor' );\n\n\n// VARIABLES //\n\nvar M = 3;\n\n\n// MAIN //\n\n/**\n* Reverses a single-precision floating-point strided array in-place.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} strideX - stride length\n* @param {NonNegativeInteger} offsetX - starting index\n* @returns {Float32Array} input 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, -6.0 ] );\n*\n* srev( 3, x, 1, x.length-3 );\n* // x => <Float32Array>[ 1.0, -2.0, 3.0, -6.0, 5.0, -4.0 ]\n*/\nfunction srev( N, x, strideX, offsetX ) {\n\tvar tmp;\n\tvar ix;\n\tvar iy;\n\tvar m;\n\tvar n;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\tn = floor( N/2 );\n\tix = offsetX;\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( strideX === 1 ) {\n\t\tm = n % M;\n\t\tiy = ix + N - 1;\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\ttmp = x[ ix ];\n\t\t\t\tx[ ix ] = x[ iy ];\n\t\t\t\tx[ iy ] = tmp;\n\t\t\t\tix += strideX;\n\t\t\t\tiy -= strideX;\n\t\t\t}\n\t\t}\n\t\tif ( n < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < n; i += M ) {\n\t\t\ttmp = x[ ix ];\n\t\t\tx[ ix ] = x[ iy ];\n\t\t\tx[ iy ] = tmp;\n\n\t\t\ttmp = x[ ix+1 ];\n\t\t\tx[ ix+1 ] = x[ iy-1 ];\n\t\t\tx[ iy-1 ] = tmp;\n\n\t\t\ttmp = x[ ix+2 ];\n\t\t\tx[ ix+2 ] = x[ iy-2 ];\n\t\t\tx[ iy-2 ] = tmp;\n\n\t\t\tix += M;\n\t\t\tiy -= M;\n\t\t}\n\t\treturn x;\n\t}\n\tiy = ix + ( ( N-1 ) * strideX );\n\tfor ( i = 0; i < n; i++ ) {\n\t\ttmp = x[ ix ];\n\t\tx[ ix ] = x[ iy ];\n\t\tx[ iy ] = tmp;\n\t\tix += strideX;\n\t\tiy -= strideX;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = srev;\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// MODULES //\n\nvar stride2offset = require( '@stdlib/strided-base-stride2offset' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\n/**\n* Reverses a single-precision floating-point strided array in-place.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Float32Array} x - input array\n* @param {integer} strideX - stride length\n* @returns {Float32Array} input array\n*\n* @example\n* var Float32Array = require( '@stdlib/array-float32' );\n*\n* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* srev( x.length, x, 1 );\n* // x => <Float32Array>[ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ]\n*/\nfunction srev( N, x, strideX ) {\n\treturn ndarray( N, x, strideX, stride2offset( N, strideX ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = srev;\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// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar srev = require( './srev.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( srev, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = srev;\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* Reverse a single-precision floating-point strided array in-place.\n*\n* @module @stdlib/blas-ext-base-srev\n*\n* @example\n* var Float32Array = require( '@stdlib/array-float32' );\n* var srev = require( '@stdlib/blas-ext-base-srev' );\n*\n* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* srev( x.length, x, 1 );\n* // x => <Float32Array>[ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ]\n*\n* @example\n* var Float32Array = require( '@stdlib/array-float32' );\n* var srev = require( '@stdlib/blas-ext-base-srev' );\n*\n* var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* srev( x.length, x, 1, 0 );\n* // x => <Float32Array>[ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.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 srev;\nvar tmp = tryRequire( join( __dirname, './native.js' ) );\nif ( isError( tmp ) ) {\n\tsrev = main;\n} else {\n\tsrev = tmp;\n}\n\n\n// EXPORTS //\n\nmodule.exports = srev;\n\n// exports: { \"ndarray\": \"srev.ndarray\" }\n"],
|
|
5
|
+
"mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAQ,QAAS,iCAAkC,EAKnDC,EAAI,EAsBR,SAASC,EAAMC,EAAGC,EAAGC,EAASC,EAAU,CACvC,IAAIC,EACAC,EACAC,EACAC,EACA,EACAC,EAEJ,GAAKR,GAAK,EACT,OAAOC,EAMR,GAJA,EAAIJ,EAAOG,EAAE,CAAE,EACfK,EAAKF,EAGAD,IAAY,EAAI,CAKpB,GAJAK,EAAI,EAAIT,EACRQ,EAAKD,EAAKL,EAAI,EAGTO,EAAI,EACR,IAAMC,EAAI,EAAGA,EAAID,EAAGC,IACnBJ,EAAMH,EAAGI,CAAG,EACZJ,EAAGI,CAAG,EAAIJ,EAAGK,CAAG,EAChBL,EAAGK,CAAG,EAAIF,EACVC,GAAMH,EACNI,GAAMJ,EAGR,GAAK,EAAIJ,EACR,OAAOG,EAER,IAAMO,EAAID,EAAGC,EAAI,EAAGA,GAAKV,EACxBM,EAAMH,EAAGI,CAAG,EACZJ,EAAGI,CAAG,EAAIJ,EAAGK,CAAG,EAChBL,EAAGK,CAAG,EAAIF,EAEVA,EAAMH,EAAGI,EAAG,CAAE,EACdJ,EAAGI,EAAG,CAAE,EAAIJ,EAAGK,EAAG,CAAE,EACpBL,EAAGK,EAAG,CAAE,EAAIF,EAEZA,EAAMH,EAAGI,EAAG,CAAE,EACdJ,EAAGI,EAAG,CAAE,EAAIJ,EAAGK,EAAG,CAAE,EACpBL,EAAGK,EAAG,CAAE,EAAIF,EAEZC,GAAMP,EACNQ,GAAMR,EAEP,OAAOG,CACR,CAEA,IADAK,EAAKD,GAASL,EAAE,GAAME,EAChBM,EAAI,EAAGA,EAAI,EAAGA,IACnBJ,EAAMH,EAAGI,CAAG,EACZJ,EAAGI,CAAG,EAAIJ,EAAGK,CAAG,EAChBL,EAAGK,CAAG,EAAIF,EACVC,GAAMH,EACNI,GAAMJ,EAEP,OAAOD,CACR,CAKAL,EAAO,QAAUG,ICjHjB,IAAAU,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAgB,QAAS,oCAAqC,EAC9DC,EAAU,IAqBd,SAASC,EAAMC,EAAGC,EAAGC,EAAU,CAC9B,OAAOJ,EAASE,EAAGC,EAAGC,EAASL,EAAeG,EAAGE,CAAQ,CAAE,CAC5D,CAKAN,EAAO,QAAUG,ICnDjB,IAAAI,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAc,QAAS,uDAAwD,EAC/EC,EAAO,IACPC,EAAU,IAKdF,EAAaC,EAAM,UAAWC,CAAQ,EAKtCH,EAAO,QAAUE,ICYjB,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,EAAOD,EAEPC,EAAOC,EAMR,OAAO,QAAUD",
|
|
6
|
+
"names": ["require_ndarray", "__commonJSMin", "exports", "module", "floor", "M", "srev", "N", "x", "strideX", "offsetX", "tmp", "ix", "iy", "m", "i", "require_srev", "__commonJSMin", "exports", "module", "stride2offset", "ndarray", "srev", "N", "x", "strideX", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "srev", "ndarray", "join", "tryRequire", "isError", "main", "srev", "tmp"]
|
|
7
7
|
}
|
package/docs/types/index.d.ts
CHANGED
|
@@ -27,8 +27,8 @@ interface Routine {
|
|
|
27
27
|
*
|
|
28
28
|
* @param N - number of indexed elements
|
|
29
29
|
* @param x - input array
|
|
30
|
-
* @param
|
|
31
|
-
* @returns
|
|
30
|
+
* @param strideX - stride length
|
|
31
|
+
* @returns input array
|
|
32
32
|
*
|
|
33
33
|
* @example
|
|
34
34
|
* var Float32Array = require( '@stdlib/array-float32' );
|
|
@@ -38,16 +38,16 @@ interface Routine {
|
|
|
38
38
|
* srev( x.length, x, 1 );
|
|
39
39
|
* // x => <Float32Array>[ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ]
|
|
40
40
|
*/
|
|
41
|
-
( N: number, x: Float32Array,
|
|
41
|
+
( N: number, x: Float32Array, strideX: number ): Float32Array;
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* Reverses a single-precision floating-point strided array in-place. using alternative indexing semantics.
|
|
45
45
|
*
|
|
46
46
|
* @param N - number of indexed elements
|
|
47
47
|
* @param x - input array
|
|
48
|
-
* @param
|
|
49
|
-
* @param
|
|
50
|
-
* @returns
|
|
48
|
+
* @param strideX - stride length
|
|
49
|
+
* @param offsetX - starting index
|
|
50
|
+
* @returns input array
|
|
51
51
|
*
|
|
52
52
|
* @example
|
|
53
53
|
* var Float32Array = require( '@stdlib/array-float32' );
|
|
@@ -57,7 +57,7 @@ interface Routine {
|
|
|
57
57
|
* srev.ndarray( x.length, x, 1, 0 );
|
|
58
58
|
* // x => <Float32Array>[ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ]
|
|
59
59
|
*/
|
|
60
|
-
ndarray( N: number, x: Float32Array,
|
|
60
|
+
ndarray( N: number, x: Float32Array, strideX: number, offsetX: number ): Float32Array;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
/**
|
|
@@ -65,8 +65,8 @@ interface Routine {
|
|
|
65
65
|
*
|
|
66
66
|
* @param N - number of indexed elements
|
|
67
67
|
* @param x - input array
|
|
68
|
-
* @param
|
|
69
|
-
* @returns
|
|
68
|
+
* @param strideX - stride length
|
|
69
|
+
* @returns input array
|
|
70
70
|
*
|
|
71
71
|
* @example
|
|
72
72
|
* var Float32Array = require( '@stdlib/array-float32' );
|
|
@@ -16,13 +16,10 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
/**
|
|
20
|
-
* Header file containing function declarations.
|
|
21
|
-
*/
|
|
22
19
|
#ifndef STDLIB_BLAS_EXT_BASE_SREV_H
|
|
23
20
|
#define STDLIB_BLAS_EXT_BASE_SREV_H
|
|
24
21
|
|
|
25
|
-
#include
|
|
22
|
+
#include "stdlib/blas/base/shared.h"
|
|
26
23
|
|
|
27
24
|
/*
|
|
28
25
|
* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler.
|
|
@@ -34,7 +31,12 @@ extern "C" {
|
|
|
34
31
|
/**
|
|
35
32
|
* Reverses a single-precision floating-point strided array in-place.
|
|
36
33
|
*/
|
|
37
|
-
void
|
|
34
|
+
void API_SUFFIX(stdlib_strided_srev)( const CBLAS_INT N, float *X, const CBLAS_INT strideX );
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Reverses a single-precision floating-point strided array in-place using alternative indexing semantics.
|
|
38
|
+
*/
|
|
39
|
+
void API_SUFFIX(stdlib_strided_srev_ndarray)( const CBLAS_INT N, float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX );
|
|
38
40
|
|
|
39
41
|
#ifdef __cplusplus
|
|
40
42
|
}
|
package/lib/ndarray.js
CHANGED
|
@@ -35,8 +35,8 @@ var M = 3;
|
|
|
35
35
|
*
|
|
36
36
|
* @param {PositiveInteger} N - number of indexed elements
|
|
37
37
|
* @param {Float32Array} x - input array
|
|
38
|
-
* @param {integer}
|
|
39
|
-
* @param {NonNegativeInteger}
|
|
38
|
+
* @param {integer} strideX - stride length
|
|
39
|
+
* @param {NonNegativeInteger} offsetX - starting index
|
|
40
40
|
* @returns {Float32Array} input array
|
|
41
41
|
*
|
|
42
42
|
* @example
|
|
@@ -47,7 +47,7 @@ var M = 3;
|
|
|
47
47
|
* srev( 3, x, 1, x.length-3 );
|
|
48
48
|
* // x => <Float32Array>[ 1.0, -2.0, 3.0, -6.0, 5.0, -4.0 ]
|
|
49
49
|
*/
|
|
50
|
-
function srev( N, x,
|
|
50
|
+
function srev( N, x, strideX, offsetX ) {
|
|
51
51
|
var tmp;
|
|
52
52
|
var ix;
|
|
53
53
|
var iy;
|
|
@@ -59,10 +59,10 @@ function srev( N, x, stride, offset ) {
|
|
|
59
59
|
return x;
|
|
60
60
|
}
|
|
61
61
|
n = floor( N/2 );
|
|
62
|
-
ix =
|
|
62
|
+
ix = offsetX;
|
|
63
63
|
|
|
64
64
|
// Use loop unrolling if the stride is equal to `1`...
|
|
65
|
-
if (
|
|
65
|
+
if ( strideX === 1 ) {
|
|
66
66
|
m = n % M;
|
|
67
67
|
iy = ix + N - 1;
|
|
68
68
|
|
|
@@ -72,8 +72,8 @@ function srev( N, x, stride, offset ) {
|
|
|
72
72
|
tmp = x[ ix ];
|
|
73
73
|
x[ ix ] = x[ iy ];
|
|
74
74
|
x[ iy ] = tmp;
|
|
75
|
-
ix +=
|
|
76
|
-
iy -=
|
|
75
|
+
ix += strideX;
|
|
76
|
+
iy -= strideX;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
if ( n < M ) {
|
|
@@ -97,13 +97,13 @@ function srev( N, x, stride, offset ) {
|
|
|
97
97
|
}
|
|
98
98
|
return x;
|
|
99
99
|
}
|
|
100
|
-
iy = ix + ((N-1)*
|
|
100
|
+
iy = ix + ( ( N-1 ) * strideX );
|
|
101
101
|
for ( i = 0; i < n; i++ ) {
|
|
102
102
|
tmp = x[ ix ];
|
|
103
103
|
x[ ix ] = x[ iy ];
|
|
104
104
|
x[ iy ] = tmp;
|
|
105
|
-
ix +=
|
|
106
|
-
iy -=
|
|
105
|
+
ix += strideX;
|
|
106
|
+
iy -= strideX;
|
|
107
107
|
}
|
|
108
108
|
return x;
|
|
109
109
|
}
|
package/lib/ndarray.native.js
CHANGED
|
@@ -20,8 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
// MODULES //
|
|
22
22
|
|
|
23
|
-
var
|
|
24
|
-
var addon = require( './srev.native.js' );
|
|
23
|
+
var addon = require( './../src/addon.node' );
|
|
25
24
|
|
|
26
25
|
|
|
27
26
|
// MAIN //
|
|
@@ -31,8 +30,8 @@ var addon = require( './srev.native.js' );
|
|
|
31
30
|
*
|
|
32
31
|
* @param {PositiveInteger} N - number of indexed elements
|
|
33
32
|
* @param {Float32Array} x - input array
|
|
34
|
-
* @param {integer}
|
|
35
|
-
* @param {NonNegativeInteger}
|
|
33
|
+
* @param {integer} strideX - stride length
|
|
34
|
+
* @param {NonNegativeInteger} offsetX - starting index
|
|
36
35
|
* @returns {Float32Array} input array
|
|
37
36
|
*
|
|
38
37
|
* @example
|
|
@@ -43,13 +42,8 @@ var addon = require( './srev.native.js' );
|
|
|
43
42
|
* srev( 3, x, 1, x.length-3 );
|
|
44
43
|
* // x => <Float32Array>[ 1.0, -2.0, 3.0, -6.0, 5.0, -4.0 ]
|
|
45
44
|
*/
|
|
46
|
-
function srev( N, x,
|
|
47
|
-
|
|
48
|
-
if ( stride < 0 ) {
|
|
49
|
-
offset += (N-1) * stride;
|
|
50
|
-
}
|
|
51
|
-
view = new Float32Array( x.buffer, x.byteOffset+(x.BYTES_PER_ELEMENT*offset), x.length-offset ); // eslint-disable-line max-len
|
|
52
|
-
addon( N, view, stride );
|
|
45
|
+
function srev( N, x, strideX, offsetX ) {
|
|
46
|
+
addon.ndarray( N, x, strideX, offsetX );
|
|
53
47
|
return x;
|
|
54
48
|
}
|
|
55
49
|
|
package/lib/srev.js
CHANGED
|
@@ -20,12 +20,8 @@
|
|
|
20
20
|
|
|
21
21
|
// MODULES //
|
|
22
22
|
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
// VARIABLES //
|
|
27
|
-
|
|
28
|
-
var M = 3;
|
|
23
|
+
var stride2offset = require( '@stdlib/strided-base-stride2offset' );
|
|
24
|
+
var ndarray = require( './ndarray.js' );
|
|
29
25
|
|
|
30
26
|
|
|
31
27
|
// MAIN //
|
|
@@ -35,7 +31,7 @@ var M = 3;
|
|
|
35
31
|
*
|
|
36
32
|
* @param {PositiveInteger} N - number of indexed elements
|
|
37
33
|
* @param {Float32Array} x - input array
|
|
38
|
-
* @param {integer}
|
|
34
|
+
* @param {integer} strideX - stride length
|
|
39
35
|
* @returns {Float32Array} input array
|
|
40
36
|
*
|
|
41
37
|
* @example
|
|
@@ -46,67 +42,8 @@ var M = 3;
|
|
|
46
42
|
* srev( x.length, x, 1 );
|
|
47
43
|
* // x => <Float32Array>[ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ]
|
|
48
44
|
*/
|
|
49
|
-
function srev( N, x,
|
|
50
|
-
|
|
51
|
-
var ix;
|
|
52
|
-
var iy;
|
|
53
|
-
var m;
|
|
54
|
-
var n;
|
|
55
|
-
var i;
|
|
56
|
-
|
|
57
|
-
if ( N <= 0 ) {
|
|
58
|
-
return x;
|
|
59
|
-
}
|
|
60
|
-
n = floor( N/2 );
|
|
61
|
-
|
|
62
|
-
// Use loop unrolling if the stride is equal to `1`...
|
|
63
|
-
if ( stride === 1 ) {
|
|
64
|
-
m = n % M;
|
|
65
|
-
iy = N - 1;
|
|
66
|
-
|
|
67
|
-
// If we have a remainder, run a clean-up loop...
|
|
68
|
-
if ( m > 0 ) {
|
|
69
|
-
for ( ix = 0; ix < m; ix++ ) {
|
|
70
|
-
tmp = x[ ix ];
|
|
71
|
-
x[ ix ] = x[ iy ];
|
|
72
|
-
x[ iy ] = tmp;
|
|
73
|
-
iy -= 1;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
if ( n < M ) {
|
|
77
|
-
return x;
|
|
78
|
-
}
|
|
79
|
-
for ( ix = m; ix < n; ix += M ) {
|
|
80
|
-
tmp = x[ ix ];
|
|
81
|
-
x[ ix ] = x[ iy ];
|
|
82
|
-
x[ iy ] = tmp;
|
|
83
|
-
|
|
84
|
-
tmp = x[ ix+1 ];
|
|
85
|
-
x[ ix+1 ] = x[ iy-1 ];
|
|
86
|
-
x[ iy-1 ] = tmp;
|
|
87
|
-
|
|
88
|
-
tmp = x[ ix+2 ];
|
|
89
|
-
x[ ix+2 ] = x[ iy-2 ];
|
|
90
|
-
x[ iy-2 ] = tmp;
|
|
91
|
-
|
|
92
|
-
iy -= M;
|
|
93
|
-
}
|
|
94
|
-
return x;
|
|
95
|
-
}
|
|
96
|
-
if ( stride < 0 ) {
|
|
97
|
-
ix = (1-N) * stride;
|
|
98
|
-
} else {
|
|
99
|
-
ix = 0;
|
|
100
|
-
}
|
|
101
|
-
iy = ix + ((N-1)*stride);
|
|
102
|
-
for ( i = 0; i < n; i++ ) {
|
|
103
|
-
tmp = x[ ix ];
|
|
104
|
-
x[ ix ] = x[ iy ];
|
|
105
|
-
x[ iy ] = tmp;
|
|
106
|
-
ix += stride;
|
|
107
|
-
iy -= stride;
|
|
108
|
-
}
|
|
109
|
-
return x;
|
|
45
|
+
function srev( N, x, strideX ) {
|
|
46
|
+
return ndarray( N, x, strideX, stride2offset( N, strideX ) );
|
|
110
47
|
}
|
|
111
48
|
|
|
112
49
|
|
package/lib/srev.native.js
CHANGED
|
@@ -30,7 +30,7 @@ var addon = require( './../src/addon.node' );
|
|
|
30
30
|
*
|
|
31
31
|
* @param {PositiveInteger} N - number of indexed elements
|
|
32
32
|
* @param {Float32Array} x - input array
|
|
33
|
-
* @param {integer}
|
|
33
|
+
* @param {integer} strideX - stride length
|
|
34
34
|
* @returns {Float32Array} input array
|
|
35
35
|
*
|
|
36
36
|
* @example
|
|
@@ -41,8 +41,8 @@ var addon = require( './../src/addon.node' );
|
|
|
41
41
|
* srev( x.length, x, 1 );
|
|
42
42
|
* // x => <Float32Array>[ -3.0, -1.0, 0.0, 4.0, -5.0, 3.0, 1.0, -2.0 ]
|
|
43
43
|
*/
|
|
44
|
-
function srev( N, x,
|
|
45
|
-
addon( N, x,
|
|
44
|
+
function srev( N, x, strideX ) {
|
|
45
|
+
addon( N, x, strideX );
|
|
46
46
|
return x;
|
|
47
47
|
}
|
|
48
48
|
|
package/manifest.json
CHANGED
|
@@ -1,40 +1,78 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
2
|
+
"options": {
|
|
3
|
+
"task": "build"
|
|
4
|
+
},
|
|
5
|
+
"fields": [
|
|
6
|
+
{
|
|
7
|
+
"field": "src",
|
|
8
|
+
"resolve": true,
|
|
9
|
+
"relative": true
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"field": "include",
|
|
13
|
+
"resolve": true,
|
|
14
|
+
"relative": true
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"field": "libraries",
|
|
18
|
+
"resolve": false,
|
|
19
|
+
"relative": false
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"field": "libpath",
|
|
23
|
+
"resolve": true,
|
|
24
|
+
"relative": false
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"confs": [
|
|
28
|
+
{
|
|
29
|
+
"task": "build",
|
|
30
|
+
"src": [
|
|
31
|
+
"./src/main.c"
|
|
32
|
+
],
|
|
33
|
+
"include": [
|
|
34
|
+
"./include"
|
|
35
|
+
],
|
|
36
|
+
"libraries": [],
|
|
37
|
+
"libpath": [],
|
|
38
|
+
"dependencies": [
|
|
39
|
+
"@stdlib/napi-export",
|
|
40
|
+
"@stdlib/napi-argv",
|
|
41
|
+
"@stdlib/napi-argv-int64",
|
|
42
|
+
"@stdlib/napi-argv-strided-float32array",
|
|
43
|
+
"@stdlib/strided-base-stride2offset",
|
|
44
|
+
"@stdlib/blas-base-shared"
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"task": "benchmark",
|
|
49
|
+
"src": [
|
|
50
|
+
"./src/main.c"
|
|
51
|
+
],
|
|
52
|
+
"include": [
|
|
53
|
+
"./include"
|
|
54
|
+
],
|
|
55
|
+
"libraries": [],
|
|
56
|
+
"libpath": [],
|
|
57
|
+
"dependencies": [
|
|
58
|
+
"@stdlib/strided-base-stride2offset",
|
|
59
|
+
"@stdlib/blas-base-shared"
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"task": "examples",
|
|
64
|
+
"src": [
|
|
65
|
+
"./src/main.c"
|
|
66
|
+
],
|
|
67
|
+
"include": [
|
|
68
|
+
"./include"
|
|
69
|
+
],
|
|
70
|
+
"libraries": [],
|
|
71
|
+
"libpath": [],
|
|
72
|
+
"dependencies": [
|
|
73
|
+
"@stdlib/strided-base-stride2offset",
|
|
74
|
+
"@stdlib/blas-base-shared"
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
]
|
|
40
78
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdlib/blas-ext-base-srev",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Reverse a single-precision floating-point strided array in-place.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -34,11 +34,17 @@
|
|
|
34
34
|
"url": "https://github.com/stdlib-js/stdlib/issues"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@stdlib/assert-is-error": "^0.2.
|
|
38
|
-
"@stdlib/
|
|
39
|
-
"@stdlib/
|
|
40
|
-
"@stdlib/
|
|
41
|
-
"@stdlib/
|
|
37
|
+
"@stdlib/assert-is-error": "^0.2.2",
|
|
38
|
+
"@stdlib/blas-base-shared": "^0.1.0",
|
|
39
|
+
"@stdlib/math-base-special-floor": "^0.2.3",
|
|
40
|
+
"@stdlib/napi-argv": "^0.2.2",
|
|
41
|
+
"@stdlib/napi-argv-int64": "^0.2.2",
|
|
42
|
+
"@stdlib/napi-argv-strided-float32array": "^0.2.2",
|
|
43
|
+
"@stdlib/napi-export": "^0.3.0",
|
|
44
|
+
"@stdlib/strided-base-stride2offset": "^0.1.0",
|
|
45
|
+
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2",
|
|
46
|
+
"@stdlib/utils-library-manifest": "^0.2.3",
|
|
47
|
+
"@stdlib/utils-try-require": "^0.2.2"
|
|
42
48
|
},
|
|
43
49
|
"devDependencies": {},
|
|
44
50
|
"engines": {
|
|
@@ -75,7 +81,6 @@
|
|
|
75
81
|
"single",
|
|
76
82
|
"float32array"
|
|
77
83
|
],
|
|
78
|
-
"__stdlib__": {},
|
|
79
84
|
"funding": {
|
|
80
85
|
"type": "opencollective",
|
|
81
86
|
"url": "https://opencollective.com/stdlib"
|
package/src/addon.c
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Apache-2.0
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2024 The Stdlib Authors.
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
#include "stdlib/blas/ext/base/srev.h"
|
|
20
|
+
#include "stdlib/blas/base/shared.h"
|
|
21
|
+
#include "stdlib/napi/export.h"
|
|
22
|
+
#include "stdlib/napi/argv.h"
|
|
23
|
+
#include "stdlib/napi/argv_int64.h"
|
|
24
|
+
#include "stdlib/napi/argv_strided_float32array.h"
|
|
25
|
+
#include <node_api.h>
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Receives JavaScript callback invocation data.
|
|
29
|
+
*
|
|
30
|
+
* @param env environment under which the function is invoked
|
|
31
|
+
* @param info callback data
|
|
32
|
+
* @return Node-API value
|
|
33
|
+
*/
|
|
34
|
+
static napi_value addon( napi_env env, napi_callback_info info ) {
|
|
35
|
+
STDLIB_NAPI_ARGV( env, info, argv, argc, 3 );
|
|
36
|
+
STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 );
|
|
37
|
+
STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 2 );
|
|
38
|
+
STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, strideX, argv, 1 );
|
|
39
|
+
API_SUFFIX(stdlib_strided_srev)( N, X, strideX );
|
|
40
|
+
return NULL;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Receives JavaScript callback invocation data.
|
|
45
|
+
*
|
|
46
|
+
* @param env environment under which the function is invoked
|
|
47
|
+
* @param info callback data
|
|
48
|
+
* @return Node-API value
|
|
49
|
+
*/
|
|
50
|
+
static napi_value addon_method( napi_env env, napi_callback_info info ) {
|
|
51
|
+
STDLIB_NAPI_ARGV( env, info, argv, argc, 4 );
|
|
52
|
+
STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 );
|
|
53
|
+
STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 2 );
|
|
54
|
+
STDLIB_NAPI_ARGV_INT64( env, offsetX, argv, 3 );
|
|
55
|
+
STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, strideX, argv, 1 );
|
|
56
|
+
API_SUFFIX(stdlib_strided_srev_ndarray)( N, X, strideX, offsetX );
|
|
57
|
+
return NULL;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
STDLIB_NAPI_MODULE_EXPORT_FCN_WITH_METHOD( addon, "ndarray", addon_method );
|
package/src/{srev.c → main.c}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license Apache-2.0
|
|
3
3
|
*
|
|
4
|
-
* Copyright (c)
|
|
4
|
+
* Copyright (c) 2025 The Stdlib Authors.
|
|
5
5
|
*
|
|
6
6
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
* you may not use this file except in compliance with the License.
|
|
@@ -17,46 +17,62 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
#include "stdlib/blas/ext/base/srev.h"
|
|
20
|
-
#include
|
|
20
|
+
#include "stdlib/blas/base/shared.h"
|
|
21
|
+
#include "stdlib/strided/base/stride2offset.h"
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
24
|
* Reverses a single-precision floating-point strided array in-place.
|
|
24
25
|
*
|
|
25
|
-
* @param N
|
|
26
|
-
* @param X
|
|
27
|
-
* @param stride
|
|
26
|
+
* @param N number of indexed elements
|
|
27
|
+
* @param X input array
|
|
28
|
+
* @param strideX stride length
|
|
28
29
|
*/
|
|
29
|
-
void
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
void API_SUFFIX(stdlib_strided_srev)( const CBLAS_INT N, float *X, const CBLAS_INT strideX ) {
|
|
31
|
+
const CBLAS_INT ox = stdlib_strided_stride2offset( N, strideX );
|
|
32
|
+
API_SUFFIX(stdlib_strided_srev_ndarray)( N, X, strideX, ox );
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Reverses a single-precision floating-point strided array in-place using alternative indexing semantics.
|
|
37
|
+
*
|
|
38
|
+
* @param N number of indexed elements
|
|
39
|
+
* @param X input array
|
|
40
|
+
* @param strideX stride length
|
|
41
|
+
* @param offsetX stride length
|
|
42
|
+
*/
|
|
43
|
+
void API_SUFFIX(stdlib_strided_srev_ndarray)( const CBLAS_INT N, float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) {
|
|
44
|
+
CBLAS_INT ix;
|
|
45
|
+
CBLAS_INT iy;
|
|
46
|
+
CBLAS_INT m;
|
|
47
|
+
CBLAS_INT n;
|
|
48
|
+
CBLAS_INT i;
|
|
35
49
|
float tmp;
|
|
36
50
|
|
|
37
51
|
if ( N <= 0 ) {
|
|
38
52
|
return;
|
|
39
53
|
}
|
|
40
54
|
n = N / 2;
|
|
55
|
+
ix = offsetX;
|
|
41
56
|
|
|
42
57
|
// Use loop unrolling if the stride is equal to `1`...
|
|
43
|
-
if (
|
|
58
|
+
if ( strideX == 1 ) {
|
|
44
59
|
m = n % 3;
|
|
45
|
-
iy = N - 1;
|
|
60
|
+
iy = ix + N - 1;
|
|
46
61
|
|
|
47
62
|
// If we have a remainder, run a clean-up loop...
|
|
48
63
|
if ( m > 0 ) {
|
|
49
|
-
for (
|
|
64
|
+
for ( i = 0; i < m; i++ ) {
|
|
50
65
|
tmp = X[ ix ];
|
|
51
66
|
X[ ix ] = X[ iy ];
|
|
52
67
|
X[ iy ] = tmp;
|
|
53
|
-
|
|
68
|
+
ix += strideX;
|
|
69
|
+
iy -= strideX;
|
|
54
70
|
}
|
|
55
71
|
}
|
|
56
72
|
if ( n < 3 ) {
|
|
57
73
|
return;
|
|
58
74
|
}
|
|
59
|
-
for (
|
|
75
|
+
for ( i = m; i < n; i += 3 ) {
|
|
60
76
|
tmp = X[ ix ];
|
|
61
77
|
X[ ix ] = X[ iy ];
|
|
62
78
|
X[ iy ] = tmp;
|
|
@@ -69,22 +85,18 @@ void c_srev( const int64_t N, float *X, const int64_t stride ) {
|
|
|
69
85
|
X[ ix+2 ] = X[ iy-2 ];
|
|
70
86
|
X[ iy-2 ] = tmp;
|
|
71
87
|
|
|
88
|
+
ix += 3;
|
|
72
89
|
iy -= 3;
|
|
73
90
|
}
|
|
74
91
|
return;
|
|
75
92
|
}
|
|
76
|
-
|
|
77
|
-
ix = (1-N) * stride;
|
|
78
|
-
} else {
|
|
79
|
-
ix = 0;
|
|
80
|
-
}
|
|
81
|
-
iy = ix + ((N-1)*stride);
|
|
93
|
+
iy = ix + ( (N-1) * strideX );
|
|
82
94
|
for ( i = 0; i < n; i++ ) {
|
|
83
95
|
tmp = X[ ix ];
|
|
84
96
|
X[ ix ] = X[ iy ];
|
|
85
97
|
X[ iy ] = tmp;
|
|
86
|
-
ix +=
|
|
87
|
-
iy -=
|
|
98
|
+
ix += strideX;
|
|
99
|
+
iy -= strideX;
|
|
88
100
|
}
|
|
89
101
|
return;
|
|
90
102
|
}
|
package/include.gypi
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
# @license Apache-2.0
|
|
2
|
-
#
|
|
3
|
-
# Copyright (c) 2020 The Stdlib Authors.
|
|
4
|
-
#
|
|
5
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
# you may not use this file except in compliance with the License.
|
|
7
|
-
# You may obtain a copy of the License at
|
|
8
|
-
#
|
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
#
|
|
11
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
# See the License for the specific language governing permissions and
|
|
15
|
-
# limitations under the License.
|
|
16
|
-
|
|
17
|
-
# A GYP include file for building a Node.js native add-on.
|
|
18
|
-
#
|
|
19
|
-
# Main documentation:
|
|
20
|
-
#
|
|
21
|
-
# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md
|
|
22
|
-
# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md
|
|
23
|
-
{
|
|
24
|
-
# Define variables to be used throughout the configuration for all targets:
|
|
25
|
-
'variables': {
|
|
26
|
-
# Source directory:
|
|
27
|
-
'src_dir': './src',
|
|
28
|
-
|
|
29
|
-
# Include directories:
|
|
30
|
-
'include_dirs': [
|
|
31
|
-
'<!@(node -e "var arr = require(\'@stdlib/utils-library-manifest\')(\'./manifest.json\',{},{\'basedir\':process.cwd(),\'paths\':\'posix\'}).include; for ( var i = 0; i < arr.length; i++ ) { console.log( arr[ i ] ); }")',
|
|
32
|
-
],
|
|
33
|
-
|
|
34
|
-
# Add-on destination directory:
|
|
35
|
-
'addon_output_dir': './src',
|
|
36
|
-
|
|
37
|
-
# Source files:
|
|
38
|
-
'src_files': [
|
|
39
|
-
'<(src_dir)/addon.cpp',
|
|
40
|
-
'<!@(node -e "var arr = require(\'@stdlib/utils-library-manifest\')(\'./manifest.json\',{},{\'basedir\':process.cwd(),\'paths\':\'posix\'}).src; for ( var i = 0; i < arr.length; i++ ) { console.log( arr[ i ] ); }")',
|
|
41
|
-
],
|
|
42
|
-
|
|
43
|
-
# Library dependencies:
|
|
44
|
-
'libraries': [
|
|
45
|
-
'<!@(node -e "var arr = require(\'@stdlib/utils-library-manifest\')(\'./manifest.json\',{},{\'basedir\':process.cwd(),\'paths\':\'posix\'}).libraries; for ( var i = 0; i < arr.length; i++ ) { console.log( arr[ i ] ); }")',
|
|
46
|
-
],
|
|
47
|
-
|
|
48
|
-
# Library directories:
|
|
49
|
-
'library_dirs': [
|
|
50
|
-
'<!@(node -e "var arr = require(\'@stdlib/utils-library-manifest\')(\'./manifest.json\',{},{\'basedir\':process.cwd(),\'paths\':\'posix\'}).libpath; for ( var i = 0; i < arr.length; i++ ) { console.log( arr[ i ] ); }")',
|
|
51
|
-
],
|
|
52
|
-
}, # end variables
|
|
53
|
-
}
|
package/src/addon.cpp
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Apache-2.0
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2020 The Stdlib Authors.
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this file except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
#include "stdlib/blas/ext/base/srev.h"
|
|
20
|
-
#include <node_api.h>
|
|
21
|
-
#include <stdint.h>
|
|
22
|
-
#include <stdlib.h>
|
|
23
|
-
#include <stdbool.h>
|
|
24
|
-
#include <assert.h>
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Add-on namespace.
|
|
28
|
-
*/
|
|
29
|
-
namespace stdlib_blas_ext_base_srev {
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Reverses a single-precision floating-point strided array in-place.
|
|
33
|
-
*
|
|
34
|
-
* ## Notes
|
|
35
|
-
*
|
|
36
|
-
* - When called from JavaScript, the function expects three arguments:
|
|
37
|
-
*
|
|
38
|
-
* - `N`: number of indexed elements
|
|
39
|
-
* - `X`: input array
|
|
40
|
-
* - `strideX`: `X` stride length
|
|
41
|
-
*/
|
|
42
|
-
napi_value node_srev( napi_env env, napi_callback_info info ) {
|
|
43
|
-
napi_status status;
|
|
44
|
-
|
|
45
|
-
size_t argc = 3;
|
|
46
|
-
napi_value argv[ 3 ];
|
|
47
|
-
status = napi_get_cb_info( env, info, &argc, argv, nullptr, nullptr );
|
|
48
|
-
assert( status == napi_ok );
|
|
49
|
-
|
|
50
|
-
if ( argc < 3 ) {
|
|
51
|
-
napi_throw_error( env, nullptr, "invalid invocation. Must provide 3 arguments." );
|
|
52
|
-
return nullptr;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
napi_valuetype vtype0;
|
|
56
|
-
status = napi_typeof( env, argv[ 0 ], &vtype0 );
|
|
57
|
-
assert( status == napi_ok );
|
|
58
|
-
if ( vtype0 != napi_number ) {
|
|
59
|
-
napi_throw_type_error( env, nullptr, "invalid argument. First argument must be a number." );
|
|
60
|
-
return nullptr;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
bool res1;
|
|
64
|
-
status = napi_is_typedarray( env, argv[ 1 ], &res1 );
|
|
65
|
-
assert( status == napi_ok );
|
|
66
|
-
if ( res1 == false ) {
|
|
67
|
-
napi_throw_type_error( env, nullptr, "invalid argument. Second argument must be a Float32Array." );
|
|
68
|
-
return nullptr;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
napi_valuetype vtype2;
|
|
72
|
-
status = napi_typeof( env, argv[ 2 ], &vtype2 );
|
|
73
|
-
assert( status == napi_ok );
|
|
74
|
-
if ( vtype2 != napi_number ) {
|
|
75
|
-
napi_throw_type_error( env, nullptr, "invalid argument. Third argument must be a number." );
|
|
76
|
-
return nullptr;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
int64_t N;
|
|
80
|
-
status = napi_get_value_int64( env, argv[ 0 ], &N );
|
|
81
|
-
assert( status == napi_ok );
|
|
82
|
-
|
|
83
|
-
int64_t strideX;
|
|
84
|
-
status = napi_get_value_int64( env, argv[ 2 ], &strideX );
|
|
85
|
-
assert( status == napi_ok );
|
|
86
|
-
|
|
87
|
-
napi_typedarray_type vtype1;
|
|
88
|
-
size_t xlen;
|
|
89
|
-
void *X;
|
|
90
|
-
status = napi_get_typedarray_info( env, argv[ 1 ], &vtype1, &xlen, &X, nullptr, nullptr );
|
|
91
|
-
assert( status == napi_ok );
|
|
92
|
-
if ( vtype1 != napi_float32_array ) {
|
|
93
|
-
napi_throw_type_error( env, nullptr, "invalid argument. Second argument must be a Float32Array." );
|
|
94
|
-
return nullptr;
|
|
95
|
-
}
|
|
96
|
-
if ( (N-1)*llabs(strideX) >= (int64_t)xlen ) {
|
|
97
|
-
napi_throw_range_error( env, nullptr, "invalid argument. Second argument has insufficient elements based on the associated stride and the number of indexed elements." );
|
|
98
|
-
return nullptr;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
c_srev( N, (float *)X, strideX );
|
|
102
|
-
|
|
103
|
-
return nullptr;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
napi_value Init( napi_env env, napi_value exports ) {
|
|
107
|
-
napi_status status;
|
|
108
|
-
napi_value fcn;
|
|
109
|
-
status = napi_create_function( env, "exports", NAPI_AUTO_LENGTH, node_srev, NULL, &fcn );
|
|
110
|
-
assert( status == napi_ok );
|
|
111
|
-
return fcn;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
NAPI_MODULE( NODE_GYP_MODULE_NAME, Init )
|
|
115
|
-
} // end namespace stdlib_blas_ext_base_srev
|