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 Jun 25, 2024
1 parent 969319f commit f40d06c
Show file tree
Hide file tree
Showing 11 changed files with 243 additions and 218 deletions.
1 change: 0 additions & 1 deletion .github/.keepalive

This file was deleted.

4 changes: 4 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ jobs:
# Replace branch in README.md link definitions for badges with the new version:
find . -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/branch([=:])[^ ]+/branch\1v${NEW_VERSION}/g"
# Rewrite CHANGELOG.md to replace "Unreleased" with the new version:
sed -Ei "s/Unreleased/${NEW_VERSION}/g" CHANGELOG.md
sed -Ei "s/unreleased/v${NEW_VERSION}/g" CHANGELOG.md
# Create a new commit and tag:
git add package.json README.md
git commit -m "Release v${NEW_VERSION}"
Expand Down
98 changes: 97 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,100 @@

> Package changelog.
See [GitHub Releases](https://github.com/stdlib-js/blas-ext-base-dsort2sh/releases) for the changelog.
<section class="release" id="unreleased">

## Unreleased (2024-06-25)

<section class="commits">

### Commits

<details>

- [`e87d921`](https://github.com/stdlib-js/stdlib/commit/e87d921d5c2b73b2cd3bf7cd78ff503bd2fd49d7) - **refactor:** update `blas/ext/base/dsort2hp` to follow current project conventions _(by Jaimin Godhani, Athan Reines, Philipp Burckhardt)_

</details>

</section>

<!-- /.commits -->

<section class="contributors">

### Contributors

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

- Athan Reines
- Jaimin Godhani
- Philipp Burckhardt

</section>

<!-- /.contributors -->

</section>

<!-- /.release -->

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

## 0.2.1 (2024-02-22)

<section class="features">

### Features

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

</section>

<!-- /.features -->

<section class="breaking-changes">

### BREAKING CHANGES

- [`cca37d0`](https://github.com/stdlib-js/stdlib/commit/cca37d051d8c0209970fc681353fdb4e4d257a8a): update minimum TypeScript version
- [`cca37d0`](https://github.com/stdlib-js/stdlib/commit/cca37d051d8c0209970fc681353fdb4e4d257a8a): 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)_
- [`df3c9b3`](https://github.com/stdlib-js/stdlib/commit/df3c9b368d8a3dd7dd38f8768deb53c2a780c055) - **build:** remove tslint directives _(by Philipp Burckhardt)_
- [`cca37d0`](https://github.com/stdlib-js/stdlib/commit/cca37d051d8c0209970fc681353fdb4e4d257a8a) - **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 -->

3 changes: 2 additions & 1 deletion CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Pushpendra Chandravanshi <pushpendrachandravanshi4@gmail.com>
Raunak Kumar Gupta <raunakmodanwal321@gmail.com>
Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
Ricky Reusser <rsreusser@gmail.com>
Ridam Garg <67867319+RidamGarg@users.noreply.github.com>
Robert Gislason <gztown2216@yahoo.com>
Roman Stetsyk <25715951+romanstetsyk@users.noreply.github.com>
Rutam <138517416+performant23@users.noreply.github.com>
Expand All @@ -75,7 +76,7 @@ Shraddheya Shendre <shendreshraddheya@gmail.com>
Shubh Mehta <93862397+Shubh942@users.noreply.github.com>
Shubham Mishra <shubh622005@gmail.com>
Sivam Das <100067002+Sivam2313@users.noreply.github.com>
Snehil Shah <130062020+Snehil-Shah@users.noreply.github.com>
Snehil Shah <snehilshah.989@gmail.com>
Soumajit Chatterjee <121816890+soumajit23@users.noreply.github.com>
Spandan Barve <contact@marsian.dev>
Stephannie Jiménez Gacha <steff456@hotmail.com>
Expand Down
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,11 @@ The `N` and `stride` parameters determine which elements in `x` and `y` are acce

```javascript
var Float64Array = require( '@stdlib/array-float64' );
var floor = require( '@stdlib/math-base-special-floor' );

var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );
var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );
var N = floor( x.length / 2 );

dsort2sh( N, -1.0, x, 2, y, 2 );
dsort2sh( 2, -1.0, x, 2, y, 2 );

console.log( x );
// => <Float64Array>[ 3.0, -2.0, 1.0, -4.0 ]
Expand All @@ -114,7 +112,6 @@ Note that indexing is relative to the first index. To introduce an offset, use [

```javascript
var Float64Array = require( '@stdlib/array-float64' );
var floor = require( '@stdlib/math-base-special-floor' );

// Initial arrays...
var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
Expand All @@ -123,10 +120,9 @@ var y0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );
// Create offset views...
var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
var N = floor( x0.length/2 );

// Sort every other element...
dsort2sh( N, -1.0, x1, 2, y1, 2 );
dsort2sh( 2, -1.0, x1, 2, y1, 2 );

console.log( x0 );
// => <Float64Array>[ 1.0, 4.0, 3.0, 2.0 ]
Expand Down
2 changes: 1 addition & 1 deletion include.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

# Source files:
'src_files': [
'<(src_dir)/addon.cpp',
'<(src_dir)/addon.c',
'<!@(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 ] ); }")',
],

Expand Down
6 changes: 3 additions & 3 deletions lib/ndarray.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

// MODULES //

var Float64Array = require( '@stdlib/array-float64' );
var offsetView = require( '@stdlib/strided-base-offset-view' );
var addon = require( './dsort2sh.native.js' );


Expand Down Expand Up @@ -68,8 +68,8 @@ function dsort2sh( N, order, x, strideX, offsetX, y, strideY, offsetY ) {
if ( strideY < 0 ) {
offsetY += (N-1) * strideY;
}
viewX = new Float64Array( x.buffer, x.byteOffset+(x.BYTES_PER_ELEMENT*offsetX), x.length-offsetX ); // eslint-disable-line max-len
viewY = new Float64Array( y.buffer, y.byteOffset+(y.BYTES_PER_ELEMENT*offsetY), y.length-offsetY ); // eslint-disable-line max-len
viewX = offsetView( x, offsetX );
viewY = offsetView( y, offsetY );
addon( N, order, viewX, strideX, viewY, flg*strideY );
return x;
}
Expand Down
120 changes: 79 additions & 41 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,81 @@
{
"options": {},
"fields": [
{
"field": "src",
"resolve": true,
"relative": true
},
{
"field": "include",
"resolve": true,
"relative": true
},
{
"field": "libraries",
"resolve": false,
"relative": false
},
{
"field": "libpath",
"resolve": true,
"relative": false
}
],
"confs": [
{
"src": [
"./src/dsort2sh.c"
],
"include": [
"./include"
],
"libraries": [
"-lm"
],
"libpath": [],
"dependencies": [
"@stdlib/math-base-assert-is-nan",
"@stdlib/math-base-assert-is-negative-zero"
]
}
]
"options": {
"task": "build"
},
"fields": [
{
"field": "src",
"resolve": true,
"relative": true
},
{
"field": "include",
"resolve": true,
"relative": true
},
{
"field": "libraries",
"resolve": false,
"relative": false
},
{
"field": "libpath",
"resolve": true,
"relative": false
}
],
"confs": [
{
"task": "build",
"src": [
"./src/dsort2sh.c"
],
"include": [
"./include"
],
"libraries": [
"-lm"
],
"libpath": [],
"dependencies": [
"@stdlib/napi-export",
"@stdlib/math-base-assert-is-nan",
"@stdlib/math-base-assert-is-negative-zero",
"@stdlib/napi-argv",
"@stdlib/napi-argv-int64",
"@stdlib/napi-argv-double",
"@stdlib/napi-argv-strided-float64array"
]
},
{
"task": "benchmark",
"src": [
"./src/dsort2sh.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/math-base-assert-is-nan",
"@stdlib/math-base-assert-is-negative-zero"
]
},
{
"task": "examples",
"src": [
"./src/dsort2sh.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/math-base-assert-is-nan",
"@stdlib/math-base-assert-is-negative-zero"
]
}
]
}
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@
"@stdlib/assert-is-error": "^0.2.1",
"@stdlib/math-base-assert-is-nan": "^0.2.1",
"@stdlib/math-base-assert-is-negative-zero": "^0.2.1",
"@stdlib/napi-argv": "^0.2.1",
"@stdlib/napi-argv-double": "^0.2.1",
"@stdlib/napi-argv-int64": "^0.2.1",
"@stdlib/napi-argv-strided-float64array": "^0.2.1",
"@stdlib/napi-export": "^0.2.1",
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.1",
"@stdlib/utils-library-manifest": "^0.2.1",
"@stdlib/utils-try-require": "^0.2.1"
Expand All @@ -59,6 +64,7 @@
"@stdlib/random-base-discrete-uniform": "^0.2.1",
"@stdlib/random-base-randu": "^0.2.1",
"@stdlib/random-base-uniform": "^0.2.1",
"@stdlib/strided-base-offset-view": "^0.2.1",
"proxyquire": "^2.0.0",
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
"istanbul": "^0.4.1",
Expand Down
49 changes: 49 additions & 0 deletions src/addon.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2024 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "stdlib/blas/ext/base/dsort2sh.h"
#include "stdlib/napi/export.h"
#include "stdlib/napi/argv.h"
#include "stdlib/napi/argv_int64.h"
#include "stdlib/napi/argv_double.h"
#include "stdlib/napi/argv_strided_float64array.h"
#include <node_api.h>

/**
* Receives JavaScript callback invocation data.
*
* @private
* @param env environment under which the function is invoked
* @param info callback data
* @return Node-API value
*/
static napi_value addon( napi_env env, napi_callback_info info ) {
STDLIB_NAPI_ARGV( env, info, argv, argc, 6 );
STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 );
STDLIB_NAPI_ARGV_DOUBLE( env, order, argv, 1 );
STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, order, argv, 2 );
STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 3 );
STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, Y, N, order, argv, 4 );
STDLIB_NAPI_ARGV_INT64( env, strideY, argv, 5 );

c_dsort2sh( N, order, X, strideX, Y, strideY );

return NULL;
}

STDLIB_NAPI_MODULE_EXPORT_FCN( addon )
Loading

0 comments on commit f40d06c

Please sign in to comment.