Skip to content

Latest commit

 

History

History
220 lines (131 loc) · 4.81 KB

File metadata and controls

220 lines (131 loc) · 4.81 KB

dlartgp

Generates a plane rotation so that the diagonal is nonnegative.

Usage

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

dlartgp( F, G, out )

Generates a plane rotation so that the diagonal is nonnegative.

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

var out = new Float64Array( 3 );
dlartgp( 1.0, 2.0, out );
// out => <Float64Array>[ ~0.447, ~0.894, ~2.236 ]

The function has the following parameters:

  • F: the first component of vector to be rotated.
  • G: the second component of vector to be rotated.
  • out: output Float64Array output array containing the cosine and sine of the rotation and the non zero component of the rotated vector.

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, 0.0 ] );

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

dlartgp( 1.0, 2.0, out1 );
// out0 => <Float64Array>[ 0.0, ~0.447, ~0.894, ~2.236 ]

dlartgp.ndarray( F, G, out, strideOut, offsetOut )

Generates a plane rotation so that the diagonal is nonnegative using alternative indexing semantics.

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

var out = new Float64Array( 3 );
dlartgp.ndarray( 1.0, 2.0, out, 1, 0 );
// out => <Float64Array>[ ~0.447, ~0.894, ~2.236 ]

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, 0.0 ] );
dlartgp.ndarray( 1.0, 2.0, out, -1, 3 );
// out => <Float64Array>[ 0.0, ~2.236, ~0.894, ~0.447 ]

Notes

Examples

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

var out = new Float64Array( 3 );
dlartgp( 1.0, 2.0, out );
console.log( out );

C APIs

Usage

TODO

TODO

TODO.

TODO

TODO

TODO

Examples

TODO