@stdlib/blas-base-drotg
v0.2.2
Published
Construct a Givens plane rotation.
Downloads
24
Readme
drotg
Construct a Givens plane rotation.
Installation
npm install @stdlib/blas-base-drotg
Usage
var drotg = require( '@stdlib/blas-base-drotg' );
drotg( a, b )
Constructs a Givens plane rotation provided two double-precision floating-point values a
and b
.
var out = drotg( 0.0, 2.0 );
// returns <Float64Array>[ 2.0, 1.0, 0.0, 1.0 ]
The function has the following parameters:
- a: rotational elimination parameter.
- b: rotational elimination parameter.
drotg.assign( a, b, out, stride, offset )
Constructs a Givens plane rotation provided two double-precision floating-point values a
and b
and assigns results to an output array.
var Float64Array = require( '@stdlib/array-float64' );
var out = new Float64Array( 4 );
var y = drotg.assign( 0.0, 2.0, out, 1, 0 );
// returns <Float64Array>[ 2.0, 1.0, 0.0, 1.0 ]
var bool = ( y === out );
// returns true
Notes
var discreteUniform = require( '@stdlib/random-base-discrete-uniform' );
var drotg = require( '@stdlib/blas-base-drotg' );
var out;
var i;
for ( i = 0; i < 100; i++ ) {
out = drotg( discreteUniform( -5, 5 ), discreteUniform( -5, 5 ) );
console.log( out );
}
Notice
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
Community
License
See LICENSE.
Copyright
Copyright © 2016-2024. The Stdlib Authors.