diff --git a/lib/node_modules/@stdlib/blas/base/zrotg/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/zrotg/benchmark/benchmark.js new file mode 100644 index 000000000000..94df9c039bdf --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zrotg/benchmark/benchmark.js @@ -0,0 +1,96 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var Complex128Array = require( '@stdlib/array/complex128' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var reinterpret = require( '@stdlib/strided/base/reinterpret-complex128' ); +var pkg = require( './../package.json' ).name; +var zrotg = require( './../lib' ); + + +// VARIABLES // + +var OPTS = { + 'dtype': 'float64' +}; + + +// MAIN // + +bench( pkg, function benchmark( b ) { + var viewY; + var za; + var zb; + var z; + var i; + + za = new Complex128( discreteUniform( -5, 5 ), discreteUniform( -5, 5 ) ); + zb = new Complex128( discreteUniform( -5, 5 ), discreteUniform( -5, 5 ) ); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zrotg( za, zb ); + + viewY = reinterpret( z, 0 ); + if ( isnan( viewY[ i%4 ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( viewY[ i%4 ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); + +bench( pkg+':assign', function benchmark( b ) { + var viewY; + var out; + var za; + var zb; + var z; + var i; + + za = new Complex128( discreteUniform( -5, 5 ), discreteUniform( -5, 5 ) ); + zb = new Complex128( discreteUniform( -5, 5 ), discreteUniform( -5, 5 ) ); + out = new Complex128Array( 4 ); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = zrotg.assign( za, zb, out, 1, 0 ); + + viewY = reinterpret( z, 0 ); + if ( typeof z !=='object' ) { + b.fail( 'should return an array' ); + } + } + b.toc(); + if ( isnan( viewY[ i%4 ] ) ) { + b.fail( 'should return the output array' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/base/zrotg/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/zrotg/docs/repl.txt new file mode 100644 index 000000000000..46f43733d596 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zrotg/docs/repl.txt @@ -0,0 +1,65 @@ + +{{alias}}( za, zb ) + Constructs a Givens plane rotation from two double-precision complex + floating-point numbers. + + Parameters + ---------- + za: Complex128 + Rotational elimination parameter. + + zb: Complex128 + Rotational elimination parameter. + + Returns + ------- + out: Complex128Array + Computed values. + + Examples + -------- + // Standard usage: + > var za = new {{alias:@stdlib/complex/float64/ctor}}( 4.0, 3.0 ); + > var zb = new {{alias:@stdlib/complex/float64/ctor}}( 0.0, 0.0 ); + > var out = {{alias}}( za, zb ) + out => [ 4.0, 3.0, 0.0, 0.0, 1.0, 0.0, 0.0 ] + + +{{alias}}.assign( za, zb, out, stride, offset ) + Constructs a Givens plane rotation from two double-precision complex + floating-point numbers and assigns the results to an output array. + + Parameters + ---------- + za: Complex128 + Rotational elimination parameter. + + zb: Complex128 + Rotational elimination parameter. + + out: Complex128Array + Output array. + + stride: integer + Output array stride. + + offset: integer + Output array index offset. + + Returns + ------- + out: Complex128Array + Output array. + + Examples + -------- + > var za = new {{alias:@stdlib/complex/float64/ctor}}( 4.0, 3.0 ); + > var zb = new {{alias:@stdlib/complex/float64/ctor}}( 0.0, 0.0 ); + > var out = new {{alias:@stdlib/array/complex128}}( 4 ); + > var y = {{alias}}.assign( za, zb, out, 1, 0 ) + [ 4.0, 3.0, 0.0, 0.0, 1.0, 0.0, 0.0 ] + > var bool = ( y === out ) + true + + See Also + -------- diff --git a/lib/node_modules/@stdlib/blas/base/zrotg/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/zrotg/docs/types/index.d.ts new file mode 100644 index 000000000000..f157eb3a5c7c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zrotg/docs/types/index.d.ts @@ -0,0 +1,117 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { Complex128Array } from '@stdlib/types/array'; +import { Complex128 } from '@stdlib/types/complex'; + +/** +* Interface describing `zrotg`. +*/ +interface Routine { + /** + * Constructs a Givens plane rotation. + * + * @param za - rotational elimination parameter + * @param zb - rotational elimination parameter + * @returns output array + * + * @example + * var Complex128 = require( '@stdlib/complex/float64/ctor' ); + * + * var za = new Complex128( 4.0, 3.0 ); + * var zb = new Complex128( 0.0, 0.0 ); + * + * var out = zrotg( za, zb ); + * // [ 4.0, 3.0, 0.0, 0.0, 1.0, 0.0, 0.0 ] + * + * @example + * var za = new Complex128( 1.0, 2.0 ); + * var zb = new Complex128( 3.0, 4.0 ); + * + * var out = zrotg( za, zb ); + * // returns [ ~1.732, ~5.1961, 2.0, 4.0, ~0.5773, ~0.8082, ~0.1154 ] + */ + ( za: Complex128, zb: Complex128 ): Complex128Array; + + /** + * Constructs a Givens plane rotation. + * + * @param za - rotational elimination parameter + * @param zb - rotational elimination parameter + * @param out - output array + * @param stride - index increment + * @param offset - starting index + * @returns output array + * + * @example + * var Complex128Array = require( '@stdlib/array/complex128' ); + * + * var Complex128 = require( '@stdlib/complex/float64/ctor' ); + * + * var za = new Complex128( 4.0, 3.0 ); + * var zb = new Complex128( 0.0, 0.0 ); + * var out = new Complex128Array( 4 ); + * + * var y = zrotg.assign( za, zb, out, 1, 0 ); + * // returns [ 4.0, 3.0, 0.0, 0.0, 1.0, 0.0, 0.0 ] + * + * var bool = ( y === out ); + * // returns true + */ + assign( za: Complex128, zb: Complex128, out: Complex128Array, stride: number, offset: number ): Complex128Array; +} + +/** +* Constructs a Givens plane rotation. +* +* @param za - rotational elimination parameter +* @param zb - rotational elimination parameter +* @returns output array +* +* @example +* var Complex128 = require( '@stdlib/complex/float64/ctor' ); +* +* var za = new Complex128( 4.0, 3.0 ); +* var zb = new Complex128( 0.0, 0.0 ); +* +* var out = zrotg( za, zb ); +* // returns [ 4.0, 3.0, 0.0, 0.0, 1.0, 0.0, 0.0 ] +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* +* var za = new Complex128( 4.0, 3.0 ); +* var zb = new Complex128( 0.0, 0.0 ); +* var out = new Complex128Array( 4 ); +* +* var y = zrotg.assign( za, zb, out, 1, 0 ); +* // returns [ 4.0, 3.0, 0.0, 0.0, 1.0, 0.0, 0.0 ] +* +* var bool = ( y === out ); +* // returns true +*/ +declare var zrotg: Routine; + + +// EXPORTS // + +export = zrotg; diff --git a/lib/node_modules/@stdlib/blas/base/zrotg/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/zrotg/docs/types/test.ts new file mode 100644 index 000000000000..f2db36486c6c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zrotg/docs/types/test.ts @@ -0,0 +1,155 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import Complex128Array = require( '@stdlib/array/complex128' ); +import Complex128 = require( '@stdlib/complex/float64/ctor' ); +import zrotg = require( './index' ); + + +// TESTS // + +// The function returns a Complex128Array... +{ + const za = new Complex128( 1.0, 1.0 ); + const zb = new Complex128( 2.0, 2.0 ); + + zrotg( za, zb ); // $ExpectType Complex128Array +} + +// The compiler throws an error if the function is provided an argument which is not a number... +{ + const za = new Complex128( 1.0, 1.0 ); + const zb = new Complex128( 2.0, 2.0 ); + + zrotg( true, zb ); // $ExpectError + zrotg( false, zb ); // $ExpectError + zrotg( null, zb ); // $ExpectError + zrotg( undefined, zb ); // $ExpectError + zrotg( '5', zb ); // $ExpectError + zrotg( [], zb ); // $ExpectError + zrotg( {}, zb ); // $ExpectError + + zrotg( za, true ); // $ExpectError + zrotg( za, false ); // $ExpectError + zrotg( za, null ); // $ExpectError + zrotg( za, undefined ); // $ExpectError + zrotg( za, '5' ); // $ExpectError + zrotg( za, [] ); // $ExpectError + zrotg( za, {} ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const za = new Complex128( 1.0, 1.0 ); + const zb = new Complex128( 2.0, 2.0 ); + + zrotg(); // $ExpectError + zrotg( za ); // $ExpectError + zrotg( za, zb, 3.0 ); // $ExpectError +} + +// Attached to the main export is an `assign` method which returns a Complex128Array... +{ + const za = new Complex128( 1.0, 1.0 ); + const zb = new Complex128( 2.0, 2.0 ); + const out = new Complex128Array( 4 ); + + zrotg.assign( za, zb, out, 1, 0 ); // $ExpectType Complex128Array +} + +// The compiler throws an error if the `assign` method is provided a first or second argument which is not a number... +{ + const za = new Complex128( 1.0, 1.0 ); + const zb = new Complex128( 2.0, 2.0 ); + const out = new Complex128Array( 4 ); + + zrotg.assign( true, zb, out, 1, 0 ); // $ExpectError + zrotg.assign( false, zb, out, 1, 0 ); // $ExpectError + zrotg.assign( null, zb, out, 1, 0 ); // $ExpectError + zrotg.assign( undefined, zb, out, 1, 0 ); // $ExpectError + zrotg.assign( '5', zb, out, 1, 0 ); // $ExpectError + zrotg.assign( [], zb, out, 1, 0 ); // $ExpectError + zrotg.assign( {}, zb, out, 1, 0 ); // $ExpectError + + zrotg.assign( za, true, out, 1, 0 ); // $ExpectError + zrotg.assign( za, false, out, 1, 0 ); // $ExpectError + zrotg.assign( za, null, out, 1, 0 ); // $ExpectError + zrotg.assign( za, undefined, out, 1, 0 ); // $ExpectError + zrotg.assign( za, '5', out, 1, 0 ); // $ExpectError + zrotg.assign( za, [], out, 1, 0 ); // $ExpectError + zrotg.assign( za, {}, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `assign` method is provided a third argument which is not a Complex128Array... +{ + const za = new Complex128( 1.0, 1.0 ); + const zb = new Complex128( 2.0, 2.0 ); + + zrotg.assign( za, zb, 1, 1, 0 ); // $ExpectError + zrotg.assign( za, zb, true, 1, 0 ); // $ExpectError + zrotg.assign( za, zb, false, 1, 0 ); // $ExpectError + zrotg.assign( za, zb, null, 1, 0 ); // $ExpectError + zrotg.assign( za, zb, undefined, 1, 0 ); // $ExpectError + zrotg.assign( za, zb, '5', 1, 0 ); // $ExpectError + zrotg.assign( za, zb, [], 1, 0 ); // $ExpectError + zrotg.assign( za, zb, {}, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `assign` method is provided a fourth argument which is not a number... +{ + const za = new Complex128( 1.0, 1.0 ); + const zb = new Complex128( 2.0, 2.0 ); + const out = new Complex128Array( 4 ); + + zrotg.assign( za, zb, out, '5', 0 ); // $ExpectError + zrotg.assign( za, zb, out, true, 0 ); // $ExpectError + zrotg.assign( za, zb, out, false, 0 ); // $ExpectError + zrotg.assign( za, zb, out, null, 0 ); // $ExpectError + zrotg.assign( za, zb, out, [], 0 ); // $ExpectError + zrotg.assign( za, zb, out, {}, 0 ); // $ExpectError + zrotg.assign( za, zb, out, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the `assign` method is provided a fifth argument which is not a number... +{ + const za = new Complex128( 1.0, 1.0 ); + const zb = new Complex128( 2.0, 2.0 ); + const out = new Complex128Array( 4 ); + + zrotg.assign( za, zb, out, 1, '5' ); // $ExpectError + zrotg.assign( za, zb, out, 1, true ); // $ExpectError + zrotg.assign( za, zb, out, 1, false ); // $ExpectError + zrotg.assign( za, zb, out, 1, null ); // $ExpectError + zrotg.assign( za, zb, out, 1, [] ); // $ExpectError + zrotg.assign( za, zb, out, 1, {} ); // $ExpectError + zrotg.assign( za, zb, out, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `assign` method is provided an unsupported number of arguments... +{ + const za = new Complex128( 1.0, 1.0 ); + const zb = new Complex128( 2.0, 2.0 ); + const out = new Complex128Array( 4 ); + + zrotg.assign(); // $ExpectError + zrotg.assign( za ); // $ExpectError + zrotg.assign( za, zb ); // $ExpectError + zrotg.assign( za, zb, out ); // $ExpectError + zrotg.assign( za, zb, out, 1 ); // $ExpectError + zrotg.assign( za, zb, out, 1, 0, 1 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/base/zrotg/examples/index.js b/lib/node_modules/@stdlib/blas/base/zrotg/examples/index.js new file mode 100755 index 000000000000..6b18af0c9147 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zrotg/examples/index.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var zrotg = require( './../lib' ); + +var out; +var i; + +function rand() { + return new Complex128( discreteUniform( -5, 5 ), discreteUniform( -5, 5 ) ); +} + +for ( i = 0; i < 100; i++ ) { + out = zrotg( rand(), rand() ); + console.log( out ); +} diff --git a/lib/node_modules/@stdlib/blas/base/zrotg/lib/assign.js b/lib/node_modules/@stdlib/blas/base/zrotg/lib/assign.js new file mode 100755 index 000000000000..d5f91f834f17 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zrotg/lib/assign.js @@ -0,0 +1,129 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var abs = require( '@stdlib/math/base/special/abs' ); +var sqrt = require( '@stdlib/math/base/special/sqrt' ); +var cabs2 = require( '@stdlib/math/base/special/cabs2' ); +var EPS = require( '@stdlib/constants/float64/eps' ); +var Complex128 = require( '@stdlib/complex/float64/ctor' ); +var real = require( '@stdlib/complex/float64/real' ); +var imag = require( '@stdlib/complex/float64/imag' ); +var cmul = require( '@stdlib/complex/float64/base/mul' ); +var conj = require( '@stdlib/complex/float64/conj' ); + + +// MAIN // + +/** +* Constructs a Givens plane rotation. +* +* @param {Complex128} za - rotational elimination parameter +* @param {Complex128} zb - rotational elimination parameter +* @param {Complex128Array} out - output array +* @param {integer} stride - index increment +* @param {NonNegativeInteger} offset - starting index +* @returns {Complex128Array} output array +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* var Complex128 = require( '@stdlib/complex/float64/ctor' ); +* +* var za = new Complex128( 4.0, 3.0 ); +* // returns +* +* var zb = new Complex128( 0.0, 0.0 ); +* // returns +* +* var out = zrotg( za, zb, new Complex128Array( 4 ), 1, 0 ); +* // out => [ 4.0, 3.0, 0.0, 0.0, 1.0, 0.0, 0.0 ] +*/ +function zrotg( za, zb, out, stride, offset ) { + var c; + var s; + var r; + var z; + var za2; + var zb2; + var c2; + var d; + var scale; + var temp; + + s = new Complex128( 0.0, 0.0 ); + r = new Complex128( 0.0, 0.0 ); + if ( real( zb ) === 0.0 && imag( zb ) === 0.0 ) { + c = 1.0; + r = za; + z = 0.0; + } else if ( real( za ) === 0.0 && imag( za ) === 0.0 ) { + c = 0; + if ( real( zb ) === 0 ) { + r = abs( imag( zb ) ); + s = conj( zb ) / r; + } else if ( imag( zb ) === 0 ) { + r = abs( real( zb ) ); + s = conj( zb ) / r; + } else { + zb2 = cabs2( zb ); + d = sqrt( zb2 ); + s = conj( zb ) / d; + r = d; + } + z = 1; + } else { + za2 = cabs2( za ); + zb2 = cabs2( zb ); + c2 = za2 + zb2; + + if ( za2 >= c2 * EPS ) { + c = sqrt( za2 / c2); + r = new Complex128( real( za ) / c, imag( za ) / c ); + scale = 1 / sqrt(za2 * c2); + temp = new Complex128(real(za) * scale, imag(za) * scale); + s = cmul(conj(zb), temp); + } else { + d = sqrt( za2 * c2 ); + c = za2 / d; + while( c < EPS ) { + d *= 2; + c = za2 / d; + } + while( c === 0.0 ) { + c = 1; + } + r = new Complex128( real( za ) / c, imag( za ) / c ); + s = conj( zb ) * ( za / d ); + } + z = 1 / c; + } + za = r; + out[offset] = za; + out[offset + stride] = zb; + out[offset + 2 * stride] = c; + out[offset + 3 * stride] = s; + return out; +} + + +// EXPORTS // + +module.exports = zrotg; diff --git a/lib/node_modules/@stdlib/blas/base/zrotg/lib/index.js b/lib/node_modules/@stdlib/blas/base/zrotg/lib/index.js new file mode 100755 index 000000000000..670e4e0e79a9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zrotg/lib/index.js @@ -0,0 +1,82 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Construct a Givens plane rotation. +* +* @module @stdlib/blas/base/zrotg +* +* @example +* var Complex128 = require( '@stdlib/complex/float64/ctor' ); +* +* var za = new Complex128( 4.0, 3.0 ); +* // returns +* +* var zb = new Complex128( 0.0, 0.0 ); +* // returns +* +* var out = zrotg( za, zb ); +* // returns [ 4.0, 3.0, 0.0, 0.0, 1.0, 0.0, 0.0 ] +* +* za = new Complex128( 1.0, 3.0 ); +* // returns +* +* zb = new Complex128( 2.0, 4.0 ); +* // returns +* +* out = zrotg( za, zb ); +* // out => [ ~1.732, ~5.1961, 2.0, 4.0, ~0.5773, ~0.8082, ~0.1154 ] +* +* @example +* var Complex128Array = require( '@stdlib/array/complex128' ); +* var Complex128 = require( '@stdlib/complex/float64/ctor' ); +* +* var za = new Complex128( 4.0, 3.0 ); +* // returns +* +* var zb = new Complex128( 0.0, 0.0 ); +* // returns +* +* var out = new Complex128Array( 4 ); +* +* var y = zrotg.assign( za, zb, out, 1, 0 ); +* // y => [ 4.0, 3.0, 0.0, 0.0, 1.0, 0.0, 0.0 ] +* +* var bool = ( y === out ); +* // returns true +*/ + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var main = require( './main.js' ); +var assign = require( './assign.js' ); + + +// MAIN // + +setReadOnly( main, 'assign', assign ); + + +// EXPORTS // + +module.exports = main; + +// exports: { "assign": "main.assign" } diff --git a/lib/node_modules/@stdlib/blas/base/zrotg/lib/main.js b/lib/node_modules/@stdlib/blas/base/zrotg/lib/main.js new file mode 100755 index 000000000000..54b19eaf9439 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zrotg/lib/main.js @@ -0,0 +1,56 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var Complex128Array = require( '@stdlib/array/complex128' ); +var fcn = require( './assign.js' ); + + +// MAIN // + +/** +* Constructs a Givens plane rotation. +* +* @param {number} za - rotational elimination parameter +* @param {number} zb - rotational elimination parameter +* @returns {Complex128Array} output array +* +* @example +* var Complex128 = require( '@stdlib/complex/float64/ctor' ); +* +* var za = new Complex128( 4.0, 3.0 ); +* // returns +* +* var zb = new Complex128( 0.0, 0.0 ); +* // returns +* +* var out = zrotg( za, zb ); +* // out => [ 4.0, 3.0, 0.0, 0.0, 1.0, 0.0, 0.0 ] +*/ +function zrotg( za, zb ) { + var out = new Complex128Array( 4 ); + return fcn( za, zb, out, 1, 0 ); +} + + +// EXPORTS // + +module.exports = zrotg; diff --git a/lib/node_modules/@stdlib/blas/base/zrotg/package.json b/lib/node_modules/@stdlib/blas/base/zrotg/package.json new file mode 100644 index 000000000000..40d785d67092 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/zrotg/package.json @@ -0,0 +1,72 @@ +{ + "name": "@stdlib/blas/base/zrotg", + "version": "0.0.0", + "description": "Construct a Givens plane rotation.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "blas", + "level 1", + "zrotg", + "givens", + "rotation", + "matrix", + "linear", + "algebra", + "subroutines", + "vector", + "array", + "ndarray", + "complex128", + "complex", + "complex128array" + ] + }