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 9, 2024
1 parent 7ff5a41 commit 706fa61
Show file tree
Hide file tree
Showing 14 changed files with 169 additions and 76 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
93 changes: 92 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,95 @@

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

## Unreleased (2024-06-09)

<section class="commits">

### Commits

<details>

- [`539fc72`](https://github.com/stdlib-js/stdlib/commit/539fc725d1fea6738862de98e3f3c6385fbdc0e6) - **style:** fix indentation _(by Athan Reines)_
- [`71b0621`](https://github.com/stdlib-js/stdlib/commit/71b06218afbce673efa51c4704f26637a27a1d1c) - **refactor:** ensure enumeration constants match BLAS layouts _(by Athan Reines)_

</details>

</section>

<!-- /.commits -->

<section class="contributors">

### Contributors

A total of 1 person contributed to this release. Thank you to this contributor:

- Athan Reines

</section>

<!-- /.contributors -->

</section>

<!-- /.release -->

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

## 0.2.1 (2024-02-22)

<section class="features">

### Features

- [`7ae5741`](https://github.com/stdlib-js/stdlib/commit/7ae574143c9716c82cea6cbf839a20b70a9cdfe0) - update minimum TypeScript version

</section>

<!-- /.features -->

<section class="breaking-changes">

### BREAKING CHANGES

- [`7ae5741`](https://github.com/stdlib-js/stdlib/commit/7ae574143c9716c82cea6cbf839a20b70a9cdfe0): update minimum TypeScript version
- [`7ae5741`](https://github.com/stdlib-js/stdlib/commit/7ae574143c9716c82cea6cbf839a20b70a9cdfe0): 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>

- [`7ae5741`](https://github.com/stdlib-js/stdlib/commit/7ae574143c9716c82cea6cbf839a20b70a9cdfe0) - **feat:** update minimum TypeScript version _(by Philipp Burckhardt)_

</details>

</section>

<!-- /.commits -->

<section class="contributors">

### Contributors

A total of 1 person contributed to this release. Thank you to this contributor:

- Philipp Burckhardt

</section>

<!-- /.contributors -->

</section>

<!-- /.release -->

18 changes: 5 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ Returns a list of ndarray orders.

```javascript
var out = orders();
// returns [ 'row-major', 'column-major' ]
// e.g., returns [ 'row-major', 'column-major' ]
```

The output `array` contains the following orders:
The output array contains the following orders:

- `row-major`: row-major (C-style) order.
- `column-major`: column-major (Fortran-style) order.
Expand All @@ -108,20 +108,12 @@ The output `array` contains the following orders:
<!-- eslint no-undef: "error" -->

```javascript
var indexOf = require( '@stdlib/utils-index-of' );
var contains = require( '@stdlib/array-base-assert-contains' ).factory;
var orders = require( '@stdlib/ndarray-orders' );

var ORDERS = orders();
var bool;
var isOrder = contains( orders() );

function isOrder( str ) {
if ( indexOf( ORDERS, str ) === -1 ) {
return false;
}
return true;
}

bool = isOrder( 'row-major' );
var bool = isOrder( 'row-major' );
// returns true

bool = isOrder( 'column-major' );
Expand Down
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.

6 changes: 3 additions & 3 deletions dist/index.js.map

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

2 changes: 1 addition & 1 deletion docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*
* @example
* var list = orders();
* // returns [ 'row-major', 'column-major' ]
* // e.g., returns [ 'row-major', 'column-major' ]
*/
declare function orders(): Array<string>;

Expand Down
14 changes: 3 additions & 11 deletions examples/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,12 @@

'use strict';

var indexOf = require( '@stdlib/utils-index-of' );
var contains = require( '@stdlib/array-base-assert-contains' ).factory;
var orders = require( './../lib' );

var ORDERS = orders();
var bool;
var isOrder = contains( orders() );

function isOrder( str ) {
if ( indexOf( ORDERS, str ) === -1 ) {
return false;
}
return true;
}

bool = isOrder( 'row-major' );
var bool = isOrder( 'row-major' );
console.log( bool );
// => true

Expand Down
6 changes: 4 additions & 2 deletions include/stdlib/ndarray/orders.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@
#ifndef STDLIB_NDARRAY_ORDERS_H
#define STDLIB_NDARRAY_ORDERS_H

#include "stdlib/blas/base/layouts.h"

/**
* Enumeration of ndarray orders (i.e., memory layout/iteration order).
*/
enum STDLIB_NDARRAY_ORDER {
// Row-major (C-style):
STDLIB_NDARRAY_ROW_MAJOR = 1,
STDLIB_NDARRAY_ROW_MAJOR = STDLIB_BLAS_ROW_MAJOR,

// Column-major (Fortran-style):
STDLIB_NDARRAY_COLUMN_MAJOR = 2
STDLIB_NDARRAY_COLUMN_MAJOR = STDLIB_BLAS_COLUMN_MAJOR
};

#endif // !STDLIB_NDARRAY_ORDERS_H
14 changes: 12 additions & 2 deletions lib/enum.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@

'use strict';

// MODULES //

var layouts = require( '@stdlib/blas-base-layouts' ).enum;


// VARIABLES //

var LAYOUTS = layouts();


// MAIN //

/**
Expand All @@ -38,10 +48,10 @@ function enumerated() {
// NOTE: the following should match the C `orders.h` enumeration!!!!
return {
// Row-major (C-style):
'row-major': 1,
'row-major': LAYOUTS[ 'row-major' ],

// Column-major (Fortran-style):
'column-major': 2
'column-major': LAYOUTS[ 'column-major' ]
};
}

Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* var orders = require( '@stdlib/ndarray-orders' );
*
* var list = orders();
* // returns [ 'row-major', 'column-major' ]
* // e.g., returns [ 'row-major', 'column-major' ]
*/

// MODULES //
Expand Down
2 changes: 1 addition & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var ORDERS = require( './orders.json' );
*
* @example
* var list = orders();
* // returns [ 'row-major', 'column-major' ]
* // e.g., returns [ 'row-major', 'column-major' ]
*/
function orders() {
return ORDERS.slice();
Expand Down
70 changes: 36 additions & 34 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
{
"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": [],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": []
}
]
"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": [],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/blas-base-layouts"
]
}
]
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@
"url": "https://github.com/stdlib-js/stdlib/issues"
},
"dependencies": {
"@stdlib/blas-base-layouts": "github:stdlib-js/blas-base-layouts#main",
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.1",
"@stdlib/utils-library-manifest": "^0.2.1"
},
"devDependencies": {
"@stdlib/array-base-assert-contains": "^0.2.1",
"@stdlib/assert-has-own-property": "^0.2.1",
"@stdlib/assert-is-nonnegative-integer": "^0.2.1",
"@stdlib/assert-is-string-array": "^0.2.1",
"@stdlib/utils-index-of": "^0.2.1",
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
"istanbul": "^0.4.1",
"tap-min": "git+https://github.com/Planeshifter/tap-min.git",
Expand Down

0 comments on commit 706fa61

Please sign in to comment.