Skip to content

Commit c4e6ad7

Browse files
Merge branch 'stdlib-js:develop' into add-atan2f
2 parents acd6d78 + dfb4d35 commit c4e6ad7

File tree

170 files changed

+4613
-596
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+4613
-596
lines changed

lib/node_modules/@stdlib/blas/ext/base/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ var ns = extblas;
125125
- <span class="signature">[`sapxsum( N, alpha, x, stride )`][@stdlib/blas/ext/base/sapxsum]</span><span class="delimiter">: </span><span class="description">add a constant to each single-precision floating-point strided array element and compute the sum.</span>
126126
- <span class="signature">[`sapxsumkbn( N, alpha, x, stride )`][@stdlib/blas/ext/base/sapxsumkbn]</span><span class="delimiter">: </span><span class="description">add a constant to each single-precision floating-point strided array element and compute the sum using an improved Kahan–Babuška algorithm.</span>
127127
- <span class="signature">[`sapxsumkbn2( N, alpha, x, stride )`][@stdlib/blas/ext/base/sapxsumkbn2]</span><span class="delimiter">: </span><span class="description">add a constant to each single-precision floating-point strided array element and compute the sum using a second-order iterative Kahan–Babuška algorithm.</span>
128-
- <span class="signature">[`sapxsumors( N, alpha, x, stride )`][@stdlib/blas/ext/base/sapxsumors]</span><span class="delimiter">: </span><span class="description">add a constant to each single-precision floating-point strided array element and compute the sum using ordinary recursive summation.</span>
128+
- <span class="signature">[`sapxsumors( N, alpha, x, strideX )`][@stdlib/blas/ext/base/sapxsumors]</span><span class="delimiter">: </span><span class="description">add a scalar constant to each single-precision floating-point strided array element and compute the sum using ordinary recursive summation.</span>
129129
- <span class="signature">[`sapxsumpw( N, alpha, x, stride )`][@stdlib/blas/ext/base/sapxsumpw]</span><span class="delimiter">: </span><span class="description">add a constant to each single-precision floating-point strided array element and compute the sum using pairwise summation.</span>
130130
- <span class="signature">[`sasumpw( N, x, stride )`][@stdlib/blas/ext/base/sasumpw]</span><span class="delimiter">: </span><span class="description">calculate the sum of absolute values (_L1_ norm) of single-precision floating-point strided array elements using pairwise summation.</span>
131131
- <span class="signature">[`scusum( N, sum, x, strideX, y, strideY )`][@stdlib/blas/ext/base/scusum]</span><span class="delimiter">: </span><span class="description">calculate the cumulative sum of single-precision floating-point strided array elements.</span>

lib/node_modules/@stdlib/blas/ext/base/dapxsumors/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,10 @@ int main( void ) {
280280
281281
## See Also
282282
283-
- <span class="package-name">[`@stdlib/blas/ext/base/dapxsum`][@stdlib/blas/ext/base/dapxsum]</span><span class="delimiter">: </span><span class="description">adds a constant to each double-precision floating-point strided array element and computes the sum.</span>
283+
- <span class="package-name">[`@stdlib/blas/ext/base/dapxsum`][@stdlib/blas/ext/base/dapxsum]</span><span class="delimiter">: </span><span class="description">add a scalar constant to each double-precision floating-point strided array element and compute the sum.</span>
284284
- <span class="package-name">[`@stdlib/blas/ext/base/dsumors`][@stdlib/blas/ext/base/dsumors]</span><span class="delimiter">: </span><span class="description">calculate the sum of double-precision floating-point strided array elements using ordinary recursive summation.</span>
285-
- <span class="package-name">[`@stdlib/blas/ext/base/gapxsumors`][@stdlib/blas/ext/base/gapxsumors]</span><span class="delimiter">: </span><span class="description">adds a constant to each strided array element and computes the sum using ordinary recursive summation.</span>
286-
- <span class="package-name">[`@stdlib/blas/ext/base/sapxsumors`][@stdlib/blas/ext/base/sapxsumors]</span><span class="delimiter">: </span><span class="description">adds a constant to each single-precision floating-point strided array element and computes the sum using ordinary recursive summation.</span>
285+
- <span class="package-name">[`@stdlib/blas/ext/base/gapxsumors`][@stdlib/blas/ext/base/gapxsumors]</span><span class="delimiter">: </span><span class="description">add a constant to each strided array element and compute the sum using ordinary recursive summation.</span>
286+
- <span class="package-name">[`@stdlib/blas/ext/base/sapxsumors`][@stdlib/blas/ext/base/sapxsumors]</span><span class="delimiter">: </span><span class="description">add a scalar constant to each single-precision floating-point strided array element and compute the sum using ordinary recursive summation.</span>
287287
288288
</section>
289289

lib/node_modules/@stdlib/blas/ext/base/docs/types/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2361,12 +2361,12 @@ interface Namespace {
23612361
sapxsumkbn2: typeof sapxsumkbn2;
23622362

23632363
/**
2364-
* Adds a constant to each single-precision floating-point strided array element and computes the sum using ordinary recursive summation.
2364+
* Adds a scalar constant to each single-precision floating-point strided array element and computes the sum using ordinary recursive summation.
23652365
*
23662366
* @param N - number of indexed elements
2367-
* @param alpha - constant
2367+
* @param alpha - scalar constant
23682368
* @param x - input array
2369-
* @param stride - stride length
2369+
* @param strideX - stride length
23702370
* @returns sum
23712371
*
23722372
* @example

lib/node_modules/@stdlib/blas/ext/base/sapxsumors/README.md

Lines changed: 133 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ limitations under the License.
2020

2121
# sapxsumors
2222

23-
> Add a constant to each single-precision floating-point strided array element and compute the sum using ordinary recursive summation.
23+
> Add a scalar constant to each single-precision floating-point strided array element and compute the sum using ordinary recursive summation.
2424
2525
<section class="intro">
2626

@@ -36,9 +36,9 @@ limitations under the License.
3636
var sapxsumors = require( '@stdlib/blas/ext/base/sapxsumors' );
3737
```
3838

39-
#### sapxsumors( N, alpha, x, stride )
39+
#### sapxsumors( N, alpha, x, strideX )
4040

41-
Adds a constant to each single-precision floating-point strided array element and computes the sum using ordinary recursive summation.
41+
Adds a scalar constant to each single-precision floating-point strided array element and computes the sum using ordinary recursive summation.
4242

4343
```javascript
4444
var Float32Array = require( '@stdlib/array/float32' );
@@ -52,10 +52,11 @@ var v = sapxsumors( x.length, 5.0, x, 1 );
5252
The function has the following parameters:
5353

5454
- **N**: number of indexed elements.
55+
- **alpha**: scalar constant.
5556
- **x**: input [`Float32Array`][@stdlib/array/float32].
56-
- **stride**: index increment for `x`.
57+
- **strideX**: stride length.
5758

58-
The `N` and `stride` parameters determine which elements in the strided array are accessed at runtime. For example, to access every other element in `x`,
59+
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to access every other element:
5960

6061
```javascript
6162
var Float32Array = require( '@stdlib/array/float32' );
@@ -80,9 +81,9 @@ var v = sapxsumors( 4, 5.0, x1, 2 );
8081
// returns 25.0
8182
```
8283

83-
#### sapxsumors.ndarray( N, alpha, x, stride, offset )
84+
#### sapxsumors.ndarray( N, alpha, x, strideX, offsetX )
8485

85-
Adds a constant to each single-precision floating-point strided array element and computes the sum using ordinary recursive summation and alternative indexing semantics.
86+
Adds a scalar constant to each single-precision floating-point strided array element and computes the sum using ordinary recursive summation and alternative indexing semantics.
8687

8788
```javascript
8889
var Float32Array = require( '@stdlib/array/float32' );
@@ -95,9 +96,9 @@ var v = sapxsumors.ndarray( x.length, 5.0, x, 1, 0 );
9596

9697
The function has the following additional parameters:
9798

98-
- **offset**: starting index for `x`.
99+
- **offsetX**: starting index.
99100

100-
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 every other value in `x` starting from the second value
101+
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 every other element starting from the second element:
101102

102103
```javascript
103104
var Float32Array = require( '@stdlib/array/float32' );
@@ -130,12 +131,13 @@ var v = sapxsumors.ndarray( 4, 5.0, x, 2, 1 );
130131
<!-- eslint no-undef: "error" -->
131132

132133
```javascript
133-
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory;
134-
var filledarrayBy = require( '@stdlib/array/filled-by' );
134+
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
135135
var Float32Array = require( '@stdlib/array/float32' );
136136
var sapxsumors = require( '@stdlib/blas/ext/base/sapxsumors' );
137137

138-
var x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) );
138+
var x = discreteUniform( 10, -100, 100, {
139+
'dtype': 'float32'
140+
});
139141
console.log( x );
140142

141143
var v = sapxsumors( x.length, 5.0, x, 1 );
@@ -146,6 +148,125 @@ console.log( v );
146148

147149
<!-- /.examples -->
148150

151+
<!-- C interface documentation. -->
152+
153+
* * *
154+
155+
<section class="c">
156+
157+
## C APIs
158+
159+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
160+
161+
<section class="intro">
162+
163+
</section>
164+
165+
<!-- /.intro -->
166+
167+
<!-- C usage documentation. -->
168+
169+
<section class="usage">
170+
171+
### Usage
172+
173+
```c
174+
#include "stdlib/blas/ext/base/sapxsumors.h"
175+
```
176+
177+
#### stdlib_strided_sapxsumors( N, alpha, \*X, strideX )
178+
179+
Adds a scalar constant to each single-precision floating-point strided array element and computes the sum using ordinary recursive summation.
180+
181+
```c
182+
const float x[] = { 1.0f, 2.0f, 3.0f, 4.0f };
183+
184+
float v = stdlib_strided_sapxsumors( 4, 5.0f, x, 1 );
185+
// returns 30.0
186+
```
187+
188+
The function accepts the following arguments:
189+
190+
- **N**: `[in] CBLAS_INT` number of indexed elements.
191+
- **alpha**: `[in] float` scalar constant.
192+
- **X**: `[in] float*` input array.
193+
- **strideX**: `[in] CBLAS_INT` stride length.
194+
195+
```c
196+
float stdlib_strided_sapxsumors( const CBLAS_INT N, const float alpha, const float *X, const CBLAS_INT strideX );
197+
```
198+
199+
#### stdlib_strided_sapxsumors_ndarray( N, alpha, \*X, strideX, offsetX )
200+
201+
Adds a scalar constant to each single-precision floating-point strided array element and computes the sum using ordinary recursive summation and alternative indexing semantics.
202+
203+
```c
204+
const float x[] = { 1.0f, 2.0f, 3.0f, 4.0f };
205+
206+
float v = stdlib_strided_sapxsumors_ndarray( 4, 5.0f, x, 1, 0 );
207+
// returns 30.0
208+
```
209+
210+
The function accepts the following arguments:
211+
212+
- **N**: `[in] CBLAS_INT` number of indexed elements.
213+
- **alpha**: `[in] float` scalar constant.
214+
- **X**: `[in] float*` input array.
215+
- **strideX**: `[in] CBLAS_INT` stride length.
216+
- **offsetX**: `[in] CBLAS_INT` starting index.
217+
218+
```c
219+
float stdlib_strided_sapxsumors_ndarray( const CBLAS_INT N, const float alpha, const float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX );
220+
```
221+
222+
</section>
223+
224+
<!-- /.usage -->
225+
226+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
227+
228+
<section class="notes">
229+
230+
</section>
231+
232+
<!-- /.notes -->
233+
234+
<!-- C API usage examples. -->
235+
236+
<section class="examples">
237+
238+
### Examples
239+
240+
```c
241+
#include "stdlib/blas/ext/base/sapxsumors.h"
242+
#include <stdio.h>
243+
244+
int main( void ) {
245+
// Create a strided array:
246+
const float x[] = { 1.0f, -2.0f, 3.0f, -4.0f, 5.0f, -6.0f, 7.0f, -8.0f };
247+
248+
// Specify the number of indexed elements:
249+
const int N = 8;
250+
251+
// Specify a stride:
252+
const int strideX = 1;
253+
254+
// Compute the sum:
255+
float v = stdlib_strided_sapxsumors( N, 5.0f, x, strideX );
256+
257+
// Print the result:
258+
printf( "Sum: %f\n", v );
259+
}
260+
```
261+
262+
</section>
263+
264+
<!-- /.examples -->
265+
266+
</section>
267+
268+
<!-- /.c -->
269+
149270
<section class="references">
150271
151272
</section>

lib/node_modules/@stdlib/blas/ext/base/sapxsumors/benchmark/benchmark.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench' );
24-
var uniform = require( '@stdlib/random/base/uniform' ).factory;
25-
var filledarrayBy = require( '@stdlib/array/filled-by' );
24+
var uniform = require( '@stdlib/random/array/uniform' );
2625
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2726
var pow = require( '@stdlib/math/base/special/pow' );
2827
var pkg = require( './../package.json' ).name;
@@ -31,7 +30,9 @@ var sapxsumors = require( './../lib/sapxsumors.js' );
3130

3231
// VARIABLES //
3332

34-
var rand = uniform( -100.0, 100.0 );
33+
var options = {
34+
'dtype': 'float32'
35+
};
3536

3637

3738
// FUNCTIONS //
@@ -44,7 +45,7 @@ var rand = uniform( -100.0, 100.0 );
4445
* @returns {Function} benchmark function
4546
*/
4647
function createBenchmark( len ) {
47-
var x = filledarrayBy( len, 'float32', rand );
48+
var x = uniform( len, -100, 100, options );
4849
return benchmark;
4950

5051
function benchmark( b ) {

lib/node_modules/@stdlib/blas/ext/base/sapxsumors/benchmark/benchmark.native.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222

2323
var resolve = require( 'path' ).resolve;
2424
var bench = require( '@stdlib/bench' );
25-
var uniform = require( '@stdlib/random/base/uniform' ).factory;
26-
var filledarrayBy = require( '@stdlib/array/filled-by' );
25+
var uniform = require( '@stdlib/random/array/uniform' );
2726
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2827
var pow = require( '@stdlib/math/base/special/pow' );
2928
var tryRequire = require( '@stdlib/utils/try-require' );
@@ -36,7 +35,9 @@ var sapxsumors = tryRequire( resolve( __dirname, './../lib/sapxsumors.native.js'
3635
var opts = {
3736
'skip': ( sapxsumors instanceof Error )
3837
};
39-
var rand = uniform( -100.0, 100.0 );
38+
var options = {
39+
'dtype': 'float32'
40+
};
4041

4142

4243
// FUNCTIONS //
@@ -49,7 +50,7 @@ var rand = uniform( -100.0, 100.0 );
4950
* @returns {Function} benchmark function
5051
*/
5152
function createBenchmark( len ) {
52-
var x = filledarrayBy( len, 'float32', rand );
53+
var x = uniform( len, -100, 100, options );
5354
return benchmark;
5455

5556
function benchmark( b ) {

lib/node_modules/@stdlib/blas/ext/base/sapxsumors/benchmark/benchmark.ndarray.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench' );
24-
var uniform = require( '@stdlib/random/base/uniform' ).factory;
25-
var filledarrayBy = require( '@stdlib/array/filled-by' );
24+
var uniform = require( '@stdlib/random/array/uniform' );
2625
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2726
var pow = require( '@stdlib/math/base/special/pow' );
2827
var pkg = require( './../package.json' ).name;
@@ -31,7 +30,9 @@ var sapxsumors = require( './../lib/ndarray.js' );
3130

3231
// VARIABLES //
3332

34-
var rand = uniform( -100.0, 100.0 );
33+
var options = {
34+
'dtype': 'float32'
35+
};
3536

3637

3738
// FUNCTIONS //
@@ -44,7 +45,7 @@ var rand = uniform( -100.0, 100.0 );
4445
* @returns {Function} benchmark function
4546
*/
4647
function createBenchmark( len ) {
47-
var x = filledarrayBy( len, 'float32', rand );
48+
var x = uniform( len, -100, 100, options );
4849
return benchmark;
4950

5051
function benchmark( b ) {

lib/node_modules/@stdlib/blas/ext/base/sapxsumors/benchmark/benchmark.ndarray.native.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222

2323
var resolve = require( 'path' ).resolve;
2424
var bench = require( '@stdlib/bench' );
25-
var uniform = require( '@stdlib/random/base/uniform' ).factory;
26-
var filledarrayBy = require( '@stdlib/array/filled-by' );
25+
var uniform = require( '@stdlib/random/array/uniform' );
2726
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2827
var pow = require( '@stdlib/math/base/special/pow' );
2928
var tryRequire = require( '@stdlib/utils/try-require' );
@@ -36,7 +35,9 @@ var sapxsumors = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' )
3635
var opts = {
3736
'skip': ( sapxsumors instanceof Error )
3837
};
39-
var rand = uniform( -100.0, 100.0 );
38+
var options = {
39+
'dtype': 'float32'
40+
};
4041

4142

4243
// FUNCTIONS //
@@ -49,7 +50,7 @@ var rand = uniform( -100.0, 100.0 );
4950
* @returns {Function} benchmark function
5051
*/
5152
function createBenchmark( len ) {
52-
var x = filledarrayBy( len, 'float32', rand );
53+
var x = uniform( len, -100, 100, options );
5354
return benchmark;
5455

5556
function benchmark( b ) {

0 commit comments

Comments
 (0)