Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
22 changes: 11 additions & 11 deletions lib/node_modules/@stdlib/blas/ext/base/dapx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ limitations under the License.

# dapx

> Add a constant to each element in a double-precision floating-point strided array.
> Add a scalar constant to each element in a double-precision floating-point strided array.

<section class="usage">

Expand All @@ -32,7 +32,7 @@ var dapx = require( '@stdlib/blas/ext/base/dapx' );

#### dapx( N, alpha, x, strideX )

Adds a scalar constant `alpha` to each element in a double-precision floating-point strided array.
Adds a scalar constant to each element in a double-precision floating-point strided array.

```javascript
var Float64Array = require( '@stdlib/array/float64' );
Expand All @@ -48,9 +48,9 @@ The function has the following parameters:
- **N**: number of indexed elements.
- **alpha**: scalar constant.
- **x**: input [`Float64Array`][@stdlib/array/float64].
- **strideX**: index increment.
- **strideX**: stride length for `x`.

The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to add a constant to every other element
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to add a constant to every other element:

```javascript
var Float64Array = require( '@stdlib/array/float64' );
Expand Down Expand Up @@ -79,7 +79,7 @@ dapx( 3, 5.0, x1, 2 );

#### dapx.ndarray( N, alpha, x, strideX, offsetX )

Adds a scalar constant `alpha` to each element in a double-precision floating-point strided array using alternative indexing semantics.
Adds a scalar constant to each element in a double-precision floating-point strided array using alternative indexing semantics.

```javascript
var Float64Array = require( '@stdlib/array/float64' );
Expand All @@ -94,7 +94,7 @@ The function has the following additional parameters:

- **offsetX**: starting index.

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
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:

```javascript
var Float64Array = require( '@stdlib/array/float64' );
Expand Down Expand Up @@ -170,7 +170,7 @@ console.log( x );

#### c_dapx( N, alpha, \*X, strideX )

Adds a scalar constant `alpha` to each element in a double-precision floating-point strided array.
Adds a scalar constant to each element in a double-precision floating-point strided array.

```c
double x[] = { 1.0, 2.0, 3.0, 4.0 };
Expand All @@ -184,15 +184,15 @@ The function accepts the following arguments:
- **N**: `[in] CBLAS_INT` number of indexed elements.
- **alpha**: `[in] double` scalar constant.
- **X**: `[inout] double*` input array.
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
- **strideX**: `[in] CBLAS_INT` stride length for `X`.

```c
void c_dapx( const CBLAS_INT N, const double alpha, double *X, const CBLAS_INT strideX );
```

#### c_dapx_ndarray( N, alpha, \*X, strideX, offsetX )

Adds a scalar constant `alpha` to each element in a double-precision floating-point strided array `X` using alternative indexing semantics.
Adds a scalar constant to each element in a double-precision floating-point strided array using alternative indexing semantics.

```c
double x[] = { 1.0, 2.0, 3.0, 4.0 };
Expand All @@ -205,7 +205,7 @@ The function accepts the following arguments:
- **N**: `[in] CBLAS_INT` number of indexed elements.
- **alpha**: `[in] double` scalar constant.
- **X**: `[inout] double*` input array.
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.

```c
Expand Down Expand Up @@ -260,7 +260,7 @@ int main( void ) {

</section>

<!-- /.c -->
W<!-- /.c -->

<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ static double benchmark1( int iterations, int len ) {
}
t = tic();
for ( i = 0; i < iterations; i++ ) {
// cppcheck-suppress uninitvar
c_dapx( len, 5.0, x, 1 );
if ( x[ 0 ] != x[ 0 ] ) {
printf( "should not return NaN\n" );
Expand All @@ -129,6 +130,7 @@ static double benchmark2( int iterations, int len ) {
}
t = tic();
for ( i = 0; i < iterations; i++ ) {
// cppcheck-suppress uninitvar
c_dapx_ndarray( len, 5.0, x, 1, 0 );
if ( x[ 0 ] != x[ 0 ] ) {
printf( "should not return NaN\n" );
Expand Down
8 changes: 4 additions & 4 deletions lib/node_modules/@stdlib/blas/ext/base/dapx/docs/repl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
Number of indexed elements.

alpha: number
Constant.
Scalar constant.

x: Float64Array
Input array.

strideX: integer
Index increment.
Stride length.

Returns
-------
Expand Down Expand Up @@ -65,13 +65,13 @@
Number of indexed elements.

alpha: number
Constant.
Scalar constant.

x: Float64Array
Input array.

strideX: integer
Index increment.
Stride length.

offsetX: integer
Starting index.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface Routine {
* Adds a scalar constant to each element in a double-precision floating-point strided array.
*
* @param N - number of indexed elements
* @param alpha - constant
* @param alpha - scalar constant
* @param x - input array
* @param strideX - stride length
* @returns input array
Expand All @@ -45,7 +45,7 @@ interface Routine {
* Adds a scalar constant to each element in a double-precision floating-point strided array using alternative indexing semantics.
*
* @param N - number of indexed elements
* @param alpha - constant
* @param alpha - scalar constant
* @param x - input array
* @param strideX - stride length
* @param offsetX - starting index
Expand All @@ -66,7 +66,7 @@ interface Routine {
* Adds a scalar constant to each element in a double-precision floating-point strided array.
*
* @param N - number of indexed elements
* @param alpha - constant
* @param alpha - scalar constant
* @param x - input array
* @param strideX - stride length
* @returns input array
Expand Down
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/blas/ext/base/dapx/lib/dapx.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ var ndarray = require( './ndarray.js' );
* Adds a scalar constant to each element in a double-precision floating-point strided array.
*
* @param {PositiveInteger} N - number of indexed elements
* @param {number} alpha - scalar
* @param {number} alpha - scalar constant
* @param {Float64Array} x - input array
* @param {integer} strideX - index increment
* @param {integer} strideX - stride length
* @returns {Float64Array} input array
*
* @example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ var addon = require( './../src/addon.node' );
* Adds a scalar constant to each element in a double-precision floating-point strided array.
*
* @param {PositiveInteger} N - number of indexed elements
* @param {number} alpha - scalar
* @param {number} alpha - scalar constant
* @param {Float64Array} x - input array
* @param {integer} strideX - index increment
* @param {integer} strideX - stride length
* @returns {Float64Array} input array
*
* @example
Expand Down
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/blas/ext/base/dapx/lib/ndarray.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ var M = 5;
* Adds a scalar constant to each element in a double-precision floating-point strided array.
*
* @param {PositiveInteger} N - number of indexed elements
* @param {number} alpha - scalar
* @param {number} alpha - scalar constant
* @param {Float64Array} x - input array
* @param {integer} strideX - index increment
* @param {integer} strideX - stride length
* @param {NonNegativeInteger} offsetX - starting index
* @returns {Float64Array} input array
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ var addon = require( './../src/addon.node' );
* Adds a scalar constant to each element in a double-precision floating-point strided array.
*
* @param {PositiveInteger} N - number of indexed elements
* @param {number} alpha - scalar
* @param {number} alpha - scalar constant
* @param {Float64Array} x - input array
* @param {integer} strideX - index increment
* @param {integer} strideX - stride length
* @param {NonNegativeInteger} offsetX - starting index
* @returns {Float64Array} input array
*
Expand Down
16 changes: 8 additions & 8 deletions lib/node_modules/@stdlib/blas/ext/base/dapx/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
/**
* Adds a scalar constant to each element in a double-precision floating-point strided array.
*
* @param N number of indexed elements
* @param alpha scalar
* @param X input array
* @param strideX index increment
* @param N number of indexed elements
* @param alpha scalar constant
* @param X input array
* @param strideX stride length
*/
void API_SUFFIX(c_dapx)( const CBLAS_INT N, const double alpha, double *X, const CBLAS_INT strideX ) {
CBLAS_INT ox = stdlib_strided_stride2offset( N, strideX );
Expand All @@ -36,10 +36,10 @@ void API_SUFFIX(c_dapx)( const CBLAS_INT N, const double alpha, double *X, const
/**
* Adds a scalar constant to each element in a double-precision floating-point strided array using alternative indexing semantics.
*
* @param N number of indexed elements
* @param alpha scalar
* @param X input array
* @param strideX index increment
* @param N number of indexed elements
* @param alpha scalar constant
* @param X input array
* @param strideX stride length
* @param offsetX starting index
*/
void API_SUFFIX(c_dapx_ndarray)( const CBLAS_INT N, const double alpha, double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) {
Expand Down