Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Jul 6, 2024
1 parent ac930d9 commit 2ab647a
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 71 deletions.
1 change: 0 additions & 1 deletion .github/.keepalive

This file was deleted.

66 changes: 64 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
<section class="release" id="unreleased">

## Unreleased (2024-07-01)
## Unreleased (2024-07-06)

<section class="commits">

### Commits

<details>

- [`a591e05`](https://github.com/stdlib-js/stdlib/commit/a591e052cf1b1515c267781b914c6a482e150425) - **test:** fix test configuration _(by Athan Reines)_
- [`1600510`](https://github.com/stdlib-js/stdlib/commit/1600510d9214b9a33dc4dffa26762c78a1fa88e2) - **refactor:** reduce code duplication _(by Athan Reines)_

</details>

Expand All @@ -36,3 +36,65 @@ A total of 1 person contributed to this release. Thank you to this contributor:

<!-- /.release -->

<section class="release" id="v0.2.1">

## 0.2.1 (2024-02-22)

<section class="features">

### Features

- [`ca91187`](https://github.com/stdlib-js/stdlib/commit/ca9118749c1e8f3ad1f722ef69e3dc602e57b6c7) - update minimum TypeScript version

</section>

<!-- /.features -->

<section class="breaking-changes">

### BREAKING CHANGES

- [`ca91187`](https://github.com/stdlib-js/stdlib/commit/ca9118749c1e8f3ad1f722ef69e3dc602e57b6c7): update minimum TypeScript version
- [`ca91187`](https://github.com/stdlib-js/stdlib/commit/ca9118749c1e8f3ad1f722ef69e3dc602e57b6c7): update minimum TypeScript version to 4.1

- To migrate, users should upgrade their TypeScript version to at least version 4.1.

</section>

<!-- /.breaking-changes -->

<section class="commits">

### Commits

<details>

- [`dea49e0`](https://github.com/stdlib-js/stdlib/commit/dea49e03ab5571233e3da26835a6a6d3256d5737) - **docs:** use single quotes in require calls instead of backticks _(by Philipp Burckhardt)_
- [`7db5611`](https://github.com/stdlib-js/stdlib/commit/7db56115b014aa41e4a3458629286ae3bd99c4e7) - **docs:** update links and fix headings _(by Athan Reines)_
- [`f9c75ce`](https://github.com/stdlib-js/stdlib/commit/f9c75ce726ed4e5fade8622315bb98094dad8561) - **build:** remove tslint directives _(by Philipp Burckhardt)_
- [`ca91187`](https://github.com/stdlib-js/stdlib/commit/ca9118749c1e8f3ad1f722ef69e3dc602e57b6c7) - **feat:** update minimum TypeScript version _(by Philipp Burckhardt)_
- [`28e1c84`](https://github.com/stdlib-js/stdlib/commit/28e1c84390d88044883c9ef940a12f38d66ea3ef) - **docs:** resolve C lint errors _(by Athan Reines)_

</details>

</section>

<!-- /.commits -->

<section class="contributors">

### Contributors

A total of 2 people contributed to this release. Thank you to the following contributors:

- Athan Reines
- Philipp Burckhardt

</section>

<!-- /.contributors -->

</section>

<!-- /.release -->

10 changes: 5 additions & 5 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions dist/index.js.map

Large diffs are not rendered by default.

45 changes: 7 additions & 38 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@

'use strict';

// MODULES //

var stride2offset = require( '@stdlib/strided-base-stride2offset' );
var ndarray = require( './ndarray.js' );


// MAIN //

/**
Expand Down Expand Up @@ -51,44 +57,7 @@
* // => <Float64Array>[ 2.0, 4.0, 0.0, 8.0, 10.0 ]
*/
function dmskmap2( N, x, strideX, y, strideY, mask, strideMask, z, strideZ, fcn ) { // eslint-disable-line max-len
var ix;
var iy;
var iz;
var im;
var i;
if ( N <= 0 ) {
return z;
}
if ( strideX < 0 ) {
ix = (1-N) * strideX;
} else {
ix = 0;
}
if ( strideY < 0 ) {
iy = (1-N) * strideY;
} else {
iy = 0;
}
if ( strideZ < 0 ) {
iz = (1-N) * strideZ;
} else {
iz = 0;
}
if ( strideMask < 0 ) {
im = (1-N) * strideMask;
} else {
im = 0;
}
for ( i = 0; i < N; i++ ) {
if ( mask[ im ] === 0 ) {
z[ iz ] = fcn( x[ ix ], y[ iy ] );
}
ix += strideX;
iy += strideY;
iz += strideZ;
im += strideMask;
}
return z;
return ndarray( N, x, strideX, stride2offset( N, strideX ), y, strideY, stride2offset( N, strideY ), mask, strideMask, stride2offset( N, strideMask ), z, strideZ, stride2offset( N, strideZ ), fcn ); // eslint-disable-line max-len
}


Expand Down
4 changes: 3 additions & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
],
"libraries": [],
"libpath": [],
"dependencies": []
"dependencies": [
"@stdlib/strided-base-stride2offset"
]
}
]
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"url": "https://github.com/stdlib-js/stdlib/issues"
},
"dependencies": {
"@stdlib/strided-base-stride2offset": "github:stdlib-js/strided-base-stride2offset#main",
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.1",
"@stdlib/utils-library-manifest": "^0.2.1"
},
Expand Down
25 changes: 5 additions & 20 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

#include "stdlib/strided/base/dmskmap2.h"
#include "stdlib/strided/base/stride2offset.h"
#include <stdint.h>

/**
Expand Down Expand Up @@ -59,26 +60,10 @@ void stdlib_strided_dmskmap2( const int64_t N, const double *X, const int64_t st
if ( N <= 0 ) {
return;
}
if ( strideX < 0 ) {
ix = (1-N) * strideX;
} else {
ix = 0;
}
if ( strideY < 0 ) {
iy = (1-N) * strideY;
} else {
iy = 0;
}
if ( strideZ < 0 ) {
iz = (1-N) * strideZ;
} else {
iz = 0;
}
if ( strideMask < 0 ) {
im = (1-N) * strideMask;
} else {
im = 0;
}
ix = stdlib_strided_stride2offset( N, strideX );
iy = stdlib_strided_stride2offset( N, strideY );
iz = stdlib_strided_stride2offset( N, strideZ );
im = stdlib_strided_stride2offset( N, strideMask );
for ( i = 0; i < N; i++ ) {
if ( Mask[ im ] == 0 ) {
Z[ iz ] = fcn( X[ ix ], Y[ iy ] );
Expand Down

0 comments on commit 2ab647a

Please sign in to comment.