From 1153c3e7f199b48deb3f72c13971596ad1a61ccc Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Fri, 14 Feb 2025 01:00:07 +0530 Subject: [PATCH 01/15] feat: add /complex/float32/base/mul-add --- .../complex/float32/base/mul-add/README.md | 298 +++++++++++ .../mul-add/benchmark/benchmark.assign.js | 70 +++ .../base/mul-add/benchmark/benchmark.js | 60 +++ .../mul-add/benchmark/benchmark.native.js | 69 +++ .../mul-add/benchmark/benchmark.strided.js | 68 +++ .../float32/base/mul-add/benchmark/c/Makefile | 126 +++++ .../base/mul-add/benchmark/c/benchmark.c | 151 ++++++ .../base/mul-add/benchmark/c/native/Makefile | 146 ++++++ .../mul-add/benchmark/c/native/benchmark.c | 153 ++++++ .../base/mul-add/benchmark/julia/REQUIRE | 2 + .../base/mul-add/benchmark/julia/benchmark.jl | 144 ++++++ .../complex/float32/base/mul-add/binding.gyp | 170 +++++++ .../float32/base/mul-add/docs/repl.txt | 141 ++++++ .../base/mul-add/docs/types/index.d.ts | 177 +++++++ .../float32/base/mul-add/docs/types/test.ts | 465 ++++++++++++++++++ .../float32/base/mul-add/examples/c/Makefile | 146 ++++++ .../float32/base/mul-add/examples/c/example.c | 46 ++ .../float32/base/mul-add/examples/index.js | 36 ++ .../complex/float32/base/mul-add/include.gypi | 53 ++ .../stdlib/complex/float32/base/mul_add.h | 40 ++ .../float32/base/mul-add/lib/assign.js | 57 +++ .../complex/float32/base/mul-add/lib/index.js | 69 +++ .../complex/float32/base/mul-add/lib/main.js | 77 +++ .../float32/base/mul-add/lib/native.js | 69 +++ .../float32/base/mul-add/lib/strided.js | 70 +++ .../float32/base/mul-add/manifest.json | 75 +++ .../complex/float32/base/mul-add/package.json | 70 +++ .../complex/float32/base/mul-add/src/Makefile | 70 +++ .../complex/float32/base/mul-add/src/addon.c | 23 + .../complex/float32/base/mul-add/src/main.c | 66 +++ .../float32/base/mul-add/test/test.assign.js | 153 ++++++ .../complex/float32/base/mul-add/test/test.js | 46 ++ .../float32/base/mul-add/test/test.main.js | 138 ++++++ .../float32/base/mul-add/test/test.native.js | 147 ++++++ .../float32/base/mul-add/test/test.strided.js | 212 ++++++++ 35 files changed, 3903 insertions(+) create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/README.md create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.assign.js create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.js create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.native.js create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.strided.js create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/Makefile create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/benchmark.c create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/native/Makefile create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/native/benchmark.c create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/julia/REQUIRE create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/julia/benchmark.jl create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/binding.gyp create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/docs/repl.txt create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/docs/types/index.d.ts create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/docs/types/test.ts create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/c/Makefile create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/c/example.c create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/index.js create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/include.gypi create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/include/stdlib/complex/float32/base/mul_add.h create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/lib/assign.js create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/lib/index.js create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/lib/main.js create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/lib/native.js create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/lib/strided.js create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/manifest.json create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/package.json create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/src/Makefile create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/src/addon.c create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/src/main.c create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/test/test.assign.js create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/test/test.js create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/test/test.main.js create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/test/test.native.js create mode 100755 lib/node_modules/@stdlib/complex/float32/base/mul-add/test/test.strided.js diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/README.md b/lib/node_modules/@stdlib/complex/float32/base/mul-add/README.md new file mode 100755 index 000000000000..e866c20c900c --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/README.md @@ -0,0 +1,298 @@ + + +# muladd + +> Perform a multiply-add operation involving three single-precision complex floating-point numbers. + +
+ +
+ + + +
+ +## Usage + +```javascript +var muladd = require( '@stdlib/complex/float32/base/mul-add' ); +``` + +#### muladd( alpha, x, y ) + +Performs a multiply-add operation involving three single-precision complex floating-point numbers. + +```javascript +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var realf = require( '@stdlib/complex/float32/real' ); +var imagf = require( '@stdlib/complex/float32/imag' ); + +var z1 = new Complex64( 5.0, 3.0 ); +var z2 = new Complex64( -2.0, 1.0 ); +var z3 = new Complex64( 7.0, -8.0 ); + +// Compute `alpha*x + y`: +var v = muladd( z1, z2, z3 ); +// returns + +var re = realf( v ); +// returns -6.0 + +var im = imagf( v ); +// returns -9.0 +``` + +The function supports the following parameters: + +- **alpha**: first [complex number][@stdlib/complex/float32/ctor] +- **x**: second [complex number][@stdlib/complex/float32/ctor]. +- **y**: third [complex number][@stdlib/complex/float32/ctor]. + +#### muladd.assign( ar, ai, xr, xi, yr, yi, out, strideOut, offsetOut ) + +Performs a multiply-add operation involving three single-precision complex floating-point numbers and assigns the results to an output strided array. + +```javascript +var Float32Array = require( '@stdlib/array/float32' ); + +var out = new Float32Array( 2 ); +var v = muladd.assign( 5.0, 3.0, -2.0, 1.0, 7.0, -8.0, out, 1, 0 ); +// returns [ -6.0, -9.0 ] + +var bool = ( out === v ); +// returns true +``` + +The function supports the following parameters: + +- **ar**: real component of the first complex number. +- **ai**: imaginary component of the first complex number. +- **xr**: real component of the second complex number. +- **xi**: imaginary component of the second complex number. +- **yr**: real component of the third complex number. +- **yi**: imaginary component of the third complex number. +- **out**: output array. +- **strideOut**: stride length for `out`. +- **offsetOut**: starting index for `out`. + +#### muladd.strided( alpha, sa, oa, x, sx, ox, y, sy, oy, out, so, oo ) + +Performs a multiply-add operation involving three single-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array. + +```javascript +var Float32Array = require( '@stdlib/array/float32' ); + +var z1 = new Float32Array( [ 5.0, 3.0 ] ); +var z2 = new Float32Array( [ -2.0, 1.0 ] ); +var z3 = new Float32Array( [ 7.0, -8.0 ] ); +var out = new Float32Array( 2 ); + +var v = muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); +// returns [ -6.0, -9.0 ] + +var bool = ( out === v ); +// returns true +``` + +The function supports the following parameters: + +- **alpha**: first complex number strided array view. +- **sa**: stride length for `alpha`. +- **oa**: starting index for `alpha`. +- **x**: second complex number strided array view. +- **sx**: stride length for `x`. +- **ox**: starting index for `x`. +- **y**: third complex number strided array view. +- **sy**: stride length for `y`. +- **oy**: starting index for `y`. +- **out**: output array. +- **so**: stride length for `out`. +- **oo**: starting index for `out`. + +
+ + + +
+ +## Examples + + + +```javascript +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +var muladd = require( '@stdlib/complex/float32/base/mul-add' ); + +var rand = discreteUniform( -50, 50 ); + +var z1; +var z2; +var z3; +var i; +for ( i = 0; i < 100; i++ ) { + z1 = new Complex64( rand(), rand() ); + z2 = new Complex64( rand(), rand() ); + z3 = muladd( z1, z2, z2 ); + console.log( '(%s)*(%s) + (%s) = %s', z1.toString(), z2.toString(), z2.toString(), z3.toString() ); +} +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/complex/float32/base/mul_add.h" +``` + +#### stdlib_base_complex64_muladd( alpha, x, y ) + +Performs a multiply-add operation involving three single-precision complex floating-point numbers. + +```c +#include "stdlib/complex/float32/ctor.h" +#include "stdlib/complex/float32/real.h" +#include "stdlib/complex/float32/imag.h" + +stdlib_complex64_t z1 = sstdlib_complex64( 5.0, 3.0 ); +stdlib_complex64_t z2 = sstdlib_complex64( -2.0, 1.0 ); +stdlib_complex64_t z3 = sstdlib_complex64( 7.0, -8.0 ); + +stdlib_complex64_t out = stdlib_base_complex64_muladd( z1, z2, z3 ); + +double re = stdlib_complex128_real( out ); +// returns -6.0 + +double im = stdlib_complex128_imag( out ); +// returns -9.0 +``` + +The function accepts the following arguments: + +- **alpha**: `[in] stdlib_complex64_t` input value. +- **z1**: `[in] stdlib_complex64_t` input value. +- **z2**: `[in] stdlib_complex64_t` input value. + +```c +stdlib_complex64_t stdlib_base_complex64_muladd( const stdlib_complex64_t alpha, const stdlib_complex64_t x, const stdlib_complex64_t y ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/complex/float32/base/mul_add.h" +#include "stdlib/complex/float32/ctor.h" +#include "stdlib/complex/float32/reim.h" +#include + +int main( void ) { + const stdlib_complex64_t x[] = { + stdlib_complex64( 3.14, 1.5 ), + stdlib_complex64( -3.14, 1.5 ), + stdlib_complex64( 0.0, -0.0 ), + stdlib_complex64( 0.0/0.0, 0.0/0.0 ) + }; + + stdlib_complex64_t v; + stdlib_complex64_t y; + double re; + double im; + int i; + for ( i = 0; i < 4; i++ ) { + v = x[ i ]; + stdlib_complex64_reim( v, &re, &im ); + printf( "z = %f + %fi\n", re, im ); + + y = stdlib_base_complex64_muladd( v, v, v ); + stdlib_complex64_reim( y, &re, &im ); + printf( "z*z + z = %f + %fi\n", re, im ); + } +} +``` + +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.assign.js b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.assign.js new file mode 100755 index 000000000000..accd17f7bc60 --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.assign.js @@ -0,0 +1,70 @@ +/** +* @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 uniform = require( '@stdlib/random/array/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var Float32Array = require( '@stdlib/array/float32' ); +var pkg = require( './../package.json' ).name; +var muladd = require( './../lib' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float32' +}; + + +// MAIN // + +bench( pkg+':assign', function benchmark( b ) { + var out; + var re; + var im; + var N; + var i; + var j; + var k; + + N = 100; + re = uniform( N, -500.0, 500.0, options ); + im = uniform( N, -500.0, 500.0, options ); + + out = new Float32Array( 2 ); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + j = i % N; + k = ( i+1 ) % N; + out = muladd.assign( re[ j ], im[ j ], re[ k ], im[ k ], re[ k ], im[ k ], out, 1, 0 ); // eslint-disable-line max-len + if ( typeof out !== 'object' ) { + b.fail( 'should return an object' ); + } + } + b.toc(); + if ( isnanf( out[ 0 ] ) || isnanf( out[ 1 ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); \ No newline at end of file diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.js b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.js new file mode 100755 index 000000000000..150473f5ec38 --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.js @@ -0,0 +1,60 @@ +/** +* @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 uniform = require( '@stdlib/random/base/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var realf = require( '@stdlib/complex/float32/real' ); +var imagf = require( '@stdlib/complex/float32/imag' ); +var pkg = require( './../package.json' ).name; +var muladd = require( './../lib' ); + + +// MAIN // + +bench( pkg, function benchmark( b ) { + var values; + var out; + var z; + var i; + + values = [ + new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), + new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) + ]; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = values[ i%values.length ]; + out = muladd( z, z, z ); + if ( typeof out !== 'object' ) { + b.fail( 'should return an object' ); + } + } + b.toc(); + if ( isnanf( realf( out ) ) || isnanf( imagf( out ) ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); \ No newline at end of file diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.native.js new file mode 100755 index 000000000000..28683eccd60a --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.native.js @@ -0,0 +1,69 @@ +/** +* @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 resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/base/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var realf = require( '@stdlib/complex/float32/real' ); +var imagf = require( '@stdlib/complex/float32/imag' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var muladd = tryRequire( resolve( __dirname, './../lib/native.js' ) ); +var opts = { + 'skip': ( muladd instanceof Error ) +}; + + +// MAIN // + +bench( pkg+'::native', opts, function benchmark( b ) { + var values; + var out; + var z; + var i; + + values = [ + new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ), + new Complex64( uniform( -500.0, 500.0 ), uniform( -500.0, 500.0 ) ) + ]; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = values[ i%values.length ]; + out = muladd( z, z, z ); + if ( typeof out !== 'object' ) { + b.fail( 'should return an object' ); + } + } + b.toc(); + if ( isnanf( realf( out ) ) || isnanf( imagf( out ) ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); \ No newline at end of file diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.strided.js b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.strided.js new file mode 100755 index 000000000000..468507c41b15 --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.strided.js @@ -0,0 +1,68 @@ +/** +* @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 uniform = require( '@stdlib/random/array/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var Float32Array = require( '@stdlib/array/float32' ); +var pkg = require( './../package.json' ).name; +var muladd = require( './../lib' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float32' +}; + + +// MAIN // + +bench( pkg+':strided', function benchmark( b ) { + var out; + var z1; + var z2; + var N; + var i; + var j; + + N = 50; + z1 = uniform( N*2, -500.0, 500.0, options ); + z2 = uniform( N*2, -500.0, 500.0, options ); + + out = new Float32Array( 2 ); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + j = ( i % N ) * 2; + out = muladd.strided( z1, 1, j, z2, 1, j, z2, 1, j, out, 1, 0 ); + if ( typeof out !== 'object' ) { + b.fail( 'should return an object' ); + } + } + b.toc(); + if ( isnanf( out[ 0 ] ) || isnanf( out[ 1 ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); \ No newline at end of file diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/Makefile b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/Makefile new file mode 100755 index 000000000000..b676a7e9919e --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/Makefile @@ -0,0 +1,126 @@ +#/ +# @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. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of C targets: +c_targets := benchmark.out + + +# RULES # + +#/ +# Compiles C source files. +# +# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) +# @param {string} [CFLAGS] - C compiler options +# @param {(string|void)} [fPIC] - compiler flag indicating whether to generate position independent code (e.g., `-fPIC`) +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler +# @param {string} CFLAGS - C compiler flags +# @param {(string|void)} fPIC - compiler flag indicating whether to generate position independent code +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) -o $@ $< -lm + +#/ +# Runs compiled benchmarks. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean \ No newline at end of file diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/benchmark.c new file mode 100755 index 000000000000..c0c5bbc15d18 --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/benchmark.c @@ -0,0 +1,151 @@ +/** +* @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. +*/ + +#include +#include +#include +#include +#include + +#define NAME "cmuladd" +#define ITERATIONS 1000000 +#define REPEATS 3 + +/** +* Prints the TAP version. +*/ +static void print_version( void ) { + printf( "TAP version 13\n" ); +} + +/** +* Prints the TAP summary. +* +* @param total total number of tests +* @param passing total number of passing tests +*/ +static void print_summary( int total, int passing ) { + printf( "#\n" ); + printf( "1..%d\n", total ); // TAP plan + printf( "# total %d\n", total ); + printf( "# pass %d\n", passing ); + printf( "#\n" ); + printf( "# ok\n" ); +} + +/** +* Prints benchmarks results. +* +* @param elapsed elapsed time in seconds +*/ +static void print_results( double elapsed ) { + double rate = (double)ITERATIONS / elapsed; + printf( " ---\n" ); + printf( " iterations: %d\n", ITERATIONS ); + printf( " elapsed: %0.9f\n", elapsed ); + printf( " rate: %0.9f\n", rate ); + printf( " ...\n" ); +} + +/** +* Returns a clock time. +* +* @return clock time +*/ +static double tic( void ) { + struct timeval now; + gettimeofday( &now, NULL ); + return (double)now.tv_sec + (double)now.tv_usec/1.0e6; +} + +/** +* Generates a random number on the interval [0,1). +* +* @return random number +*/ +static float rand_float( void ) { + int r = rand(); + return (float)r / ( (float)RAND_MAX + 1.0f ); +} + +/** +* Runs a benchmark. +* +* @return elapsed time in seconds +*/ +static double benchmark( void ) { + float complex z1[ 100 ]; + float complex z2[ 100 ]; + float complex z3[ 100 ]; + float complex z4; + double elapsed; + float re; + float im; + double t; + int i; + + for ( i = 0; i < 100; i++ ) { + re = ( 1000.0f*rand_float() ) - 500.0f; + im = ( 1000.0f*rand_float() ) - 500.0f; + z1[ i ] = re + im*I; + + re = ( 1000.0f*rand_float() ) - 500.0f; + im = ( 1000.0f*rand_float() ) - 500.0f; + z2[ i ] = re + im*I; + + re = ( 1000.0f*rand_float() ) - 500.0f; + im = ( 1000.0f*rand_float() ) - 500.0f; + z3[ i ] = re + im*I; + } + + t = tic(); + for ( i = 0; i < ITERATIONS; i++ ) { + re = ( crealf(z1[i%100])*crealf(z2[i%100]) ) - ( cimagf(z1[i%100])*cimagf(z2[i%100]) ) + crealf(z3[i%100]); + im = ( crealf(z1[i%100])*cimagf(z2[i%100]) ) + ( cimagf(z1[i%100])*crealf(z2[i%100]) ) + cimagf(z3[i%100]); + z4 = re + im*I; + if ( z4 != z4 ) { + printf( "should not return NaN\n" ); + break; + } + } + elapsed = tic() - t; + if ( z4 != z4 ) { + printf( "should not return NaN\n" ); + } + return elapsed; +} + +/** +* Main execution sequence. +*/ +int main( void ) { + double elapsed; + int i; + + // Use the current time to seed the random number generator: + srand( time( NULL ) ); + + print_version(); + for ( i = 0; i < REPEATS; i++ ) { + printf( "# c::%s\n", NAME ); + elapsed = benchmark(); + print_results( elapsed ); + printf( "ok %d benchmark finished\n", i+1 ); + } + print_summary( REPEATS, REPEATS ); +} \ No newline at end of file diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/native/Makefile b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/native/Makefile new file mode 100755 index 000000000000..1af409fc66b0 --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/native/Makefile @@ -0,0 +1,146 @@ +#/ +# @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. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): +INCLUDE ?= + +# List of source files: +SOURCE_FILES ?= + +# List of libraries (e.g., `-lopenblas -lpthread`): +LIBRARIES ?= + +# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): +LIBPATH ?= + +# List of C targets: +c_targets := benchmark.out + + +# RULES # + +#/ +# Compiles source files. +# +# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) +# @param {string} [CFLAGS] - C compiler options +# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) +# @param {string} [SOURCE_FILES] - list of source files +# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) +# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler (e.g., `gcc`) +# @param {string} CFLAGS - C compiler options +# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) +# @param {string} SOURCE_FILES - list of source files +# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) +# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) + +#/ +# Runs compiled benchmarks. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean \ No newline at end of file diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/native/benchmark.c new file mode 100755 index 000000000000..e5d0c7d29dde --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/native/benchmark.c @@ -0,0 +1,153 @@ +/** +* @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. +*/ + +#include "stdlib/complex/float32/base/mul_add.h" +#include "stdlib/complex/float32/ctor.h" +#include "stdlib/complex/float32/reim.h" +#include +#include +#include +#include +#include + +#define NAME "muladd" +#define ITERATIONS 1000000 +#define REPEATS 3 + +/** +* Prints the TAP version. +*/ +static void print_version( void ) { + printf( "TAP version 13\n" ); +} + +/** +* Prints the TAP summary. +* +* @param total total number of tests +* @param passing total number of passing tests +*/ +static void print_summary( int total, int passing ) { + printf( "#\n" ); + printf( "1..%d\n", total ); // TAP plan + printf( "# total %d\n", total ); + printf( "# pass %d\n", passing ); + printf( "#\n" ); + printf( "# ok\n" ); +} + +/** +* Prints benchmarks results. +* +* @param elapsed elapsed time in seconds +*/ +static void print_results( double elapsed ) { + double rate = (double)ITERATIONS / elapsed; + printf( " ---\n" ); + printf( " iterations: %d\n", ITERATIONS ); + printf( " elapsed: %0.9f\n", elapsed ); + printf( " rate: %0.9f\n", rate ); + printf( " ...\n" ); +} + +/** +* Returns a clock time. +* +* @return clock time +*/ +static double tic( void ) { + struct timeval now; + gettimeofday( &now, NULL ); + return (double)now.tv_sec + (double)now.tv_usec/1.0e6; +} + +/** +* Generates a random number on the interval [0,1). +* +* @return random number +*/ +static float rand_float( void ) { + int r = rand(); + return (float)r / ( (float)RAND_MAX + 1.0f ); +} + +/** +* Runs a benchmark. +* +* @return elapsed time in seconds +*/ +static double benchmark( void ) { + stdlib_complex64_t z1[ 100 ]; + stdlib_complex64_t z2[ 100 ]; + stdlib_complex64_t z3[ 100 ]; + stdlib_complex64_t z4; + double elapsed; + float re; + float im; + double t; + int i; + + for ( i = 0; i < 100; i++ ) { + re = ( 1000.0f*rand_float() ) - 500.0f; + im = ( 1000.0f*rand_float() ) - 500.0f; + z1[ i ] = stdlib_complex64( re, im ); + + re = ( 1000.0f*rand_float() ) - 500.0f; + im = ( 1000.0f*rand_float() ) - 500.0f; + z2[ i ] = stdlib_complex64( re, im ); + + re = ( 1000.0f*rand_float() ) - 500.0f; + im = ( 1000.0f*rand_float() ) - 500.0f; + z3[ i ] = stdlib_complex64( re, im ); + } + + t = tic(); + for ( i = 0; i < ITERATIONS; i++ ) { + z4 = stdlib_base_complex64_muladd( z1[ i%100 ], z2[ i%100 ], z3[ i%100 ] ); + stdlib_complex64_reim( z4, &re, &im ); + if ( re != re ) { + printf( "should not return NaN\n" ); + break; + } + } + elapsed = tic() - t; + if ( im != im ) { + printf( "should not return NaN\n" ); + } + return elapsed; +} + +/** +* Main execution sequence. +*/ +int main( void ) { + double elapsed; + int i; + + // Use the current time to seed the random number generator: + srand( time( NULL ) ); + + print_version(); + for ( i = 0; i < REPEATS; i++ ) { + printf( "# c::native::%s\n", NAME ); + elapsed = benchmark(); + print_results( elapsed ); + printf( "ok %d benchmark finished\n", i+1 ); + } + print_summary( REPEATS, REPEATS ); +} \ No newline at end of file diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/julia/REQUIRE b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/julia/REQUIRE new file mode 100755 index 000000000000..67d3b068ca18 --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/julia/REQUIRE @@ -0,0 +1,2 @@ +julia 1.5 +BenchmarkTools 0.5.0 \ No newline at end of file diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/julia/benchmark.jl b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/julia/benchmark.jl new file mode 100755 index 000000000000..e98b5ff8a2f1 --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/julia/benchmark.jl @@ -0,0 +1,144 @@ +#!/usr/bin/env julia +# +# @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 BenchmarkTools +using Printf + +# Benchmark variables: +name = "muladd"; +repeats = 3; + +""" + print_version() + +Prints the TAP version. + +# Examples + +``` julia +julia> print_version() +``` +""" +function print_version() + @printf( "TAP version 13\n" ); +end + +""" + print_summary( total, passing ) + +Print the benchmark summary. + +# Arguments + +* `total`: total number of tests +* `passing`: number of passing tests + +# Examples + +``` julia +julia> print_summary( 3, 3 ) +``` +""" +function print_summary( total, passing ) + @printf( "#\n" ); + @printf( "1..%d\n", total ); # TAP plan + @printf( "# total %d\n", total ); + @printf( "# pass %d\n", passing ); + @printf( "#\n" ); + @printf( "# ok\n" ); +end + +""" + print_results( iterations, elapsed ) + +Print benchmark results. + +# Arguments + +* `iterations`: number of iterations +* `elapsed`: elapsed time (in seconds) + +# Examples + +``` julia +julia> print_results( 1000000, 0.131009101868 ) +``` +""" +function print_results( iterations, elapsed ) + rate = iterations / elapsed + + @printf( " ---\n" ); + @printf( " iterations: %d\n", iterations ); + @printf( " elapsed: %0.9f\n", elapsed ); + @printf( " rate: %0.9f\n", rate ); + @printf( " ...\n" ); +end + +""" + benchmark() + +Run a benchmark. + +# Notes + +* Benchmark results are returned as a two-element array: [ iterations, elapsed ]. +* The number of iterations is not the true number of iterations. Instead, an 'iteration' is defined as a 'sample', which is a computed estimate for a single evaluation. +* The elapsed time is in seconds. + +# Examples + +``` julia +julia> out = benchmark(); +``` +""" +function benchmark() + t = BenchmarkTools.@benchmark ( ComplexF32( (rand()*1000.0)-500.0, (rand()*1000.0)-500.0 ) * ComplexF32( (rand()*1000.0)-500.0, (rand()*1000.0)-500.0 ) ) + ComplexF32( (rand()*1000.0)-500.0, (rand()*1000.0)-500.0 ) samples=1e6 + + # Compute the total "elapsed" time and convert from nanoseconds to seconds: + s = sum( t.times ) / 1.0e9; + + # Determine the number of "iterations": + iter = length( t.times ); + + # Return the results: + [ iter, s ]; +end + +""" + main() + +Run benchmarks. + +# Examples + +``` julia +julia> main(); +``` +""" +function main() + print_version(); + for i in 1:repeats + @printf( "# julia::%s\n", name ); + results = benchmark(); + print_results( results[ 1 ], results[ 2 ] ); + @printf( "ok %d benchmark finished\n", i ); + end + print_summary( repeats, repeats ); +end + +main(); \ No newline at end of file diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/binding.gyp b/lib/node_modules/@stdlib/complex/float32/base/mul-add/binding.gyp new file mode 100755 index 000000000000..009bb9da333a --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/binding.gyp @@ -0,0 +1,170 @@ +# @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. + +# A `.gyp` file for building a Node.js native add-on. +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # List of files to include in this file: + 'includes': [ + './include.gypi', + ], + + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Target name should match the add-on export name: + 'addon_target_name%': 'addon', + + # Set variables based on the host OS: + 'conditions': [ + [ + 'OS=="win"', + { + # Define the object file suffix: + 'obj': 'obj', + }, + { + # Define the object file suffix: + 'obj': 'o', + } + ], # end condition (OS=="win") + ], # end conditions + }, # end variables + + # Define compile targets: + 'targets': [ + + # Target to generate an add-on: + { + # The target name should match the add-on export name: + 'target_name': '<(addon_target_name)', + + # Define dependencies: + 'dependencies': [], + + # Define directories which contain relevant include headers: + 'include_dirs': [ + # Local include directory: + '<@(include_dirs)', + ], + + # List of source files: + 'sources': [ + '<@(src_files)', + ], + + # Settings which should be applied when a target's object files are used as linker input: + 'link_settings': { + # Define libraries: + 'libraries': [ + '<@(libraries)', + ], + + # Define library directories: + 'library_dirs': [ + '<@(library_dirs)', + ], + }, + + # C/C++ compiler flags: + 'cflags': [ + # Enable commonly used warning options: + '-Wall', + + # Aggressive optimization: + '-O3', + ], + + # C specific compiler flags: + 'cflags_c': [ + # Specify the C standard to which a program is expected to conform: + '-std=c99', + ], + + # C++ specific compiler flags: + 'cflags_cpp': [ + # Specify the C++ standard to which a program is expected to conform: + '-std=c++11', + ], + + # Linker flags: + 'ldflags': [], + + # Apply conditions based on the host OS: + 'conditions': [ + [ + 'OS=="mac"', + { + # Linker flags: + 'ldflags': [ + '-undefined dynamic_lookup', + '-Wl,-no-pie', + '-Wl,-search_paths_first', + ], + }, + ], # end condition (OS=="mac") + [ + 'OS!="win"', + { + # C/C++ flags: + 'cflags': [ + # Generate platform-independent code: + '-fPIC', + ], + }, + ], # end condition (OS!="win") + ], # end conditions + }, # end target <(addon_target_name) + + # Target to copy a generated add-on to a standard location: + { + 'target_name': 'copy_addon', + + # Declare that the output of this target is not linked: + 'type': 'none', + + # Define dependencies: + 'dependencies': [ + # Require that the add-on be generated before building this target: + '<(addon_target_name)', + ], + + # Define a list of actions: + 'actions': [ + { + 'action_name': 'copy_addon', + 'message': 'Copying addon...', + + # Explicitly list the inputs in the command-line invocation below: + 'inputs': [], + + # Declare the expected outputs: + 'outputs': [ + '<(addon_output_dir)/<(addon_target_name).node', + ], + + # Define the command-line invocation: + 'action': [ + 'cp', + '<(PRODUCT_DIR)/<(addon_target_name).node', + '<(addon_output_dir)/<(addon_target_name).node', + ], + }, + ], # end actions + }, # end target copy_addon + ], # end targets +} \ No newline at end of file diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/docs/repl.txt b/lib/node_modules/@stdlib/complex/float32/base/mul-add/docs/repl.txt new file mode 100755 index 000000000000..1baa43b90782 --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/docs/repl.txt @@ -0,0 +1,141 @@ + +{{alias}}( alpha, x, y ) + Performs a multiply-add operation involving three single-precision complex + floating-point numbers. + + Parameters + ---------- + alpha: Complex64 + Complex number. + + x: Complex64 + Complex number. + + y: Complex64 + Complex number. + + Returns + ------- + out: Complex64 + Result. + + Examples + -------- + > var z1 = new {{alias:@stdlib/complex/float32/ctor}}( 5.0, 3.0 ) + + > var z2 = new {{alias:@stdlib/complex/float32/ctor}}( -2.0, 1.0 ) + + > var z3 = new {{alias:@stdlib/complex/float32/ctor}}( 7.0, -8.0 ) + + > var out = {{alias}}( z1, z2, z3 ) + + > var re = {{alias:@stdlib/complex/float32/real}}( out ) + -6.0 + > var im = {{alias:@stdlib/complex/float32/imag}}( out ) + -9.0 + + +{{alias}}.assign( ar, ai, xr, xi, yr, yi, out, strideOut, offsetOut ) + Performs a multiply-add operation involving three single-precision complex + floating-point numbers and assigns the results to an output strided array. + + Parameters + ---------- + ar: number + Real component of the first complex number. + + ai: number + Imaginary component of the first complex number. + + xr: number + Real component of the second complex number. + + xi: number + Imaginary component of the second complex number. + + yr: number + Real component of the third complex number. + + yi: number + Imaginary component of the third complex number. + + out: ArrayLikeObject + Output array. + + strideOut: integer + Stride length. + + offsetOut: integer + Starting index. + + Returns + ------- + out: ArrayLikeObject + Output array. + + Examples + -------- + > var out = new {{alias:@stdlib/array/float32}}( 2 ); + > {{alias}}.assign( 5.0, 3.0, -2.0, 1.0, 7.0, -8.0, out, 1, 0 ) + [ -6.0, -9.0 ] + + +{{alias}}.strided( a, sa, oa, x, sx, ox, y, sy, oy, out, so, oo ) + Performs a multiply-add operation involving three single-precision complex + floating-point numbers stored in real-valued strided array views and assigns + results to a provided strided output array. + + Parameters + ---------- + a: ArrayLikeObject + First complex number view. + + sa: integer + Stride length for `a`. + + oa: integer + Starting index for `a`. + + x: ArrayLikeObject + Second complex number view. + + sx: integer + Stride length for `x`. + + ox: integer + Starting index for `x`. + + y: ArrayLikeObject + Third complex number view. + + sy: integer + Stride length for `y`. + + oy: integer + Starting index for `y`. + + out: ArrayLikeObject + Output array. + + so: integer + Stride length for `out`. + + oo: integer + Starting index for `out`. + + Returns + ------- + out: ArrayLikeObject + Output array. + + Examples + -------- + > var z1 = new {{alias:@stdlib/array/float32}}( [ 5.0, 3.0 ] ); + > var z2 = new {{alias:@stdlib/array/float32}}( [ -2.0, 1.0 ] ); + > var z3 = new {{alias:@stdlib/array/float32}}( [ 7.0, -8.0 ] ); + > var out = new {{alias:@stdlib/array/float32}}( 2 ); + > {{alias}}.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ) + [ -6.0, -9.0 ] + + See Also + -------- diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/docs/types/index.d.ts b/lib/node_modules/@stdlib/complex/float32/base/mul-add/docs/types/index.d.ts new file mode 100755 index 000000000000..21ec93b8115b --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/docs/types/index.d.ts @@ -0,0 +1,177 @@ +/* +* @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 { Complex64 } from '@stdlib/types/complex'; +import { Collection, NumericArray } from '@stdlib/types/array'; + +/** +* Input array. +*/ +type InputArray = NumericArray | Collection; + +/** +* Output array. +*/ +type OutputArray = NumericArray | Collection; + +/** +* Interface for performing a multiply-add operation involving three single-precision complex floating-point numbers. +*/ +interface MulAdd { + /** + * Performs a multiply-add operation involving three single-precision complex floating-point numbers. + * + * @param alpha - complex number + * @param x - complex number + * @param y - complex number + * @returns result + * + * @example + * var Complex64 = require( '@stdlib/complex/float32/ctor' ); + * var realf = require( '@stdlib/complex/float32/real' ); + * var imagf = require( '@stdlib/complex/float32/imag' ); + * + * var z1 = new Complex64( 5.0, 3.0 ); + * // returns + * + * var z2 = new Complex64( -2.0, 1.0 ); + * // returns + * + * var z3 = new Complex64( 7.0, -8.0 ); + * // returns + * + * var out = muladd( z1, z2, z3 ); + * // returns + * + * var re = realf( out ); + * // returns -6.0 + * + * var im = imagf( out ); + * // returns -9.0 + */ + ( alpha: Complex64, x: Complex64, y: Complex64 ): Complex64; + + /** + * Performs a multiply-add operation involving three single-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array. + * + * @param ar - real component of the first complex number + * @param ai - imaginary component of the first complex number + * @param xr - real component of the second complex number + * @param xi - imaginary component of the second complex number + * @param yr - real component of the third complex number + * @param yi - imaginary component of the third complex number + * @param out - output array + * @param strideOut - stride length + * @param offsetOut - starting index + * @returns output array + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * + * var out = muladd.assign( 5.0, 3.0, -2.0, 1.0, 7.0, -8.0, new Float32Array( 2 ), 1, 0 ); + * // returns [ -6.0, -9.0 ] + */ + assign( ar: number, ai: number, xr: number, xi: number, yr: number, yi: number, out: T, strideOut: number, offsetOut: number ): T; + + /** + * Performs a multiply‐add operation involving three double‐precision complex floating‐point numbers stored in real‐valued strided array views and assigns the results to a provided strided output array. + * + * @param alpha - first complex number view + * @param strideA - stride length for `alpha` + * @param offsetA - starting index for `alpha` + * @param x - second complex number view + * @param strideX - stride length for `x` + * @param offsetX - starting index for `x` + * @param y - third complex number view + * @param strideY - stride length for `y` + * @param offsetY - starting index for `y` + * @param out - output array + * @param strideOut - stride length for `out` + * @param offsetOut - starting index for `out` + * @returns output array + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * + * var alpha = new Float32Array( [ 5.0, 3.0 ] ); + * var x = new Float32Array( [ -2.0, 1.0 ] ); + * var y = new Float32Array( [ 7.0, -8.0 ] ); + * + * var out = muladd.strided( alpha, 1, 0, x, 1, 0, y, 1, 0, new Float32Array( 2 ), 1, 0 ); + * // returns [ -6.0, -9.0 ] + */ + strided( alpha: T, strideA: number, offsetA: number, x: U, strideX: number, offsetX: number, y: V, strideY: number, offsetY: number, out: W, strideOut: number, offsetOut: number ): W; +} + +/** +* Performs a multiply-add operation involving three single-precision complex floating-point numbers. +* +* @param alpha - complex number +* @param x - complex number +* @param y - complex number +* @returns result +* +* @example +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* var realf = require( '@stdlib/complex/float32/realf' ); +* var imagf = require( '@stdlib/complex/float32/imag' ); +* +* var z1 = new Complex64( 5.0, 3.0 ); +* // returns +* +* var z2 = new Complex64( -2.0, 1.0 ); +* // returns +* +* var z3 = new Complex64( 7.0, -8.0 ); +* // returns +* +* var out = muladd( z1, z2, z3 ); +* // returns +* +* var re = realf( out ); +* // returns -6.0 +* +* var im = imagf( out ); +* // returns -9.0 +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* +* var out = muladd.assign( 5.0, 3.0, -2.0, 1.0, 7.0, -8.0, new Float32Array( 2 ), 1, 0 ); +* // returns [ -6.0, -9.0 ] +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* +* var alpha = new Float32Array( [ 5.0, 3.0 ] ); +* var x = new Float32Array( [ -2.0, 1.0 ] ); +* var y = new Float32Array( [ 7.0, -8.0 ] ); +* +* var out = muladd.strided( alpha, 1, 0, x, 1, 0, y, 1, 0, new Float32Array( 2 ), 1, 0 ); +* // returns [ -6.0, -9.0 ] +*/ +declare var muladd: MulAdd; + + +// EXPORTS // + +export = muladd; \ No newline at end of file diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/docs/types/test.ts b/lib/node_modules/@stdlib/complex/float32/base/mul-add/docs/types/test.ts new file mode 100755 index 000000000000..21ce204317cd --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/docs/types/test.ts @@ -0,0 +1,465 @@ +/* +* @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 Complex64 = require( '@stdlib/complex/float32/ctor' ); +import muladd = require( './index' ); + + +// TESTS // + +// The function returns a complex number... +{ + const z = new Complex64( 1.0, 1.0 ); + + muladd( z, z, z ); // $ExpectType Complex64 +} + +// The compiler throws an error if the function is provided a first argument which is not a complex number... +{ + const z = new Complex64( 1.0, 1.0 ); + + muladd( true, z, z ); // $ExpectError + muladd( false, z, z ); // $ExpectError + muladd( null, z, z ); // $ExpectError + muladd( undefined, z, z ); // $ExpectError + muladd( '5', z, z ); // $ExpectError + muladd( [], z, z ); // $ExpectError + muladd( {}, z, z ); // $ExpectError + muladd( ( x: number ): number => x, z, z ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a complex number... +{ + const z = new Complex64( 1.0, 1.0 ); + + muladd( z, true, z ); // $ExpectError + muladd( z, false, z ); // $ExpectError + muladd( z, null, z ); // $ExpectError + muladd( z, undefined, z ); // $ExpectError + muladd( z, '5', z ); // $ExpectError + muladd( z, [], z ); // $ExpectError + muladd( z, {}, z ); // $ExpectError + muladd( z, ( x: number ): number => x, z ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a complex number... +{ + const z = new Complex64( 1.0, 1.0 ); + + muladd( z, z, true ); // $ExpectError + muladd( z, z, false ); // $ExpectError + muladd( z, z, null ); // $ExpectError + muladd( z, z, undefined ); // $ExpectError + muladd( z, z, '5' ); // $ExpectError + muladd( z, z, [] ); // $ExpectError + muladd( z, z, {} ); // $ExpectError + muladd( z, z, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const z = new Complex64( 1.0, 1.0 ); + + muladd(); // $ExpectError + muladd( z ); // $ExpectError + muladd( z, z ); // $ExpectError + muladd( z, z, z, z ); // $ExpectError +} + +// Attached to the main export is an `assign` method which returns a collection... +{ + muladd.assign( 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, new Float32Array( 2 ), 1, 0 ); // $ExpectType Float32Array + muladd.assign( 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, [ 0.0, 0.0 ], 1, 0 ); // $ExpectType number[] +} + +// The compiler throws an error if the `assign` method is provided a first argument which is not a number... +{ + const out = new Float32Array( 2 ); + + muladd.assign( true, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( false, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( null, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( undefined, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( '5', 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( [], 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( {}, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( ( x: number ): number => x, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `assign` method is provided a second argument which is not a number... +{ + const out = new Float32Array( 2 ); + + muladd.assign( 1.0, true, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, false, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, null, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, undefined, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, '5', 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, [], 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, {}, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, ( x: number ): number => x, 3.0, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `assign` method is provided a third argument which is not a number... +{ + const out = new Float32Array( 2 ); + + muladd.assign( 1.0, 2.0, true, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, false, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, null, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, undefined, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, '5', 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, [], 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, {}, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, ( x: number ): number => x, 4.0, 5.0, 6.0, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `assign` method is provided a fourth argument which is not a number... +{ + const out = new Float32Array( 2 ); + + muladd.assign( 1.0, 2.0, 3.0, true, 5.0, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, false, 5.0, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, null, 5.0, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, undefined, 5.0, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, '5', 5.0, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, [], 5.0, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, {}, 5.0, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, ( x: number ): number => x, 5.0, 6.0, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `assign` method is provided a fifth argument which is not a number... +{ + const out = new Float32Array( 2 ); + + muladd.assign( 1.0, 2.0, 3.0, 4.0, true, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, false, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, null, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, undefined, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, '5', 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, [], 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, {}, 6.0, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, ( x: number ): number => x, 6.0, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `assign` method is provided a sixth argument which is not a number... +{ + const out = new Float32Array( 2 ); + + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, true, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, false, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, null, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, undefined, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, '5', out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, [], out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, {}, out, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, ( x: number ): number => x, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `assign` method is provided a seventh argument which is not a collection... +{ + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 1, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, true, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, false, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, null, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, undefined, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, '5', 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, [ '5' ], 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, {}, 1, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `assign` method is provided an eighth argument which is not a number... +{ + const out = new Float32Array( 2 ); + + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, true, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, false, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, null, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, undefined, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, '5', 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, [], 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, {}, 0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the `assign` method is provided a ninth argument which is not a number... +{ + const out = new Float32Array( 2 ); + + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, true ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, false ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, null ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, undefined ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, '5' ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, [] ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, {} ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `assign` method is provided an unsupported number of arguments... +{ + const out = new Float32Array( 2 ); + + muladd.assign(); // $ExpectError + muladd.assign( 1.0 ); // $ExpectError + muladd.assign( 1.0, 2.0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1 ); // $ExpectError + muladd.assign( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, out, 1, 0, {} ); // $ExpectError +} + +// Attached to the main export is a `strided` method which returns a collection... +{ + const z1 = new Float32Array( 2 ); + const z2 = new Float32Array( z1.length ); + const z3 = new Float32Array( z2.length ); + + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, new Float32Array( 2 ), 1, 0 ); // $ExpectType Float32Array + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, [ 0.0, 0.0 ], 1, 0 ); // $ExpectType number[] +} + +// The compiler throws an error if the `strided` method is provided a first argument which is not a collection... +{ + const z1 = new Float32Array( 2 ); + const z2 = new Float32Array( z1.length ); + const z3 = new Float32Array( z2.length ); + const out = new Float32Array( z2.length ); + + muladd.strided( true, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( false, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( null, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( undefined, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( '5', 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( [ '5' ], 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( {}, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( ( x: number ): number => x, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `strided` method is provided a second argument which is not a number... +{ + const z1 = new Float32Array( 2 ); + const z2 = new Float32Array( z1.length ); + const z3 = new Float32Array( z2.length ); + const out = new Float32Array( z2.length ); + + muladd.strided( z1, true, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, false, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, null, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, undefined, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, '5', 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, [], 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, {}, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, ( x: number ): number => x, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `strided` method is provided a third argument which is not a number... +{ + const z1 = new Float32Array( 2 ); + const z2 = new Float32Array( z1.length ); + const z3 = new Float32Array( z2.length ); + const out = new Float32Array( z2.length ); + + muladd.strided( z1, 1, true, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, false, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, null, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, undefined, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, '5', z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, [], z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, {}, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, ( x: number ): number => x, z2, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `strided` method is provided a fourth argument which is not a collection... +{ + const z1 = new Float32Array( 2 ); + const z2 = new Float32Array( z1.length ); + const z3 = new Float32Array( z2.length ); + const out = new Float32Array( z2.length ); + + muladd.strided( z1, 1, 0, true, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, false, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, null, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, undefined, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, '5', 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, [ '5' ], 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, {}, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, ( x: number ): number => x, 1, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `strided` method is provided a fifth argument which is not a number... +{ + const z1 = new Float32Array( 2 ); + const z2 = new Float32Array( z1.length ); + const z3 = new Float32Array( z2.length ); + const out = new Float32Array( z2.length ); + + muladd.strided( z1, 1, 0, z2, true, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, false, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, null, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, undefined, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, '5', 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, [], 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, {}, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, ( x: number ): number => x, 0, z3, 1, 0, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `strided` method is provided a sixth argument which is not a number... +{ + const z1 = new Float32Array( 2 ); + const z2 = new Float32Array( z1.length ); + const z3 = new Float32Array( z2.length ); + const out = new Float32Array( z2.length ); + + muladd.strided( z1, 1, 0, z2, 1, true, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, false, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, null, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, undefined, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, '5', z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, [], z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, {}, z3, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, ( x: number ): number => x, z3, 1, 0, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `strided` method is provided a seventh argument which is not a collection... +{ + const z1 = new Float32Array( 2 ); + const z2 = new Float32Array( z1.length ); + const z3 = new Float32Array( z2.length ); + const out = new Float32Array( z3.length ); + + muladd.strided( z1, 1, 0, z2, 1, 0, true, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, false, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, null, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, undefined, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, '5', 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, [ '5' ], 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, {}, 1, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, ( x: number ): number => x, 1, 0, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `strided` method is provided an eighth argument which is not a number... +{ + const z1 = new Float32Array( 2 ); + const z2 = new Float32Array( z1.length ); + const z3 = new Float32Array( z2.length ); + const out = new Float32Array( z2.length ); + + muladd.strided( z1, 1, 0, z2, 1, 0, z3, true, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, false, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, null, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, undefined, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, '5', 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, [], 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, {}, 0, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, ( x: number ): number => x, 0, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `strided` method is provided a ninth argument which is not a number... +{ + const z1 = new Float32Array( 2 ); + const z2 = new Float32Array( z1.length ); + const z3 = new Float32Array( z2.length ); + const out = new Float32Array( z2.length ); + + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, true, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, false, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, null, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, undefined, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, '5', out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, [], out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, {}, out, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, ( x: number ): number => x, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `strided` method is provided a tenth argument which is not a collection... +{ + const z1 = new Float32Array( 2 ); + const z2 = new Float32Array( z1.length ); + const z3 = new Float32Array( z2.length ); + + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, 1, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, true, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, false, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, null, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, undefined, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, '5', 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, [ '5' ], 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, {}, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `strided` method is provided an eleventh argument which is not a number... +{ + const z1 = new Float32Array( 2 ); + const z2 = new Float32Array( z1.length ); + const z3 = new Float32Array( z2.length ); + const out = new Float32Array( z2.length ); + + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, true, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, false, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, null, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, undefined, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, '5', 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, [], 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, {}, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the `strided` method is provided a twelfth argument which is not a number... +{ + const z1 = new Float32Array( 2 ); + const z2 = new Float32Array( z1.length ); + const z3 = new Float32Array( z2.length ); + const out = new Float32Array( z2.length ); + + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, true ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, false ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, null ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, undefined ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, '5' ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, [] ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, {} ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `strided` method is provided an unsupported number of arguments... +{ + const z1 = new Float32Array( 2 ); + const z2 = new Float32Array( z1.length ); + const z3 = new Float32Array( z2.length ); + const out = new Float32Array( z2.length ); + + muladd.strided(); // $ExpectError + muladd.strided( z1 ); // $ExpectError + muladd.strided( z1, 1 ); // $ExpectError + muladd.strided( z1, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1 ); // $ExpectError + muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0, {} ); // $ExpectError +} \ No newline at end of file diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/c/Makefile b/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/c/Makefile new file mode 100755 index 000000000000..73bb9ed0b748 --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/c/Makefile @@ -0,0 +1,146 @@ +#/ +# @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. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): +INCLUDE ?= + +# List of source files: +SOURCE_FILES ?= + +# List of libraries (e.g., `-lopenblas -lpthread`): +LIBRARIES ?= + +# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): +LIBPATH ?= + +# List of C targets: +c_targets := example.out + + +# RULES # + +#/ +# Compiles source files. +# +# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) +# @param {string} [CFLAGS] - C compiler options +# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) +# @param {string} [SOURCE_FILES] - list of source files +# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) +# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler (e.g., `gcc`) +# @param {string} CFLAGS - C compiler options +# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) +# @param {string} SOURCE_FILES - list of source files +# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) +# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) + +#/ +# Runs compiled examples. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean \ No newline at end of file diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/c/example.c b/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/c/example.c new file mode 100755 index 000000000000..7ae4fefa8be6 --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/c/example.c @@ -0,0 +1,46 @@ +/** +* @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. +*/ + +#include "stdlib/complex/float32/base/mul_add.h" +#include "stdlib/complex/float32/ctor.h" +#include "stdlib/complex/float32/reim.h" +#include + +int main( void ) { + const stdlib_complex64_t x[] = { + stdlib_complex64( 3.14, 1.5 ), + stdlib_complex64( -3.14, 1.5 ), + stdlib_complex64( 0.0, -0.0 ), + stdlib_complex64( 0.0/0.0, 0.0/0.0 ) + }; + + stdlib_complex64_t v; + stdlib_complex64_t y; + float re; + float im; + int i; + for ( i = 0; i < 4; i++ ) { + v = x[ i ]; + stdlib_complex64_reim( v, &re, &im ); + printf( "z = %f + %fi\n", re, im ); + + y = stdlib_base_complex64_muladd( v, v, v ); + stdlib_complex64_reim( y, &re, &im ); + printf( "z*z + z = %f + %fi\n", re, im ); + } +} \ No newline at end of file diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/index.js b/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/index.js new file mode 100755 index 000000000000..cd83f3ce7184 --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/index.js @@ -0,0 +1,36 @@ +/** +* @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 Complex64 = require( '@stdlib/complex/float32/ctor' ); +var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +var muladd = require( './../lib' ); + +var rand = discreteUniform( -50, 50 ); + +var z1; +var z2; +var z3; +var i; +for ( i = 0; i < 100; i++ ) { + z1 = new Complex64( rand(), rand() ); + z2 = new Complex64( rand(), rand() ); + z3 = muladd( z1, z2, z2 ); + console.log( '(%s)*(%s) + (%s) = %s', z1.toString(), z2.toString(), z2.toString(), z3.toString() ); +} \ No newline at end of file diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/include.gypi b/lib/node_modules/@stdlib/complex/float32/base/mul-add/include.gypi new file mode 100755 index 000000000000..f6557ac1ab57 --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/include.gypi @@ -0,0 +1,53 @@ +# @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. + +# A GYP include file for building a Node.js native add-on. +# +# Main documentation: +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Source directory: + 'src_dir': './src', + + # Include directories: + 'include_dirs': [ + '[ -6.0, -9.0 ] +*/ +function assign( ar, ai, xr, xi, yr, yi, out, strideOut, offsetOut ) { + out[ offsetOut ] = float64ToFloat32( float64ToFloat32(ar*xr) - float64ToFloat32(ai*xi) + yr ); + out[ offsetOut+strideOut ] = float64ToFloat32( float64ToFloat32(ar*xi) + float64ToFloat32(ai*xr) + yi ); + return out; +} + + +// EXPORTS // + +module.exports = assign; diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/lib/index.js b/lib/node_modules/@stdlib/complex/float32/base/mul-add/lib/index.js new file mode 100755 index 000000000000..4c6ae2e342aa --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/lib/index.js @@ -0,0 +1,69 @@ +/** +* @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'; + +/** +* Perform a multiply-add operation involving three single-precision complex floating-point numbers. +* +* @module @stdlib/complex/float32/base/mul-add +* +* @example +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* var realf = require( '@stdlib/complex/float32/real' ); +* var imagf = require( '@stdlib/complex/float32/imag' ); +* var muladd = require( '@stdlib/complex/float32/base/mul-add' ); +* +* var z1 = new Complex64( 5.0, 3.0 ); +* // returns +* +* var z2 = new Complex64( -2.0, 1.0 ); +* // returns +* +* var z3 = new Complex64( 7.0, -8.0 ); +* // returns +* +* var out = muladd( z1, z2, z3 ); +* // returns +* +* var re = realf( out ); +* // returns -6.0 +* +* var im = imagf( out ); +* // returns -9.0 +*/ + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var main = require( './main.js' ); +var assign = require( './assign.js' ); +var strided = require( './strided.js' ); + + +// MAIN // + +setReadOnly( main, 'assign', assign ); +setReadOnly( main, 'strided', strided ); + + +// EXPORTS // + +module.exports = main; + +// exports: { "assign": "main.assign", "strided": "main.strided" } diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/lib/main.js b/lib/node_modules/@stdlib/complex/float32/base/mul-add/lib/main.js new file mode 100755 index 000000000000..473a7d79813e --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/lib/main.js @@ -0,0 +1,77 @@ +/** +* @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 Complex64 = require( '@stdlib/complex/float32/ctor' ); +var realf = require( '@stdlib/complex/float32/real' ); +var imagf = require( '@stdlib/complex/float32/imag' ); +var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); + + +// MAIN // + +/** +* Performs a multiply-add operation involving three single-precision complex floating-point numbers. +* +* @param {Complex64} alpha - complex number +* @param {Complex64} x - complex number +* @param {Complex64} y - complex number +* @returns {Complex64} result +* +* @example +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* var realf = require( '@stdlib/complex/float32/real' ); +* var imagf = require( '@stdlib/complex/float32/imag' ); +* +* var z1 = new Complex64( 5.0, 3.0 ); +* // returns +* +* var z2 = new Complex64( -2.0, 1.0 ); +* // returns +* +* var z3 = new Complex64( 7.0, -8.0 ); +* // returns +* +* var out = muladd( z1, z2, z3 ); +* // returns +* +* var re = realf( out ); +* // returns -6.0 +* +* var im = imagf( out ); +* // returns -9.0 +*/ +function muladd( alpha, x, y ) { + var re0 = realf( alpha ); + var im0 = imagf( alpha ); + var re1 = realf( x ); + var im1 = imagf( x ); + var re2 = realf( y ); + var im2 = imagf( y ); + var re = float64ToFloat32( float64ToFloat32(re0*re1) - float64ToFloat32(im0*im1) + re2 ); + var im = float64ToFloat32( float64ToFloat32(re0*im1) + float64ToFloat32(im0*re1) + im2 ); + return new Complex64( re, im ); +} + + +// EXPORTS // + +module.exports = muladd; diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/lib/native.js b/lib/node_modules/@stdlib/complex/float32/base/mul-add/lib/native.js new file mode 100755 index 000000000000..4678cc32ace7 --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/lib/native.js @@ -0,0 +1,69 @@ +/** +* @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 Complex64 = require( '@stdlib/complex/float32/ctor' ); +var addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Performs a multiply-add operation involving three single-precision complex floating-point numbers. +* +* @private +* @param {Complex64} alpha - complex number +* @param {Complex64} x - complex number +* @param {Complex64} y - complex number +* @returns {Complex64} result +* +* @example +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* var realf = require( '@stdlib/complex/float32/real' ); +* var imagf = require( '@stdlib/complex/float32/imag' ); +* +* var z1 = new Complex64( 5.0, 3.0 ); +* // returns +* +* var z2 = new Complex64( -2.0, 1.0 ); +* // returns +* +* var z3 = new Complex64( 7.0, -8.0 ); +* // returns +* +* var out = muladd( z1, z2, z3 ); +* // returns +* +* var re = realf( out ); +* // returns -6.0 +* +* var im = imagf( out ); +* // returns -9.0 +*/ +function muladd( alpha, x, y ) { + var v = addon( alpha, x, y ); + return new Complex64( v.re, v.im ); +} + + +// EXPORTS // + +module.exports = muladd; \ No newline at end of file diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/lib/strided.js b/lib/node_modules/@stdlib/complex/float32/base/mul-add/lib/strided.js new file mode 100755 index 000000000000..3fcec02d2655 --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/lib/strided.js @@ -0,0 +1,70 @@ +/** +* @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 float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); + + +// MAIN // + +/** +* Performs a multiply-add operation involving three single-precision complex floating-point numbers stored in real-valued strided array views and assigns results to a provided strided output array. +* +* @param {Float32Array} alpha - first complex number view +* @param {integer} strideA - stride length for `alpha` +* @param {NonNegativeInteger} offsetA - starting index for `alpha` +* @param {Float32Array} x - second complex number view +* @param {integer} strideX - stride length for `x` +* @param {NonNegativeInteger} offsetX - starting index for `x` +* @param {Float32Array} y - third complex number view +* @param {integer} strideY - stride length for `y` +* @param {NonNegativeInteger} offsetY - starting index for `y` +* @param {Collection} out - output array +* @param {integer} strideOut - stride length for `out` +* @param {NonNegativeInteger} offsetOut - starting index for `out` +* @returns {Collection} output array +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* +* var alpha = new Float32Array( [ 5.0, 3.0 ] ); +* var x = new Float32Array( [ -2.0, 1.0 ] ); +* var y = new Float32Array( [ 7.0, -8.0 ] ); +* +* var out = strided( alpha, 1, 0, x, 1, 0, y, 1, 0, new Float32Array( 2 ), 1, 0 ); +* // returns [ -6.0, -9.0 ] +*/ +function strided( alpha, strideA, offsetA, x, strideX, offsetX, y, strideY, offsetY, out, strideOut, offsetOut ) { // eslint-disable-line max-len, max-params + var re0 = alpha[ offsetA ]; + var im0 = alpha[ offsetA+strideA ]; + var re1 = x[ offsetX ]; + var im1 = x[ offsetX+strideX ]; + var re2 = y[ offsetY ]; + var im2 = y[ offsetY+strideY ]; + out[ offsetOut ] = float64ToFloat32( float64ToFloat32(re0*re1) - float64ToFloat32(im0*im1) + re2 ); + out[ offsetOut+strideOut ] = float64ToFloat32( float64ToFloat32(re0*im1) + float64ToFloat32(im0*re1) + im2 ); + return out; +} + + +// EXPORTS // + +module.exports = strided; \ No newline at end of file diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/manifest.json b/lib/node_modules/@stdlib/complex/float32/base/mul-add/manifest.json new file mode 100755 index 000000000000..fd50190cdade --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/manifest.json @@ -0,0 +1,75 @@ +{ + "options": { + "task": "build" + }, + "fields": [ + { + "field": "src", + "resolve": true, + "relative": true + }, + { + "field": "include", + "resolve": true, + "relative": true + }, + { + "field": "libraries", + "resolve": false, + "relative": false + }, + { + "field": "libpath", + "resolve": true, + "relative": false + } + ], + "confs": [ + { + "task": "build", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/math/base/napi/ternary", + "@stdlib/complex/float32/ctor", + "@stdlib/complex/float32/reim" + ] + }, + { + "task": "benchmark", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/complex/float32/ctor", + "@stdlib/complex/float32/reim" + ] + }, + { + "task": "examples", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/complex/float32/ctor", + "@stdlib/complex/float32/reim" + ] + } + ] + } \ No newline at end of file diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/package.json b/lib/node_modules/@stdlib/complex/float32/base/mul-add/package.json new file mode 100755 index 000000000000..c173a57a7614 --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/package.json @@ -0,0 +1,70 @@ +{ + "name": "@stdlib/complex/float32/base/muladd", + "version": "0.0.0", + "description": "Perform a multiply-add operation involving three single-precision complex floating-point numbers.", + "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", + "gypfile": true, + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "include": "./include", + "lib": "./lib", + "src": "./src", + "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", + "mul", + "mult", + "multiply", + "multiplication", + "addition", + "add", + "arithmetic", + "complex", + "cmplx", + "number" + ] + } \ No newline at end of file diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/src/Makefile b/lib/node_modules/@stdlib/complex/float32/base/mul-add/src/Makefile new file mode 100755 index 000000000000..7733b6180cb4 --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/src/Makefile @@ -0,0 +1,70 @@ +#/ +# @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. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + + +# RULES # + +#/ +# Removes generated files for building an add-on. +# +# @example +# make clean-addon +#/ +clean-addon: + $(QUIET) -rm -f *.o *.node + +.PHONY: clean-addon + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: clean-addon + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/src/addon.c b/lib/node_modules/@stdlib/complex/float32/base/mul-add/src/addon.c new file mode 100755 index 000000000000..c6b65cb54f41 --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/src/addon.c @@ -0,0 +1,23 @@ +/** +* @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. +*/ + +#include "stdlib/complex/float32/base/mul_add.h" +#include "stdlib/math/base/napi/ternary.h" + +// cppcheck-suppress shadowFunction +STDLIB_MATH_BASE_NAPI_MODULE_CCC_C( stdlib_base_complex64_muladd ) \ No newline at end of file diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/src/main.c b/lib/node_modules/@stdlib/complex/float32/base/mul-add/src/main.c new file mode 100755 index 000000000000..26a9d6074f0b --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/src/main.c @@ -0,0 +1,66 @@ +/** +* @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. +*/ + +#include "stdlib/complex/float32/base/mul_add.h" +#include "stdlib/complex/float32/ctor.h" +#include "stdlib/complex/float32/reim.h" + +/** +* Performs a multiply-add operation involving three single-precision complex floating-point numbers. +* +* @param alpha input value +* @param x input value +* @param y input value +* @return result +* +* @example +* #include "stdlib/complex/float32/ctor.h" +* #include "stdlib/complex/float32/real.h" +* #include "stdlib/complex/float32/imag.h" +* +* stdlib_complex64_t z1 = stdlib_complex64( 5.0, 3.0 ); +* stdlib_complex64_t z2 = stdlib_complex64( -2.0, 1.0 ); +* stdlib_complex64_t z3 = stdlib_complex64( 7.0, -8.0 ); +* +* stdlib_complex64_t out = stdlib_base_complex64_muladd( z1, z2, z3 ); +* +* float re = stdlib_complex64_real( out ); +* // returns -6.0 +* +* float im = stdlib_complex64_imag( out ); +* // returns -9.0 +*/ +stdlib_complex64_t stdlib_base_complex64_muladd( const stdlib_complex64_t alpha, const stdlib_complex64_t x, const stdlib_complex64_t y ) { + float re1; + float re2; + float re3; + float im1; + float im2; + float im3; + float re; + float im; + + stdlib_complex64_reim( alpha, &re1, &im1 ); + stdlib_complex64_reim( x, &re2, &im2 ); + stdlib_complex64_reim( y, &re3, &im3 ); + + re = (re1*re2) - (im1*im2) + re3; + im = (re1*im2) + (im1*re2) + im3; + + return stdlib_complex64( re, im ); +} diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/test/test.assign.js b/lib/node_modules/@stdlib/complex/float32/base/mul-add/test/test.assign.js new file mode 100755 index 000000000000..fef3efa28c3d --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/test/test.assign.js @@ -0,0 +1,153 @@ +/** +* @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 tape = require( 'tape' ); +var isSameFloat32Array = require( '@stdlib/assert/is-same-float32array' ); +var Float32Array = require( '@stdlib/array/float32' ); +var muladd = require( './../lib/assign.js' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof muladd, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function performs a multiply-add operation', function test( t ) { + var expected; + var out; + var v; + + out = new Float32Array( 2 ); + v = muladd( 5.0, 3.0, -2.0, 1.0, 7.0, -8.0, out, 1, 0 ); + + expected = new Float32Array( [ -6.0, -9.0 ] ); + + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + out = new Float32Array( 4 ); + v = muladd( 5.0, 3.0, -2.0, 1.0, 7.0, -8.0, out, 2, 0 ); + + expected = new Float32Array( [ -6.0, 0.0, -9.0, 0.0 ] ); + + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + out = new Float32Array( 4 ); + v = muladd( 5.0, 3.0, -2.0, 1.0, 7.0, -8.0, out, 2, 1 ); + + expected = new Float32Array( [ 0.0, -6.0, 0.0, -9.0 ] ); + + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + out = new Float32Array( 4 ); + v = muladd( 5.0, 3.0, -2.0, 1.0, 7.0, -8.0, out, -2, 3 ); + + expected = new Float32Array( [ 0.0, -9.0, 0.0, -6.0 ] ); + + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if a real or imaginary component is `NaN`, the function propagates `NaN` values', function test( t ) { + var expected; + var out; + var v; + + out = new Float32Array( 2 ); + expected = new Float32Array( [ NaN, NaN ] ); + + v = muladd( NaN, 3.0, -2.0, 1.0, 7.0, -8.0, out, 1, 0 ); + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + out = new Float32Array( 2 ); + expected = new Float32Array( [ NaN, NaN ] ); + + v = muladd( 5.0, 3.0, NaN, 1.0, 7.0, -8.0, out, 1, 0 ); + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + out = new Float32Array( 2 ); + expected = new Float32Array( [ NaN, NaN ] ); + + v = muladd( NaN, 3.0, NaN, 1.0, 7.0, -8.0, out, 1, 0 ); + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + out = new Float32Array( 2 ); + expected = new Float32Array( [ NaN, NaN ] ); + + v = muladd( 5.0, NaN, -2.0, 1.0, 7.0, -8.0, out, 1, 0 ); + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + out = new Float32Array( 2 ); + expected = new Float32Array( [ NaN, NaN ] ); + + v = muladd( 5.0, 3.0, -2.0, NaN, 7.0, -8.0, out, 1, 0 ); + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + out = new Float32Array( 2 ); + expected = new Float32Array( [ NaN, NaN ] ); + + v = muladd( 5.0, NaN, -2.0, NaN, 7.0, -8.0, out, 1, 0 ); + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + out = new Float32Array( 2 ); + expected = new Float32Array( [ NaN, NaN ] ); + + v = muladd( NaN, NaN, NaN, NaN, 7.0, -8.0, out, 1, 0 ); + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + out = new Float32Array( 2 ); + expected = new Float32Array( [ NaN, -9.0 ] ); + + v = muladd( 5.0, 3.0, -2.0, 1.0, NaN, -8.0, out, 1, 0 ); + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + out = new Float32Array( 2 ); + expected = new Float32Array( [ -6.0, NaN ] ); + + v = muladd( 5.0, 3.0, -2.0, 1.0, 7.0, NaN, out, 1, 0 ); + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + out = new Float32Array( 2 ); + expected = new Float32Array( [ NaN, NaN ] ); + + v = muladd( NaN, NaN, NaN, NaN, NaN, NaN, out, 1, 0 ); + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); \ No newline at end of file diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/test/test.js b/lib/node_modules/@stdlib/complex/float32/base/mul-add/test/test.js new file mode 100755 index 000000000000..bc451247f318 --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/test/test.js @@ -0,0 +1,46 @@ +/** +* @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 tape = require( 'tape' ); +var isMethod = require( '@stdlib/assert/is-method' ); +var muladd = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof muladd, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'attached to the main export is an `assign` method', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( isMethod( muladd, 'assign' ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'attached to the main export is a `strided` method', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( isMethod( muladd, 'strided' ), true, 'returns expected value' ); + t.end(); +}); \ No newline at end of file diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/test/test.main.js b/lib/node_modules/@stdlib/complex/float32/base/mul-add/test/test.main.js new file mode 100755 index 000000000000..c1b2c48ee4c2 --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/test/test.main.js @@ -0,0 +1,138 @@ +/** +* @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 tape = require( 'tape' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var realf = require( '@stdlib/complex/float32/real' ); +var imagf = require( '@stdlib/complex/float32/imag' ); +var muladd = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof muladd, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function performs a multiply-add operation', function test( t ) { + var z1; + var z2; + var z3; + var v; + + z1 = new Complex64( 5.0, 3.0 ); + z2 = new Complex64( -2.0, 1.0 ); + z3 = new Complex64( 7.0, -8.0 ); + + v = muladd( z1, z2, z3 ); + + t.strictEqual( realf( v ), -6.0, 'returns expected value' ); + t.strictEqual( imagf( v ), -9.0, 'returns expected value' ); + + t.end(); +}); + +tape( 'if a real or imaginary component is `NaN`, the function propagates `NaN` values', function test( t ) { + var z1; + var z2; + var z3; + var v; + + z1 = new Complex64( NaN, 3.0 ); + z2 = new Complex64( -2.0, 1.0 ); + z3 = new Complex64( 7.0, -8.0 ); + + v = muladd( z1, z2, z3 ); + t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); + t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); + + z1 = new Complex64( 5.0, 3.0 ); + z2 = new Complex64( NaN, 1.0 ); + z3 = new Complex64( 7.0, -8.0 ); + + v = muladd( z1, z2, z3 ); + t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); + t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); + + z1 = new Complex64( NaN, 3.0 ); + z2 = new Complex64( NaN, 1.0 ); + z3 = new Complex64( 7.0, -8.0 ); + + v = muladd( z1, z2, z3 ); + t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); + t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); + + z1 = new Complex64( 5.0, NaN ); + z2 = new Complex64( -2.0, 1.0 ); + z3 = new Complex64( 7.0, -8.0 ); + + v = muladd( z1, z2, z3 ); + t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); + t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); + + z1 = new Complex64( 5.0, 3.0 ); + z2 = new Complex64( -2.0, NaN ); + z3 = new Complex64( 7.0, -8.0 ); + + v = muladd( z1, z2, z3 ); + t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); + t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); + + z1 = new Complex64( 5.0, NaN ); + z2 = new Complex64( -2.0, NaN ); + z3 = new Complex64( 7.0, -8.0 ); + + v = muladd( z1, z2, z3 ); + t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); + t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); + + z1 = new Complex64( 5.0, 3.0 ); + z2 = new Complex64( -2.0, 1.0 ); + z3 = new Complex64( NaN, -8.0 ); + + v = muladd( z1, z2, z3 ); + + t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); + t.strictEqual( imagf( v ), -9.0, 'returns expected value' ); + + z1 = new Complex64( 5.0, 3.0 ); + z2 = new Complex64( -2.0, 1.0 ); + z3 = new Complex64( 7.0, NaN ); + + v = muladd( z1, z2, z3 ); + + t.strictEqual( realf( v ), -6.0, 'returns expected value' ); + t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); + + z1 = new Complex64( NaN, NaN ); + z2 = new Complex64( NaN, NaN ); + z3 = new Complex64( 7.0, -8.0 ); + + v = muladd( z1, z2, z3 ); + t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); + t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); + + t.end(); +}); \ No newline at end of file diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/test/test.native.js b/lib/node_modules/@stdlib/complex/float32/base/mul-add/test/test.native.js new file mode 100755 index 000000000000..4f3e4bf377cf --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/test/test.native.js @@ -0,0 +1,147 @@ +/** +* @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 resolve = require( 'path' ).resolve; +var tape = require( 'tape' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var realf = require( '@stdlib/complex/float32/real' ); +var imagf = require( '@stdlib/complex/float32/imag' ); +var tryRequire = require( '@stdlib/utils/try-require' ); + + +// VARIABLES // + +var muladd = tryRequire( resolve( __dirname, './../lib/native.js' ) ); +var opts = { + 'skip': ( muladd instanceof Error ) +}; + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof muladd, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function performs a multiply-add operation', opts, function test( t ) { + var z1; + var z2; + var z3; + var v; + + z1 = new Complex64( 5.0, 3.0 ); + z2 = new Complex64( -2.0, 1.0 ); + z3 = new Complex64( 7.0, -8.0 ); + + v = muladd( z1, z2, z3 ); + + t.strictEqual( realf( v ), -6.0, 'returns expected value' ); + t.strictEqual( imagf( v ), -9.0, 'returns expected value' ); + + t.end(); +}); + +tape( 'if a real or imaginary component is `NaN`, the function propagates `NaN` values', opts, function test( t ) { + var z1; + var z2; + var z3; + var v; + + z1 = new Complex64( NaN, 3.0 ); + z2 = new Complex64( -2.0, 1.0 ); + z3 = new Complex64( 7.0, -8.0 ); + + v = muladd( z1, z2, z3 ); + t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); + t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); + + z1 = new Complex64( 5.0, 3.0 ); + z2 = new Complex64( NaN, 1.0 ); + z3 = new Complex64( 7.0, -8.0 ); + + v = muladd( z1, z2, z3 ); + t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); + t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); + + z1 = new Complex64( NaN, 3.0 ); + z2 = new Complex64( NaN, 1.0 ); + z3 = new Complex64( 7.0, -8.0 ); + + v = muladd( z1, z2, z3 ); + t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); + t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); + + z1 = new Complex64( 5.0, NaN ); + z2 = new Complex64( -2.0, 1.0 ); + z3 = new Complex64( 7.0, -8.0 ); + + v = muladd( z1, z2, z3 ); + t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); + t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); + + z1 = new Complex64( 5.0, 3.0 ); + z2 = new Complex64( -2.0, NaN ); + z3 = new Complex64( 7.0, -8.0 ); + + v = muladd( z1, z2, z3 ); + t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); + t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); + + z1 = new Complex64( 5.0, NaN ); + z2 = new Complex64( -2.0, NaN ); + z3 = new Complex64( 7.0, -8.0 ); + + v = muladd( z1, z2, z3 ); + t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); + t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); + + z1 = new Complex64( 5.0, 3.0 ); + z2 = new Complex64( -2.0, 1.0 ); + z3 = new Complex64( NaN, -8.0 ); + + v = muladd( z1, z2, z3 ); + + t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); + t.strictEqual( imagf( v ), -9.0, 'returns expected value' ); + + z1 = new Complex64( 5.0, 3.0 ); + z2 = new Complex64( -2.0, 1.0 ); + z3 = new Complex64( 7.0, NaN ); + + v = muladd( z1, z2, z3 ); + + t.strictEqual( realf( v ), -6.0, 'returns expected value' ); + t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); + + z1 = new Complex64( NaN, NaN ); + z2 = new Complex64( NaN, NaN ); + z3 = new Complex64( 7.0, -8.0 ); + + v = muladd( z1, z2, z3 ); + t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); + t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); + + t.end(); +}); \ No newline at end of file diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/test/test.strided.js b/lib/node_modules/@stdlib/complex/float32/base/mul-add/test/test.strided.js new file mode 100755 index 000000000000..7546a78a5053 --- /dev/null +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/test/test.strided.js @@ -0,0 +1,212 @@ + +/** +* @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 tape = require( 'tape' ); +var isSameFloat32Array = require( '@stdlib/assert/is-same-float32array' ); +var Float32Array = require( '@stdlib/array/float32' ); +var muladd = require( './../lib/strided.js' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof muladd, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function performs a multiply-add operation', function test( t ) { + var expected; + var out; + var z1; + var z2; + var z3; + var v; + + z1 = new Float32Array( [ 5.0, 3.0 ] ); + z2 = new Float32Array( [ -2.0, 1.0 ] ); + z3 = new Float32Array( [ 7.0, -8.0 ] ); + out = new Float32Array( 2 ); + v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); + + expected = new Float32Array( [ -6.0, -9.0 ] ); + + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + z1 = new Float32Array( [ 5.0, 0.0, 3.0, 0.0 ] ); + z2 = new Float32Array( [ -2.0, 1.0 ] ); + z3 = new Float32Array( [ 7.0, -8.0 ] ); + out = new Float32Array( 4 ); + v = muladd( z1, 2, 0, z2, 1, 0, z3, 1, 0, out, 2, 0 ); + + expected = new Float32Array( [ -6.0, 0.0, -9.0, 0.0 ] ); + + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + z1 = new Float32Array( [ 5.0, 3.0 ] ); + z2 = new Float32Array( [ 0.0, -2.0, 0.0, 1.0 ] ); + z3 = new Float32Array( [ 7.0, -8.0 ] ); + out = new Float32Array( 4 ); + v = muladd( z1, 1, 0, z2, 2, 1, z3, 1, 0, out, 2, 1 ); + + expected = new Float32Array( [ 0.0, -6.0, 0.0, -9.0 ] ); + + z1 = new Float32Array( [ 5.0, 3.0 ] ); + z2 = new Float32Array( [ -2.0, 1.0 ] ); + z3 = new Float32Array( [ 0.0, 7.0, 0.0, -8.0 ] ); + out = new Float32Array( 2 ); + v = muladd( z1, 1, 0, z2, 1, 0, z3, 2, 1, out, 1, 0 ); + + expected = new Float32Array( [ -6.0, -9.0 ] ); + + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + z1 = new Float32Array( [ 3.0, 5.0 ] ); + z2 = new Float32Array( [ 1.0, -2.0 ] ); + z3 = new Float32Array( [ -8.0, 7.0 ] ); + out = new Float32Array( 4 ); + v = muladd( z1, -1, 1, z2, -1, 1, z3, -1, 1, out, -2, 3 ); + + expected = new Float32Array( [ 0.0, -9.0, 0.0, -6.0 ] ); + + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if a real or imaginary component is `NaN`, the function propagates `NaN` values', function test( t ) { + var expected; + var out; + var z1; + var z2; + var z3; + var v; + + z1 = new Float32Array( [ NaN, 3.0 ] ); + z2 = new Float32Array( [ -2.0, 1.0 ] ); + z3 = new Float32Array( [ 7.0, -8.0 ] ); + out = new Float32Array( 2 ); + expected = new Float32Array( [ NaN, NaN ] ); + + v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + z1 = new Float32Array( [ 5.0, 3.0 ] ); + z2 = new Float32Array( [ NaN, 1.0 ] ); + z3 = new Float32Array( [ 7.0, -8.0 ] ); + out = new Float32Array( 2 ); + expected = new Float32Array( [ NaN, NaN ] ); + + v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + z1 = new Float32Array( [ NaN, 3.0 ] ); + z2 = new Float32Array( [ NaN, 1.0 ] ); + z3 = new Float32Array( [ 7.0, -8.0 ] ); + out = new Float32Array( 2 ); + expected = new Float32Array( [ NaN, NaN ] ); + + v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + z1 = new Float32Array( [ 5.0, NaN ] ); + z2 = new Float32Array( [ -2.0, 1.0 ] ); + z3 = new Float32Array( [ 7.0, -8.0 ] ); + out = new Float32Array( 2 ); + expected = new Float32Array( [ NaN, NaN ] ); + + v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + z1 = new Float32Array( [ 5.0, 3.0 ] ); + z2 = new Float32Array( [ -2.0, NaN ] ); + z3 = new Float32Array( [ 7.0, -8.0 ] ); + out = new Float32Array( 2 ); + expected = new Float32Array( [ NaN, NaN ] ); + + v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + z1 = new Float32Array( [ 5.0, NaN ] ); + z2 = new Float32Array( [ -2.0, NaN ] ); + z3 = new Float32Array( [ 7.0, -8.0 ] ); + out = new Float32Array( 2 ); + expected = new Float32Array( [ NaN, NaN ] ); + + v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + z1 = new Float32Array( [ NaN, NaN ] ); + z2 = new Float32Array( [ NaN, NaN ] ); + z3 = new Float32Array( [ 7.0, -8.0 ] ); + out = new Float32Array( 2 ); + expected = new Float32Array( [ NaN, NaN ] ); + + v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + z1 = new Float32Array( [ 5.0, 3.0 ] ); + z2 = new Float32Array( [ -2.0, 1.0 ] ); + z3 = new Float32Array( [ NaN, -8.0 ] ); + out = new Float32Array( 2 ); + v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); + + expected = new Float32Array( [ NaN, -9.0 ] ); + + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + z1 = new Float32Array( [ 5.0, 3.0 ] ); + z2 = new Float32Array( [ -2.0, 1.0 ] ); + z3 = new Float32Array( [ 7.0, NaN ] ); + out = new Float32Array( 2 ); + v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); + + expected = new Float32Array( [ -6.0, NaN ] ); + + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + z1 = new Float32Array( [ NaN, NaN ] ); + z2 = new Float32Array( [ NaN, NaN ] ); + z3 = new Float32Array( [ NaN, NaN ] ); + out = new Float32Array( 2 ); + expected = new Float32Array( [ NaN, NaN ] ); + + v = muladd( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0 ); + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); From 3891490f6be9c7a882b5c5500d630edad4d197e2 Mon Sep 17 00:00:00 2001 From: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> Date: Thu, 13 Feb 2025 19:35:45 +0000 Subject: [PATCH 02/15] fix: resolve lint errors --- lib/node_modules/@stdlib/complex/float32/base/mul-add/README.md | 0 .../complex/float32/base/mul-add/benchmark/benchmark.assign.js | 2 +- .../@stdlib/complex/float32/base/mul-add/benchmark/benchmark.js | 2 +- .../complex/float32/base/mul-add/benchmark/benchmark.native.js | 2 +- .../complex/float32/base/mul-add/benchmark/benchmark.strided.js | 2 +- .../complex/float32/base/mul-add/benchmark/c/benchmark.c | 2 +- .../complex/float32/base/mul-add/benchmark/c/native/benchmark.c | 2 +- .../complex/float32/base/mul-add/benchmark/julia/benchmark.jl | 2 +- .../@stdlib/complex/float32/base/mul-add/docs/types/index.d.ts | 2 +- .../@stdlib/complex/float32/base/mul-add/docs/types/test.ts | 2 +- .../@stdlib/complex/float32/base/mul-add/examples/c/example.c | 2 +- .../@stdlib/complex/float32/base/mul-add/examples/index.js | 2 +- .../@stdlib/complex/float32/base/mul-add/include.gypi | 2 +- .../base/mul-add/include/stdlib/complex/float32/base/mul_add.h | 2 +- .../@stdlib/complex/float32/base/mul-add/lib/native.js | 2 +- .../@stdlib/complex/float32/base/mul-add/lib/strided.js | 2 +- .../@stdlib/complex/float32/base/mul-add/manifest.json | 2 +- .../@stdlib/complex/float32/base/mul-add/package.json | 2 +- .../@stdlib/complex/float32/base/mul-add/src/addon.c | 2 +- .../@stdlib/complex/float32/base/mul-add/test/test.assign.js | 2 +- .../@stdlib/complex/float32/base/mul-add/test/test.js | 2 +- .../@stdlib/complex/float32/base/mul-add/test/test.main.js | 2 +- .../@stdlib/complex/float32/base/mul-add/test/test.native.js | 2 +- 23 files changed, 22 insertions(+), 22 deletions(-) mode change 100755 => 100644 lib/node_modules/@stdlib/complex/float32/base/mul-add/README.md diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/README.md b/lib/node_modules/@stdlib/complex/float32/base/mul-add/README.md old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.assign.js b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.assign.js index accd17f7bc60..c6d175ecb6b7 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.assign.js +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.assign.js @@ -67,4 +67,4 @@ bench( pkg+':assign', function benchmark( b ) { } b.pass( 'benchmark finished' ); b.end(); -}); \ No newline at end of file +}); diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.js b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.js index 150473f5ec38..135b2774b4fa 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.js @@ -57,4 +57,4 @@ bench( pkg, function benchmark( b ) { } b.pass( 'benchmark finished' ); b.end(); -}); \ No newline at end of file +}); diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.native.js index 28683eccd60a..22819fe17748 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.native.js @@ -66,4 +66,4 @@ bench( pkg+'::native', opts, function benchmark( b ) { } b.pass( 'benchmark finished' ); b.end(); -}); \ No newline at end of file +}); diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.strided.js b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.strided.js index 468507c41b15..540e645d8ef7 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.strided.js +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/benchmark.strided.js @@ -65,4 +65,4 @@ bench( pkg+':strided', function benchmark( b ) { } b.pass( 'benchmark finished' ); b.end(); -}); \ No newline at end of file +}); diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/benchmark.c index c0c5bbc15d18..34ddd87553e3 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/benchmark.c @@ -148,4 +148,4 @@ int main( void ) { printf( "ok %d benchmark finished\n", i+1 ); } print_summary( REPEATS, REPEATS ); -} \ No newline at end of file +} diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/native/benchmark.c index e5d0c7d29dde..6734767977fc 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/native/benchmark.c @@ -150,4 +150,4 @@ int main( void ) { printf( "ok %d benchmark finished\n", i+1 ); } print_summary( REPEATS, REPEATS ); -} \ No newline at end of file +} diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/julia/benchmark.jl b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/julia/benchmark.jl index e98b5ff8a2f1..51cb4fb761ce 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/julia/benchmark.jl +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/julia/benchmark.jl @@ -141,4 +141,4 @@ function main() print_summary( repeats, repeats ); end -main(); \ No newline at end of file +main(); diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/docs/types/index.d.ts b/lib/node_modules/@stdlib/complex/float32/base/mul-add/docs/types/index.d.ts index 21ec93b8115b..0fc27641b291 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/docs/types/index.d.ts @@ -174,4 +174,4 @@ declare var muladd: MulAdd; // EXPORTS // -export = muladd; \ No newline at end of file +export = muladd; diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/docs/types/test.ts b/lib/node_modules/@stdlib/complex/float32/base/mul-add/docs/types/test.ts index 21ce204317cd..f2988ff45bae 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/docs/types/test.ts +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/docs/types/test.ts @@ -462,4 +462,4 @@ import muladd = require( './index' ); muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out ); // $ExpectError muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1 ); // $ExpectError muladd.strided( z1, 1, 0, z2, 1, 0, z3, 1, 0, out, 1, 0, {} ); // $ExpectError -} \ No newline at end of file +} diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/c/example.c b/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/c/example.c index 7ae4fefa8be6..8a5916193402 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/c/example.c +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/c/example.c @@ -43,4 +43,4 @@ int main( void ) { stdlib_complex64_reim( y, &re, &im ); printf( "z*z + z = %f + %fi\n", re, im ); } -} \ No newline at end of file +} diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/index.js b/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/index.js index cd83f3ce7184..d3eb89706725 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/index.js +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/index.js @@ -33,4 +33,4 @@ for ( i = 0; i < 100; i++ ) { z2 = new Complex64( rand(), rand() ); z3 = muladd( z1, z2, z2 ); console.log( '(%s)*(%s) + (%s) = %s', z1.toString(), z2.toString(), z2.toString(), z3.toString() ); -} \ No newline at end of file +} diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/include.gypi b/lib/node_modules/@stdlib/complex/float32/base/mul-add/include.gypi index f6557ac1ab57..ecfaf82a3279 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/include.gypi +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/include.gypi @@ -50,4 +50,4 @@ ' Date: Fri, 14 Feb 2025 17:33:32 +0530 Subject: [PATCH 03/15] fix: update main.c Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/complex/float32/base/mul-add/src/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/src/main.c b/lib/node_modules/@stdlib/complex/float32/base/mul-add/src/main.c index 26a9d6074f0b..b02c26f0b590 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/src/main.c +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/src/main.c @@ -45,6 +45,7 @@ * float im = stdlib_complex64_imag( out ); * // returns -9.0 */ +stdlib_complex64_t stdlib_base_complex64_muladd( const stdlib_complex64_t alpha, const stdlib_complex64_t x, const stdlib_complex64_t y ); stdlib_complex64_t stdlib_base_complex64_muladd( const stdlib_complex64_t alpha, const stdlib_complex64_t x, const stdlib_complex64_t y ) { float re1; float re2; From 5f425b3967b299c8c3c07783fc71ebeda8201f8f Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Fri, 14 Feb 2025 17:37:14 +0530 Subject: [PATCH 04/15] fix: update main.c Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/complex/float32/base/mul-add/src/main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/src/main.c b/lib/node_modules/@stdlib/complex/float32/base/mul-add/src/main.c index b02c26f0b590..26a9d6074f0b 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/src/main.c +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/src/main.c @@ -45,7 +45,6 @@ * float im = stdlib_complex64_imag( out ); * // returns -9.0 */ -stdlib_complex64_t stdlib_base_complex64_muladd( const stdlib_complex64_t alpha, const stdlib_complex64_t x, const stdlib_complex64_t y ); stdlib_complex64_t stdlib_base_complex64_muladd( const stdlib_complex64_t alpha, const stdlib_complex64_t x, const stdlib_complex64_t y ) { float re1; float re2; From 3f5ea70898777bd7b2aac08f8e4f04da4462e8d0 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Sun, 2 Mar 2025 12:07:54 +0530 Subject: [PATCH 05/15] fix: errors test.native.js --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: passed --- --- .../@stdlib/complex/float32/base/mul-add/test/test.native.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/test/test.native.js b/lib/node_modules/@stdlib/complex/float32/base/mul-add/test/test.native.js index 682aff8c8232..aad47a122850 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/test/test.native.js +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/test/test.native.js @@ -31,7 +31,7 @@ var tryRequire = require( '@stdlib/utils/try-require' ); // VARIABLES // -var muladd = tryRequire( resolve( __dirname, './../lib/native.js' ) ); +var muladd = tryRequire( resolve( __dirname, './../native.js' ) ); var opts = { 'skip': ( muladd instanceof Error ) }; From a7b914d027de1fb64d6e3fc969377dda9878d0db Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Sun, 2 Mar 2025 12:09:14 +0530 Subject: [PATCH 06/15] fix: errors test.native.js --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: passed --- --- .../@stdlib/complex/float32/base/mul-add/test/test.native.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/test/test.native.js b/lib/node_modules/@stdlib/complex/float32/base/mul-add/test/test.native.js index aad47a122850..682aff8c8232 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/test/test.native.js +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/test/test.native.js @@ -31,7 +31,7 @@ var tryRequire = require( '@stdlib/utils/try-require' ); // VARIABLES // -var muladd = tryRequire( resolve( __dirname, './../native.js' ) ); +var muladd = tryRequire( resolve( __dirname, './../lib/native.js' ) ); var opts = { 'skip': ( muladd instanceof Error ) }; From 3b630e86a4857945ec876dce31816c9667e6a4d4 Mon Sep 17 00:00:00 2001 From: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> Date: Sun, 2 Mar 2025 07:17:30 +0000 Subject: [PATCH 07/15] fix: resolve lint errors --- .../@stdlib/complex/float32/base/mul-add/benchmark/c/Makefile | 2 +- .../complex/float32/base/mul-add/benchmark/c/native/Makefile | 2 +- .../@stdlib/complex/float32/base/mul-add/binding.gyp | 2 +- .../@stdlib/complex/float32/base/mul-add/examples/c/Makefile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/Makefile b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/Makefile index b676a7e9919e..85a01e54fdaf 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/Makefile +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/Makefile @@ -123,4 +123,4 @@ run: $(c_targets) clean: $(QUIET) -rm -f *.o *.out -.PHONY: clean \ No newline at end of file +.PHONY: clean diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/native/Makefile b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/native/Makefile index 1af409fc66b0..a4bd7b38fd74 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/native/Makefile +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/c/native/Makefile @@ -143,4 +143,4 @@ run: $(c_targets) clean: $(QUIET) -rm -f *.o *.out -.PHONY: clean \ No newline at end of file +.PHONY: clean diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/binding.gyp b/lib/node_modules/@stdlib/complex/float32/base/mul-add/binding.gyp index 009bb9da333a..68a1ca11d160 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/binding.gyp +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/binding.gyp @@ -167,4 +167,4 @@ ], # end actions }, # end target copy_addon ], # end targets -} \ No newline at end of file +} diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/c/Makefile b/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/c/Makefile index 73bb9ed0b748..25ced822f96a 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/c/Makefile +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/c/Makefile @@ -143,4 +143,4 @@ run: $(c_targets) clean: $(QUIET) -rm -f *.o *.out -.PHONY: clean \ No newline at end of file +.PHONY: clean From a6cd78a9443b2ce71eed93f0992bc8be3bda4c4f Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Sun, 2 Mar 2025 13:00:37 +0530 Subject: [PATCH 08/15] fix: errors julia/REQUIRE --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- .../complex/float32/base/mul-add/benchmark/julia/REQUIRE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/julia/REQUIRE b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/julia/REQUIRE index 67d3b068ca18..98645e192e41 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/julia/REQUIRE +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/benchmark/julia/REQUIRE @@ -1,2 +1,2 @@ julia 1.5 -BenchmarkTools 0.5.0 \ No newline at end of file +BenchmarkTools 0.5.0 From 33d354b1e649c5797108b0027b9a904c7920257c Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Sun, 2 Mar 2025 13:28:16 +0530 Subject: [PATCH 09/15] fix: error in package.json --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: passed - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- .../@stdlib/complex/float32/base/mul-add/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/package.json b/lib/node_modules/@stdlib/complex/float32/base/mul-add/package.json index 21e72b7fe264..118f012f9f1a 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/package.json +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/package.json @@ -68,3 +68,4 @@ "number" ] } + From 7be66b83d2fb28971015d34d8880f16ddf41811b Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Sun, 2 Mar 2025 20:35:49 +0530 Subject: [PATCH 10/15] fix: package.json errors --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: passed - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- .../@stdlib/complex/float32/base/mul-add/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/package.json b/lib/node_modules/@stdlib/complex/float32/base/mul-add/package.json index 118f012f9f1a..21e72b7fe264 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/package.json +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/package.json @@ -68,4 +68,3 @@ "number" ] } - From 1a37b5d0bda821c3702f43d5c889701afafe2ba8 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Sun, 2 Mar 2025 20:42:56 +0530 Subject: [PATCH 11/15] fix: package.json errors --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: passed - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- .../complex/float32/base/mul-add/package.json | 134 +++++++++--------- 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/package.json b/lib/node_modules/@stdlib/complex/float32/base/mul-add/package.json index 21e72b7fe264..ccbee092a030 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/package.json +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/package.json @@ -1,70 +1,70 @@ { - "name": "@stdlib/complex/float32/base/muladd", - "version": "0.0.0", - "description": "Perform a multiply-add operation involving three single-precision complex floating-point numbers.", - "license": "Apache-2.0", - "author": { + "name": "@stdlib/complex/float32/base/muladd", + "version": "0.0.0", + "description": "Perform a multiply-add operation involving three single-precision complex floating-point numbers.", + "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" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "gypfile": true, - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "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", - "mul", - "mult", - "multiply", - "multiplication", - "addition", - "add", - "arithmetic", - "complex", - "cmplx", - "number" - ] - } + } + ], + "main": "./lib", + "gypfile": true, + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "include": "./include", + "lib": "./lib", + "src": "./src", + "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", + "mul", + "mult", + "multiply", + "multiplication", + "addition", + "add", + "arithmetic", + "complex", + "cmplx", + "number" + ] +} From 77ffe6cda398e8a8bda74ed28519b423dbb77824 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Mon, 2 Jun 2025 23:31:26 +0530 Subject: [PATCH 12/15] chore: update implementation --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../complex/float32/base/mul-add/README.md | 23 ++++++++----------- .../float32/base/mul-add/examples/index.js | 21 +++++++---------- .../float32/base/mul-add/lib/assign.js | 6 ++--- .../complex/float32/base/mul-add/lib/main.js | 6 ++--- .../float32/base/mul-add/lib/strided.js | 6 ++--- 5 files changed, 26 insertions(+), 36 deletions(-) diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/README.md b/lib/node_modules/@stdlib/complex/float32/base/mul-add/README.md index e866c20c900c..63b8b2e5b3aa 100644 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/README.md +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/README.md @@ -138,22 +138,17 @@ The function supports the following parameters: ```javascript -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +var Complex64Array = require( '@stdlib/array/complex64' ); +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var logEachMap = require( '@stdlib/console/log-each-map' ); var muladd = require( '@stdlib/complex/float32/base/mul-add' ); -var rand = discreteUniform( -50, 50 ); - -var z1; -var z2; -var z3; -var i; -for ( i = 0; i < 100; i++ ) { - z1 = new Complex64( rand(), rand() ); - z2 = new Complex64( rand(), rand() ); - z3 = muladd( z1, z2, z2 ); - console.log( '(%s)*(%s) + (%s) = %s', z1.toString(), z2.toString(), z2.toString(), z3.toString() ); -} +// Generate an array of random values: +var z1 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); +var z2 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); + +// Scale each by a scalar constant: +logEachMap( '(%s) * (%s) = %s', z1, z2, muladd ); ``` diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/index.js b/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/index.js index d3eb89706725..5468d662e241 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/index.js +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/index.js @@ -18,19 +18,14 @@ 'use strict'; -var Complex64 = require( '@stdlib/complex/float32/ctor' ); -var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +var Complex64Array = require( '@stdlib/array/complex64' ); +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var logEachMap = require( '@stdlib/console/log-each-map' ); var muladd = require( './../lib' ); -var rand = discreteUniform( -50, 50 ); +// Generate an array of random values: +var z1 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); +var z2 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); -var z1; -var z2; -var z3; -var i; -for ( i = 0; i < 100; i++ ) { - z1 = new Complex64( rand(), rand() ); - z2 = new Complex64( rand(), rand() ); - z3 = muladd( z1, z2, z2 ); - console.log( '(%s)*(%s) + (%s) = %s', z1.toString(), z2.toString(), z2.toString(), z3.toString() ); -} +// Scale each by a scalar constant: +logEachMap( '(%s) * (%s) = %s', z1, z2, muladd ); diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/lib/assign.js b/lib/node_modules/@stdlib/complex/float32/base/mul-add/lib/assign.js index 01c262549c4e..0f61642039cf 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/lib/assign.js +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/lib/assign.js @@ -20,7 +20,7 @@ // MODULES // -var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +var f32 = require( '@stdlib/number/float64/base/to-float32' ); // MAIN // @@ -46,8 +46,8 @@ var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); * // returns [ -6.0, -9.0 ] */ function assign( ar, ai, xr, xi, yr, yi, out, strideOut, offsetOut ) { - out[ offsetOut ] = float64ToFloat32( float64ToFloat32(ar*xr) - float64ToFloat32(ai*xi) + yr ); - out[ offsetOut+strideOut ] = float64ToFloat32( float64ToFloat32(ar*xi) + float64ToFloat32(ai*xr) + yi ); + out[ offsetOut ] = f32( f32(ar*xr) - f32(ai*xi) + yr ); + out[ offsetOut+strideOut ] = f32( f32(ar*xi) + f32(ai*xr) + yi ); return out; } diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/lib/main.js b/lib/node_modules/@stdlib/complex/float32/base/mul-add/lib/main.js index 473a7d79813e..9a1d83552b1b 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/lib/main.js +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/lib/main.js @@ -23,7 +23,7 @@ var Complex64 = require( '@stdlib/complex/float32/ctor' ); var realf = require( '@stdlib/complex/float32/real' ); var imagf = require( '@stdlib/complex/float32/imag' ); -var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +var f32 = require( '@stdlib/number/float64/base/to-float32' ); // MAIN // @@ -66,8 +66,8 @@ function muladd( alpha, x, y ) { var im1 = imagf( x ); var re2 = realf( y ); var im2 = imagf( y ); - var re = float64ToFloat32( float64ToFloat32(re0*re1) - float64ToFloat32(im0*im1) + re2 ); - var im = float64ToFloat32( float64ToFloat32(re0*im1) + float64ToFloat32(im0*re1) + im2 ); + var re = f32( f32(re0*re1) - f32(im0*im1) + re2 ); + var im = f32( f32(re0*im1) + f32(im0*re1) + im2 ); return new Complex64( re, im ); } diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/lib/strided.js b/lib/node_modules/@stdlib/complex/float32/base/mul-add/lib/strided.js index 4634a5b3d770..1f752a66f8bd 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/lib/strided.js +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/lib/strided.js @@ -20,7 +20,7 @@ // MODULES // -var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +var f32 = require( '@stdlib/number/float64/base/to-float32' ); // MAIN // @@ -59,8 +59,8 @@ function strided( alpha, strideA, offsetA, x, strideX, offsetX, y, strideY, offs var im1 = x[ offsetX+strideX ]; var re2 = y[ offsetY ]; var im2 = y[ offsetY+strideY ]; - out[ offsetOut ] = float64ToFloat32( float64ToFloat32(re0*re1) - float64ToFloat32(im0*im1) + re2 ); - out[ offsetOut+strideOut ] = float64ToFloat32( float64ToFloat32(re0*im1) + float64ToFloat32(im0*re1) + im2 ); + out[ offsetOut ] = f32( f32(re0*re1) - f32(im0*im1) + re2 ); + out[ offsetOut+strideOut ] = f32( f32(re0*im1) + f32(im0*re1) + im2 ); return out; } From 451c35e0f54936b3bf782ad9075a3aeb89632356 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Mon, 2 Jun 2025 23:38:29 +0530 Subject: [PATCH 13/15] chore: update implementation --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/complex/float32/base/mul-add/README.md | 7 ++++--- .../@stdlib/complex/float32/base/mul-add/examples/index.js | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/README.md b/lib/node_modules/@stdlib/complex/float32/base/mul-add/README.md index 63b8b2e5b3aa..9b46dd84f70e 100644 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/README.md +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/README.md @@ -143,12 +143,13 @@ var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); var logEachMap = require( '@stdlib/console/log-each-map' ); var muladd = require( '@stdlib/complex/float32/base/mul-add' ); -// Generate an array of random values: +// Generate arrays of random values: var z1 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); var z2 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); +var z3 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); -// Scale each by a scalar constant: -logEachMap( '(%s) * (%s) = %s', z1, z2, muladd ); +// Perform multiplication and addition on each: +logEachMap( '( (%s) * (%s) ) + (%s) = %s', z1, z2, z3, muladd ); ``` diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/index.js b/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/index.js index 5468d662e241..96efc5f740d3 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/index.js +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/index.js @@ -23,9 +23,10 @@ var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); var logEachMap = require( '@stdlib/console/log-each-map' ); var muladd = require( './../lib' ); -// Generate an array of random values: +// Generate arrays of random values: var z1 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); var z2 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); +var z3 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); -// Scale each by a scalar constant: -logEachMap( '(%s) * (%s) = %s', z1, z2, muladd ); +// Perform multiplication and addition on each: +logEachMap( '( (%s) * (%s) ) + (%s) = %s', z1, z2, z3, muladd ); From f1b2a207f6cb7e77200532f053638bcaa866b9ab Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Tue, 3 Jun 2025 11:31:11 +0530 Subject: [PATCH 14/15] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- .../@stdlib/complex/float32/base/mul-add/examples/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/index.js b/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/index.js index 96efc5f740d3..30473789fcae 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/index.js +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/examples/index.js @@ -28,5 +28,5 @@ var z1 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); var z2 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); var z3 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); -// Perform multiplication and addition on each: +// Perform element-wise computation: logEachMap( '( (%s) * (%s) ) + (%s) = %s', z1, z2, z3, muladd ); From cad8de3875445274ea4ff74a17a2683a74d254c9 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Tue, 3 Jun 2025 11:32:07 +0530 Subject: [PATCH 15/15] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/complex/float32/base/mul-add/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul-add/README.md b/lib/node_modules/@stdlib/complex/float32/base/mul-add/README.md index 9b46dd84f70e..2dc2d9b06ecb 100644 --- a/lib/node_modules/@stdlib/complex/float32/base/mul-add/README.md +++ b/lib/node_modules/@stdlib/complex/float32/base/mul-add/README.md @@ -148,7 +148,7 @@ var z1 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); var z2 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); var z3 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); -// Perform multiplication and addition on each: +// Perform element-wise computation: logEachMap( '( (%s) * (%s) ) + (%s) = %s', z1, z2, z3, muladd ); ```