Skip to content

feat: add lapack/base/zlaswp #5496

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Apr 29, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
chore: clean-up
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown
    status: passed
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: passed
  - task: lint_javascript_src
    status: na
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: passed
  - task: lint_javascript_tests
    status: passed
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---

---
type: pre_push_report
description: Results of running various checks prior to pushing changes.
report:
  - task: run_javascript_examples
    status: na
  - task: run_c_examples
    status: na
  - task: run_cpp_examples
    status: na
  - task: run_javascript_readme_examples
    status: na
  - task: run_c_benchmarks
    status: na
  - task: run_cpp_benchmarks
    status: na
  - task: run_fortran_benchmarks
    status: na
  - task: run_javascript_benchmarks
    status: na
  - task: run_julia_benchmarks
    status: na
  - task: run_python_benchmarks
    status: na
  - task: run_r_benchmarks
    status: na
  - task: run_javascript_tests
    status: na
---
  • Loading branch information
kgryte committed Apr 29, 2025
commit 6635b79f02fba55da018835e2591defd0103748c
16 changes: 12 additions & 4 deletions lib/node_modules/@stdlib/lapack/base/zlaswp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ limitations under the License.

-->

<!-- lint disable max-len -->

# zlaswp

> Perform a series of row interchanges on an input matrix.
Expand All @@ -36,6 +34,8 @@ var zlaswp = require( '@stdlib/lapack/base/zlaswp' );

Performs a series of row interchanges on an input matrix `A` using pivot indices stored in `IPIV`.

<!-- eslint-disable max-len -->

```javascript
var Int32Array = require( '@stdlib/array/int32' );
var Complex128Array = require( '@stdlib/array/complex128' );
Expand All @@ -60,6 +60,8 @@ The function has the following parameters:

The sign of the increment parameter `incx` determines the order in which pivots are applied. For example, to apply pivots in reverse order,

<!-- eslint-disable max-len -->

```javascript
var Int32Array = require( '@stdlib/array/int32' );
var Complex128Array = require( '@stdlib/array/complex128' );
Expand All @@ -73,6 +75,8 @@ zlaswp( 'row-major', 2, A, 2, 0, 2, IPIV, -1 );

To perform strided access over `IPIV`, provide an `abs(incx)` value greater than one. For example, to access every other element in `IPIV`,

<!-- eslint-disable max-len -->

```javascript
var Int32Array = require( '@stdlib/array/int32' );
var Complex128Array = require( '@stdlib/array/complex128' );
Expand All @@ -86,7 +90,7 @@ zlaswp( 'row-major', 2, A, 2, 0, 2, IPIV, 2 );

Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views.

<!-- eslint-disable stdlib/capitalized-comments -->
<!-- eslint-disable stdlib/capitalized-comments, max-len -->

```javascript
var Int32Array = require( '@stdlib/array/int32' );
Expand All @@ -108,6 +112,8 @@ zlaswp( 'row-major', 2, A1, 2, 0, 2, IPIV1, 1 );

Performs a series of row interchanges on the matrix `A` using pivot indices stored in `IPIV` and alternative indexing semantics.

<!-- eslint-disable max-len -->

```javascript
var Int32Array = require( '@stdlib/array/int32' );
var Complex128Array = require( '@stdlib/array/complex128' );
Expand Down Expand Up @@ -168,6 +174,8 @@ zlaswp.ndarray( 2, A, 2, 1, 2, 0, 2, 1, IPIV, 1, 2 );

## Examples

<!-- eslint-disable max-len -->

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

```javascript
Expand All @@ -183,7 +191,7 @@ var offset = 0;
var order = 'column-major';

// Create a matrix stored in linear memory:
var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0 ] ); // eslint-disable-line max-len
var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ] );
console.log( ndarray2array( A, shape, strides, offset, order ) );

// Define a vector of pivot indices:
Expand Down
6 changes: 4 additions & 2 deletions lib/node_modules/@stdlib/lapack/base/zlaswp/docs/repl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
Examples
--------
> var IPIV = new {{alias:@stdlib/array/int32}}( [ 1, 1 ] );
> var A = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
> var v = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ];
> var A = new {{alias:@stdlib/array/complex128}}( v );
> var ord = 'row-major';
> {{alias}}( ord, 2, A, 2, 0, 1, IPIV, 1 )
<Complex128Array>[ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0 ]
Expand Down Expand Up @@ -111,7 +112,8 @@
Examples
--------
> var IPIV = new {{alias:@stdlib/array/int32}}( [ 1, 1 ] );
> var A = new {{alias:@stdlib/array/complex128}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
> var v = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ];
> var A = new {{alias:@stdlib/array/complex128}}( v );
> {{alias}}.ndarray( 2, A, 2, 1, 0, 0, 1, 1, IPIV, 1, 0 )
<Complex128Array>[ 5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0 ]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import { Layout } from '@stdlib/types/blas';
import { Complex128Array } from '@stdlib/types/array';


/**
* Interface describing `zlaswp`.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var offset = 0;
var order = 'column-major';

// Create a matrix stored in linear memory:
var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0 ] ); // eslint-disable-line max-len
var A = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ] ); // eslint-disable-line max-len
console.log( ndarray2array( A, shape, strides, offset, order ) );

// Define a vector of pivot indices:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

"A_out_mat": [
[ 21.0, 22.0, 23.0, 24.0 ],
[ 17.0, 18.0, 19.0,20.0 ],
[ 17.0, 18.0, 19.0, 20.0 ],
[ 13.0, 14.0, 15.0, 16.0 ],
[ 9.0, 10.0, 11.0, 12.0 ],
[ 5.0, 6.0, 7.0, 8.0 ],
Expand Down
14 changes: 6 additions & 8 deletions lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.ndarray.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ tape( 'the function efficiently handles large datasets (column-major)', function
var expectedBuf;
var expected;
var IPIV;
var Abuf;
var abuf;
var buf;
var mat;
var out;
Expand All @@ -309,11 +309,10 @@ tape( 'the function efficiently handles large datasets (column-major)', function

// Define an input matrix in linear storage:
A = new Complex128Array( buf );

Abuf = reinterpret( A, 0 );
abuf = reinterpret( A, 0 );

// Convert to a nested array:
mat = ndarray2array( Abuf, [ sh[ 0 ], sh[ 1 ], 2 ], [ 2 * st[0], 2 * st[1], 1 ], o, ord );
mat = ndarray2array( abuf, [ sh[0], sh[1], 2 ], [ 2*st[0], 2*st[1], 1 ], o, ord );

// Create an array of pivot indices:
IPIV = new Int32Array( [ 9999, 9999, 9999, 1, 0 ] );
Expand Down Expand Up @@ -548,7 +547,7 @@ tape( 'the function efficiently handles large datasets (row-major)', function te
var expectedMat;
var expected;
var IPIV;
var Abuf;
var abuf;
var buf;
var mat;
var out;
Expand All @@ -568,11 +567,10 @@ tape( 'the function efficiently handles large datasets (row-major)', function te

// Define an input matrix in linear storage:
A = new Complex128Array( buf );

Abuf = reinterpret( A, 0 );
abuf = reinterpret( A, 0 );

// Convert to a nested array:
mat = ndarray2array( Abuf, [ sh[ 0 ], sh[ 1 ], 2 ], [ 2 * st[0], 2 * st[1], 1 ], o, ord );
mat = ndarray2array( abuf, [ sh[0], sh[1], 2 ], [ 2*st[0], 2*st[1], 1 ], o, ord );

// Create an array of pivot indices:
IPIV = new Int32Array( [ 9999, 9999, 9999, 1, 0 ] );
Expand Down
14 changes: 6 additions & 8 deletions lib/node_modules/@stdlib/lapack/base/zlaswp/test/test.zlaswp.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ tape( 'the function efficiently handles large datasets (column-major)', function
var expectedBuf;
var expected;
var IPIV;
var Abuf;
var abuf;
var buf;
var mat;
var out;
Expand All @@ -297,11 +297,10 @@ tape( 'the function efficiently handles large datasets (column-major)', function

// Define an input matrix in linear storage:
A = new Complex128Array( buf );

Abuf = reinterpret( A, 0 );
abuf = reinterpret( A, 0 );

// Convert to a nested array:
mat = ndarray2array( Abuf, [ sh[ 0 ], sh[ 1 ], 2 ], [ 2 * st[0], 2 * st[1], 1 ], o, ord );
mat = ndarray2array( abuf, [ sh[0], sh[1], 2 ], [ 2*st[0], 2*st[1], 1 ], o, ord );

// Create an array of pivot indices:
IPIV = new Int32Array( [ 9999, 9999, 9999, 1, 0 ] );
Expand Down Expand Up @@ -473,7 +472,7 @@ tape( 'the function efficiently handles large datasets (row-major)', function te
var expectedMat;
var expected;
var IPIV;
var Abuf;
var abuf;
var buf;
var mat;
var out;
Expand All @@ -493,11 +492,10 @@ tape( 'the function efficiently handles large datasets (row-major)', function te

// Define an input matrix in linear storage:
A = new Complex128Array( buf );

Abuf = reinterpret( A, 0 );
abuf = reinterpret( A, 0 );

// Convert to a nested array:
mat = ndarray2array( Abuf, [ sh[ 0 ], sh[ 1 ], 2 ], [ 2 * st[0], 2 * st[1], 1 ], o, ord );
mat = ndarray2array( abuf, [ sh[0], sh[1], 2 ], [ 2*st[0], 2*st[1], 1 ], o, ord );

// Create an array of pivot indices:
IPIV = new Int32Array( [ 9999, 9999, 9999, 1, 0 ] );
Expand Down