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 cad5a0b commit 4ec7655
Show file tree
Hide file tree
Showing 18 changed files with 780 additions and 5 deletions.
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

##### Features

- [`31aa8db`](https://github.com/stdlib-js/stdlib/commit/31aa8dbfb2c0a722710adc8a399e703b224cadab) - add `transposeOperations` to namespace
- [`378240f`](https://github.com/stdlib-js/stdlib/commit/378240f1bb93253435f89aec4d5c7ce64eae4703) - update namespace

</section>
Expand Down Expand Up @@ -629,6 +630,7 @@ This release closes the following issue:

##### Bug Fixes

- [`258cc06`](https://github.com/stdlib-js/stdlib/commit/258cc060947be206b283ff4d066953dcebb0143f) - assign enum values to CBLAS compatible aliases
- [`0992fe2`](https://github.com/stdlib-js/stdlib/commit/0992fe22060cb8f860cfd9e8f590d4c7a83c7287) - replace semicolons with commas

</section>
Expand Down Expand Up @@ -675,6 +677,28 @@ This release closes the following issue:

<!-- /.package -->

<section class="package" id="blas-base-transpose-operations-unreleased">

#### [@stdlib/blas/base/transpose-operations](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/base/transpose-operations)

<details>

<section class="features">

##### Features

- [`87a0d77`](https://github.com/stdlib-js/stdlib/commit/87a0d77b81cc5bc8c05e40d6ec22f548c5d3dd14) - add `blas/base/transpose-operations`

</section>

<!-- /.features -->

</details>

</section>

<!-- /.package -->

<section class="package" id="blas-base-xerbla-unreleased">

#### [@stdlib/blas/base/xerbla](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/base/xerbla)
Expand Down Expand Up @@ -1517,6 +1541,10 @@ A total of 35 people contributed to this release. Thank you to the following con

<details>

- [`73cf5f1`](https://github.com/stdlib-js/stdlib/commit/73cf5f1bb0dba7e320518e6b530a98004ef86aef) - **refactor:** assign enum values to CBLAS compatible aliases _(by Athan Reines)_
- [`258cc06`](https://github.com/stdlib-js/stdlib/commit/258cc060947be206b283ff4d066953dcebb0143f) - **fix:** assign enum values to CBLAS compatible aliases _(by Athan Reines)_
- [`31aa8db`](https://github.com/stdlib-js/stdlib/commit/31aa8dbfb2c0a722710adc8a399e703b224cadab) - **feat:** add `transposeOperations` to namespace _(by Athan Reines)_
- [`87a0d77`](https://github.com/stdlib-js/stdlib/commit/87a0d77b81cc5bc8c05e40d6ec22f548c5d3dd14) - **feat:** add `blas/base/transpose-operations` _(by Athan Reines)_
- [`85ec173`](https://github.com/stdlib-js/stdlib/commit/85ec1734c06b80b13eb607576e592414047c90a7) - **remove:** delete `blas/base/orders` _(by Athan Reines)_
- [`c61cc17`](https://github.com/stdlib-js/stdlib/commit/c61cc17ca682a9dfe76246ab9dc852c0044c6cbf) - **refactor:** migrate to `blas/base/layouts` _(by Athan Reines)_
- [`0c3213e`](https://github.com/stdlib-js/stdlib/commit/0c3213e4e3219c0574d0c49e2486db1ac714c952) - **fix:** rename `orders` to `layouts` _(by Athan Reines)_
Expand Down
9 changes: 9 additions & 0 deletions base/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,15 @@ setReadOnly( blas, 'sscal', require( './../../base/sscal' ) );
*/
setReadOnly( blas, 'sswap', require( './../../base/sswap' ) );

/**
* @name transposeOperations
* @memberof blas
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/base/transpose-operations}
*/
setReadOnly( blas, 'transposeOperations', require( './../../base/transpose-operations' ) );

/**
* @name zcopy
* @memberof blas
Expand Down
15 changes: 11 additions & 4 deletions base/shared/include/stdlib/blas/base/shared/cblas.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <stdint.h>
#include <inttypes.h>
#include "stdlib/blas/base/orders.h"
#include "stdlib/blas/base/transpose_operations.h"

/*
* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler.
Expand Down Expand Up @@ -65,20 +66,26 @@ extern "C" {

// Array storage layout:
#ifndef CBLAS_LAYOUT
typedef STDLIB_BLAS_LAYOUT CBLAS_LAYOUT;
typedef enum CBLAS_LAYOUT {
// Row-major order (C-style):
CblasRowMajor = STDLIB_BLAS_ROW_MAJOR,

// Column-major order (Fortran-style):
CblasColMajor = STDLIB_BLAS_COLUMN_MAJOR,
} CBLAS_LAYOUT;
#endif

// Transpose operation:
#ifndef CBLAS_TRANSPOSE
typedef enum CBLAS_TRANSPOSE {
// No transposition:
CblasNoTrans = 111,
CblasNoTrans = STDLIB_BLAS_NO_TRANSPOSE,

// Transposition:
CblasTrans = 112,
CblasTrans = STDLIB_BLAS_TRANSPOSE,

// Conjugate transposition:
CblasConjTrans = 113,
CblasConjTrans = STDLIB_BLAS_CONJUGATE_TRANSPOSE,
} CBLAS_TRANSPOSE;
#endif

Expand Down
3 changes: 2 additions & 1 deletion base/shared/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/blas/base/layouts"
"@stdlib/blas/base/layouts",
"@stdlib/blas/base/transpose-operations"
]
}
]
Expand Down
188 changes: 188 additions & 0 deletions base/transpose-operations/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
<!--
@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.
-->

# Transpose Operations

> BLAS transpose operations.
<!-- 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 -->

<!-- Package usage documentation. -->

<section class="usage">

## Usage

```javascript
var transposeOperations = require( '@stdlib/blas/base/transpose-operations' );
```

#### transposeOperations()

Returns a list of BLAS transpose operations.

```javascript
var out = transposeOperations();
// e.g., returns [ 'none', 'transpose', 'conjugate-transpose' ]
```

The output array contains the following operations:

- `none`: no transposition.
- `transpose`: transposition.
- `conjugate-transpose`: conjugate transposition.

</section>

<!-- /.usage -->

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

<section class="notes">

</section>

<!-- /.notes -->

<!-- Package usage examples. -->

<section class="examples">

## Examples

<!-- eslint no-undef: "error" -->

```javascript
var contains = require( '@stdlib/array/base/assert/contains' ).factory;
var transposeOperations = require( '@stdlib/blas/base/transpose-operations' );

var isOp = contains( transposeOperations() );

var bool = isOp( 'transpose' );
// returns true

bool = isOp( 'conjugate-transpose' );
// returns true

bool = isOp( 'beep' );
// returns false
```

</section>

<!-- /.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/base/transpose_operations.h"
```

#### STDLIB_BLAS_TRANSPOSE_OPERATION

An enumeration of BLAS transpose operations with the following fields:

- **STDLIB_BLAS_NO_TRANSPOSE**: no transposition.
- **STDLIB_BLAS_TRANSPOSE**: transposition.
- **STDLIB_BLAS_CONJUGATE_TRANSPOSE**: conjugate transposition.

```c
#include "stdlib/blas/base/transpose_operations.h"

const enum STDLIB_BLAS_TRANSPOSE_OPERATION op = STDLIB_BLAS_TRANSPOSE;
```

</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">

### Notes

- Enumeration constants should be considered opaque values, and one should **not** rely on specific integer values.

</section>

<!-- /.notes -->

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

<section class="examples">

</section>

<!-- /.examples -->

</section>

<!-- /.c -->

<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="references">

</section>

<!-- /.references -->

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

<section class="related">

</section>

<!-- /.related -->

<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="links">

</section>

<!-- /.links -->
48 changes: 48 additions & 0 deletions base/transpose-operations/benchmark/benchmark.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* @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.
*/

'use strict';

// MODULES //

var bench = require( '@stdlib/bench' );
var isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;
var pkg = require( './../package.json' ).name;
var ops = require( './../lib' );


// MAIN //

bench( pkg, function benchmark( b ) {
var out;
var i;

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
out = ops();
if ( out.length < 2 ) {
b.fail( 'should return an array' );
}
}
b.toc();
if ( !isStringArray( out ) ) {
b.fail( 'should return an array of strings' );
}
b.pass( 'benchmark finished' );
b.end();
});
23 changes: 23 additions & 0 deletions base/transpose-operations/docs/repl.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

{{alias}}()
Returns a list of transpose operations.

The output array contains the following operations:

- none: no transposition.
- transpose: transposition.
- conjugate-transpose: conjugate transposition.

Returns
-------
out: Array<string>
List of operations.

Examples
--------
> var out = {{alias}}()
[ 'none', 'transpose', 'conjugate-transpose' ]

See Also
--------

Loading

0 comments on commit 4ec7655

Please sign in to comment.