Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/node_modules/@stdlib/blas/ext/base/dcusum/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,14 @@ stdlib_strided_dcusum( 4, 0.0, x, 1, y, 1 );
The function accepts the following arguments:

- **N**: `[in] CBLAS_INT` number of indexed elements.
- **sum**: `[in] CBLAS_INT` initial sum.
- **sum**: `[in] double` initial sum.
- **X**: `[in] double*` input array.
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
- **Y**: `[out] double*` output array.
- **strideY**: `[in] CBLAS_INT` index increment for `Y`.

```c
void stdlib_strided_dcusum( const CBLAS_INT N, const CBLAS_INT sum, const double *X, const CBLAS_INT strideX, double *Y, const CBLAS_INT strideY );
void stdlib_strided_dcusum( const CBLAS_INT N, const double sum, const double *X, const CBLAS_INT strideX, double *Y, const CBLAS_INT strideY );
```

<!-- lint disable maximum-heading-length -->
Expand All @@ -236,7 +236,7 @@ stdlib_strided_dcusum_ndarray( 4, 0.0, x, 1, 0, y, 1, 0 );
The function accepts the following arguments:

- **N**: `[in] CBLAS_INT` number of indexed elements.
- **sum**: `[in] CBLAS_INT` initial sum.
- **sum**: `[in] double` initial sum.
- **X**: `[in] double*` input array.
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
Expand All @@ -245,7 +245,7 @@ The function accepts the following arguments:
- **offsetY**: `[in] CBLAS_INT` starting index for `Y`.

```c
void stdlib_strided_dcusum_ndarray( const CBLAS_INT N, const CBLAS_INT sum, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, double *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY );
void stdlib_strided_dcusum_ndarray( const CBLAS_INT N, const double sum, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, double *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY );
```

</section>
Expand Down
8 changes: 4 additions & 4 deletions lib/node_modules/@stdlib/blas/ext/base/dcusumkbn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,14 @@ stdlib_strided_dcusumkbn( 4, 0.0, x, 1, y, 1 );
The function accepts the following arguments:

- **N**: `[in] CBLAS_INT` number of indexed elements.
- **sum**: `[in] CBLAS_INT` initial sum.
- **sum**: `[in] double` initial sum.
- **X**: `[in] double*` input array.
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
- **Y**: `[out] double*` output array.
- **strideY**: `[in] CBLAS_INT` index increment for `Y`.

```c
void stdlib_strided_dcusumkbn( const CBLAS_INT N, const CBLAS_INT sum, const double *X, const CBLAS_INT strideX, double *Y, const CBLAS_INT strideY );
void stdlib_strided_dcusumkbn( const CBLAS_INT N, const double sum, const double *X, const CBLAS_INT strideX, double *Y, const CBLAS_INT strideY );
```

<!-- lint disable maximum-heading-length -->
Expand All @@ -236,7 +236,7 @@ stdlib_strided_dcusumkbn_ndarray( 4, 0.0, x, 1, 0, y, 1, 0 );
The function accepts the following arguments:

- **N**: `[in] CBLAS_INT` number of indexed elements.
- **sum**: `[in] CBLAS_INT` initial sum.
- **sum**: `[in] double` initial sum.
- **X**: `[in] double*` input array.
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
Expand All @@ -245,7 +245,7 @@ The function accepts the following arguments:
- **offsetY**: `[in] CBLAS_INT` starting index for `Y`.

```c
void stdlib_strided_dcusumkbn_ndarray( const CBLAS_INT N, const CBLAS_INT sum, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, double *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY );
void stdlib_strided_dcusumkbn_ndarray( const CBLAS_INT N, const double sum, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, double *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY );
```

</section>
Expand Down
8 changes: 4 additions & 4 deletions lib/node_modules/@stdlib/blas/ext/base/dcusumkbn2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,14 @@ stdlib_strided_dcusumkbn2( 4, 0.0, x, 1, y, 1 );
The function accepts the following arguments:

- **N**: `[in] CBLAS_INT` number of indexed elements.
- **sum**: `[in] CBLAS_INT` initial sum.
- **sum**: `[in] double` initial sum.
- **X**: `[in] double*` input array.
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
- **Y**: `[out] double*` output array.
- **strideY**: `[in] CBLAS_INT` index increment for `Y`.

```c
void stdlib_strided_dcusumkbn2( const CBLAS_INT N, const CBLAS_INT sum, const double *X, const CBLAS_INT strideX, double *Y, const CBLAS_INT strideY );
void stdlib_strided_dcusumkbn2( const CBLAS_INT N, const double sum, const double *X, const CBLAS_INT strideX, double *Y, const CBLAS_INT strideY );
```

<!-- lint disable maximum-heading-length -->
Expand All @@ -242,7 +242,7 @@ stdlib_strided_dcusumkbn2_ndarray( 4, 0.0, x, 1, 0, y, 1, 0 );
The function accepts the following arguments:

- **N**: `[in] CBLAS_INT` number of indexed elements.
- **sum**: `[in] CBLAS_INT` initial sum.
- **sum**: `[in] double` initial sum.
- **X**: `[in] double*` input array.
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
Expand All @@ -251,7 +251,7 @@ The function accepts the following arguments:
- **offsetY**: `[in] CBLAS_INT` starting index for `Y`.

```c
void stdlib_strided_dcusumkbn2_ndarray( const CBLAS_INT N, const CBLAS_INT sum, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, double *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY );
void stdlib_strided_dcusumkbn2_ndarray( const CBLAS_INT N, const double sum, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, double *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY );
```

</section>
Expand Down
141 changes: 137 additions & 4 deletions lib/node_modules/@stdlib/blas/ext/base/dcusumors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ The function has the following additional parameters:
- **offsetX**: starting index for `x`.
- **offsetY**: starting index for `y`.

While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, `offsetX` and `offsetY` parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative sum of every other value in the strided input array starting from the second value and to store in the last `N` elements of the strided output array starting from the last element
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, offsetX and offsetY parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative sum of every other value in the strided input array starting from the second value and to store in the last `N` elements of the strided output array starting from the last element

```javascript
var Float64Array = require( '@stdlib/array/float64' );
Expand Down Expand Up @@ -149,12 +149,13 @@ dcusumors.ndarray( 4, 0.0, x, 2, 1, y, -1, y.length-1 );
<!-- eslint no-undef: "error" -->

```javascript
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory;
var filledarrayBy = require( '@stdlib/array/filled-by' );
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
var Float64Array = require( '@stdlib/array/float64' );
var dcusumors = require( '@stdlib/blas/ext/base/dcusumors' );

var x = filledarrayBy( 10, 'float64', discreteUniform( 0, 100 ) );
var x = discreteUniform( 10, -100, 100, {
'dtype': 'float64'
});
var y = new Float64Array( x.length );

console.log( x );
Expand All @@ -168,6 +169,138 @@ console.log( y );

<!-- /.examples -->

<!-- C interface documentation. -->

* * *

<section class="c">

## C APIs

<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->

<section class="intro">

</section>

<!-- /.intro -->

<!-- C usage documentation. -->

<section class="usage">

### Usage

```c
#include "stdlib/blas/ext/base/dcusumors.h"
```

#### stdlib_strided_dcusumors( N, sum, \*X, strideX, \*Y, strideY )

Computes the cumulative sum of double-precision floating-point strided array elements using ordinary recursive summation.

```c
const double x[] = { 1.0, 2.0, 3.0, 4.0 };
double y[] = { 0.0, 0.0, 0.0, 0.0 };

stdlib_strided_dcusumors( 4, 0.0, x, 1, y, 1 );
```

The function accepts the following arguments:

- **N**: `[in] CBLAS_INT` number of indexed elements.
- **sum**: `[in] double` initial sum.
- **X**: `[in] double*` input array.
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
- **Y**: `[out] double*` output array.
- **strideY**: `[in] CBLAS_INT` index increment for `Y`.

```c
void stdlib_strided_dcusumors( const CBLAS_INT N, double sum, const double *X, const CBLAS_INT strideX, double *Y, const CBLAS_INT strideY );
```

<!-- lint disable maximum-heading-length -->

#### stdlib_strided_dcusumors_ndarray( N, sum, \*X, strideX, offsetX, \*Y, strideY, offsetY )

<!-- lint enable maximum-heading-length -->

Computes the cumulative sum of double-precision floating-point strided array elements using ordinary recursive summation and alternative indexing semantics.

```c
const double x[] = { 1.0, 2.0, 3.0, 4.0 }
double y[] = { 0.0, 0.0, 0.0, 0.0 }

stdlib_strided_dcusumors_ndarray( 4, 0.0, x, 1, 0, y, 1, 0 );
```

The function accepts the following arguments:

- **N**: `[in] CBLAS_INT` number of indexed elements.
- **sum**: `[in] double` initial sum.
- **X**: `[in] double*` input array.
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
- **Y**: `[out] double*` output array.
- **strideY**: `[in] CBLAS_INT` index increment for `Y`.
- **offsetY**: `[in] CBLAS_INT` starting index for `Y`.

```c
void stdlib_strided_dcusumors_ndarray( const CBLAS_INT N, double sum, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, double *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY );
```

</section>

<!-- /.usage -->

<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="notes">

</section>

<!-- /.notes -->

<!-- C API usage examples. -->

<section class="examples">

### Examples

```c
#include "stdlib/blas/ext/base/dcusumors.h"
#include <stdio.h>

int main( void ) {
// Create strided arrays:
const double x[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 };
double y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };

// Specify the number of elements:
const int N = 4;

// Specify stride lengths:
const int strideX = 2;
const int strideY = -2;

// Compute the cumulative sum:
stdlib_strided_dcusumors( N, 0.0, x, strideX, y, strideY );

// Print the result:
for ( int i = 0; i < 8; i++ ) {
printf( "y[ %d ] = %lf\n", i, y[ i ] );
}
}
```

</section>

<!-- /.examples -->

</section>

<!-- /.c -->

<section class="references">

</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
// MODULES //

var bench = require( '@stdlib/bench' );
var uniform = require( '@stdlib/random/base/uniform' ).factory;
var filledarrayBy = require( '@stdlib/array/filled-by' );
var uniform = require( '@stdlib/random/array/uniform' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var pow = require( '@stdlib/math/base/special/pow' );
var Float64Array = require( '@stdlib/array/float64' );
Expand All @@ -32,7 +31,9 @@ var dcusumors = require( './../lib/dcusumors.js' );

// VARIABLES //

var rand = uniform( -10.0, 10.0 );
var options = {
'dtype': 'float64'
};


// FUNCTIONS //
Expand All @@ -45,7 +46,7 @@ var rand = uniform( -10.0, 10.0 );
* @returns {Function} benchmark function
*/
function createBenchmark( len ) {
var x = filledarrayBy( len, 'float64', rand );
var x = uniform( len, -100, 100, options );
var y = new Float64Array( len );
return benchmark;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@

var resolve = require( 'path' ).resolve;
var bench = require( '@stdlib/bench' );
var uniform = require( '@stdlib/random/base/uniform' ).factory;
var filledarrayBy = require( '@stdlib/array/filled-by' );
var uniform = require( '@stdlib/random/array/uniform' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var pow = require( '@stdlib/math/base/special/pow' );
var Float64Array = require( '@stdlib/array/float64' );
Expand All @@ -33,7 +32,9 @@ var pkg = require( './../package.json' ).name;

// VARIABLES //

var rand = uniform( -10.0, 10.0 );
var options = {
'dtype': 'float64'
};
var dcusumors = tryRequire( resolve( __dirname, './../lib/dcusumors.native.js' ) );
var opts = {
'skip': ( dcusumors instanceof Error )
Expand All @@ -50,7 +51,7 @@ var opts = {
* @returns {Function} benchmark function
*/
function createBenchmark( len ) {
var x = filledarrayBy( len, 'float64', rand );
var x = uniform( len, -100, 100, options );
var y = new Float64Array( len );
return benchmark;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
// MODULES //

var bench = require( '@stdlib/bench' );
var uniform = require( '@stdlib/random/base/uniform' ).factory;
var filledarrayBy = require( '@stdlib/array/filled-by' );
var uniform = require( '@stdlib/random/array/uniform' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var pow = require( '@stdlib/math/base/special/pow' );
var Float64Array = require( '@stdlib/array/float64' );
Expand All @@ -32,7 +31,9 @@ var dcusumors = require( './../lib/ndarray.js' );

// VARIABLES //

var rand = uniform( -10.0, 10.0 );
var options = {
'dtype': 'float64'
};


// FUNCTIONS //
Expand All @@ -45,7 +46,7 @@ var rand = uniform( -10.0, 10.0 );
* @returns {Function} benchmark function
*/
function createBenchmark( len ) {
var x = filledarrayBy( len, 'float64', rand );
var x = uniform( len, -100, 100, options );
var y = new Float64Array( len );
return benchmark;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@

var resolve = require( 'path' ).resolve;
var bench = require( '@stdlib/bench' );
var uniform = require( '@stdlib/random/base/uniform' ).factory;
var filledarrayBy = require( '@stdlib/array/filled-by' );
var uniform = require( '@stdlib/random/array/uniform' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var pow = require( '@stdlib/math/base/special/pow' );
var Float64Array = require( '@stdlib/array/float64' );
Expand All @@ -33,7 +32,9 @@ var pkg = require( './../package.json' ).name;

// VARIABLES //

var rand = uniform( -10.0, 10.0 );
var options = {
'dtype': 'float64'
};
var dcusumors = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) );
var opts = {
'skip': ( dcusumors instanceof Error )
Expand All @@ -50,7 +51,7 @@ var opts = {
* @returns {Function} benchmark function
*/
function createBenchmark( len ) {
var x = filledarrayBy( len, 'float64', rand );
var x = uniform( len, -100, 100, options );
var y = new Float64Array( len );
return benchmark;

Expand Down
Loading
Loading