Skip to content

Files

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Latest commit

45f9026 · Sep 2, 2024

History

History
232 lines (140 loc) · 4.84 KB

File metadata and controls

232 lines (140 loc) · 4.84 KB

iladlr

Return last non-zero row of matrix A.

Usage

var iladlr = require( '@stdlib/lapack/base/iladlr' );

iladlr( order, M, N, A, LDA )

Returns last non-zero row of matrix A.

var Float64Array = require( '@stdlib/array/float64' );

var out;
var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );

out = iladlr( 'row-major', 2, 2, A, 2 );
// returns 1

The function has the following parameters:

  • order: storage layout.
  • M: number of rows in A.
  • N: number of columns in A.
  • A: input Float64Array.
  • LDA: stride of the first dimension of A (a.k.a., leading dimension of the matrix A).

Note that indexing is relative to the first index. To introduce an offset, use typed array views.

var Float64Array = require( '@stdlib/array/float64' );

// Initial an array.
var A0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );

// Create offset view.
var A1 = new Float64Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); // start at 2nd element

var out = iladlr( 'row-major', 2, 2, A1, 2 );
// out => 1

iladlr.ndarray( M, N, A, sa1, sa2, oa )

Returns last non-zero row of matrix A using alternative indexing semantics.

var Float64Array = require( '@stdlib/array/float64' );

var out;
var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );

out = iladlr.ndarray( 2, 2, A, 2, 1, 0 );
// returns 1

The function has the following parameters:

  • M: number of rows in A.
  • N: number of columns in A.
  • A: input Float64Array.
  • sa1: stride of the first dimension of A.
  • sa2: stride of the second dimension of A.
  • oa: starting index for A.

While typed array views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example,

var Float64Array = require( '@stdlib/array/float64' );

var out;
var A = new Float64Array( [ 4.0, 3.0, 2.0, 4.0 ] );

out = iladlr.ndarray( 2, 2, A, -2, -1, 3 );
// returns 1

Notes

Examples

var Float64Array = require( '@stdlib/array/float64' );
var iladlr = require( '@stdlib/lapack/base/iladlr' );

var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
var out = iladlr( 'row-major', 2, 2, A, 2 );
console.log( out );

C APIs

Usage

TODO

TODO

TODO.

TODO

TODO

TODO

Examples

TODO