Skip to content

Latest commit

 

History

History
232 lines (138 loc) · 5 KB

File metadata and controls

232 lines (138 loc) · 5 KB

dlas2

Compute the singular values of a 2x2 upper triangular matrix.

The singular values of a 2x2 upper triangular matrix $ A = \begin{bmatrix} F & G \ 0 & H \end{bmatrix}$ are returned as $\begin{bmatrix} SSMIN & SSMAX \end{bmatrix}$.

Usage

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

dlas2( F, G, H, out )

Computes the singular values of 2x2 upper triangular matrix.

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

var out = new Float64Array( 2 );
dlas2( 1.0, 2.0, 3.0, out );
// out => <Float64Array>[ ~0.822, ~3.65 ]

The function has the following parameters:

  • F: the (0,0) element of a 2x2 matrix.
  • G: the (0,1) and (1,0) elements of a 2x2 matrix.
  • H: the (1,1) element of a 2x2 matrix.
  • out: output Float64Array containing the smaller and larger singular values respectively.

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

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

// Initial array:
var out0 = new Float64Array( [ 0.0, 0.0, 0.0 ] );

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

dlas2( 1.0, 2.0, 3.0, out1 );
// out0 => <Float64Array>[ 0.0, ~0.822, ~3.65 ]

dlas2.ndarray( F, G, H, out, strideOut, offsetOut )

Computes the singular values of a 2x2 upper triangular matrix using alternative indexing semantics.

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

var out = new Float64Array( 2 );
dlas2.ndarray( 1.0, 2.0, 3.0, out, 1, 0 );
// out => <Float64Array>[ ~0.822, ~3.65 ]

The function has the following additional parameters:

  • strideOut: stride length for out.
  • offsetOut: starting index of out

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 = new Float64Array( [ 0.0, 0.0, 0.0 ] );
dlas2.ndarray( 1.0, 2.0, 3.0, out, -1, 2 );
// out => <Float64Array>[ 0.0, ~3.65, ~0.822 ]

Notes

Examples

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

var out = new Float64Array( 2 );
dlas2( 6.0, 8.0, 2.0, out );
console.log( out );

dlas2.ndarray( 6.0, 8.0, 2.0, out, 1, 0 );
console.log( out );

C APIs

Usage

TODO

TODO

TODO.

TODO

TODO

TODO

Examples

TODO