From e8f770fe0841054272959ec8f2db519aeb28f703 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Mon, 2 Jun 2025 12:54:53 +0530 Subject: [PATCH 1/4] docs: change package naming and examples --- 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: 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 --- --- .../float32/base/mul/examples/index.js | 23 ++++++++----------- .../complex/float32/base/mul/lib/assign.js | 6 ++--- .../complex/float32/base/mul/lib/main.js | 8 +++---- .../complex/float32/base/mul/lib/strided.js | 6 ++--- 4 files changed, 19 insertions(+), 24 deletions(-) diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul/examples/index.js b/lib/node_modules/@stdlib/complex/float32/base/mul/examples/index.js index 2fa7dba68fad..1b9b46794fa8 100644 --- a/lib/node_modules/@stdlib/complex/float32/base/mul/examples/index.js +++ b/lib/node_modules/@stdlib/complex/float32/base/mul/examples/index.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2021 The Stdlib Authors. +* 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. @@ -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 mul = require( './../lib' ); -var rand = discreteUniform( -50, 50 ); +// Generate arrays 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 = mul( z1, z2 ); - console.log( '(%s) * (%s) = %s', z1.toString(), z2.toString(), z3.toString() ); -} +// Scale each by a scalar constant: +logEachMap( '(%s) * (%s) = %s', z1, z2, mul ); diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul/lib/assign.js b/lib/node_modules/@stdlib/complex/float32/base/mul/lib/assign.js index e5e1d698fd6e..d12b91314b6e 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul/lib/assign.js +++ b/lib/node_modules/@stdlib/complex/float32/base/mul/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 // @@ -44,8 +44,8 @@ var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); * // returns [ -13.0, -1.0 ] */ function assign( re1, im1, re2, im2, out, strideOut, offsetOut ) { - out[ offsetOut ] = float64ToFloat32(re1*re2) - float64ToFloat32(im1*im2); - out[ offsetOut+strideOut ] = float64ToFloat32(re1*im2) + float64ToFloat32(im1*re2); + out[ offsetOut ] = f32(re1*re2) - f32(im1*im2); + out[ offsetOut+strideOut ] = f32(re1*im2) + f32(im1*re2); return out; } diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul/lib/main.js b/lib/node_modules/@stdlib/complex/float32/base/mul/lib/main.js index 928877f685ca..e0b456db0f97 100644 --- a/lib/node_modules/@stdlib/complex/float32/base/mul/lib/main.js +++ b/lib/node_modules/@stdlib/complex/float32/base/mul/lib/main.js @@ -20,7 +20,7 @@ // MODULES // -var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +var f32 = require( '@stdlib/number/float64/base/to-float32' ); var Complex64 = require( '@stdlib/complex/float32/ctor' ); var realf = require( '@stdlib/complex/float32/real' ); var imagf = require( '@stdlib/complex/float32/imag' ); @@ -60,9 +60,9 @@ function mul( z1, z2 ) { var re2 = realf( z2 ); var im1 = imagf( z1 ); var im2 = imagf( z2 ); - var re = float64ToFloat32(re1*re2) - float64ToFloat32(im1*im2); - var im = float64ToFloat32(re1*im2) + float64ToFloat32(im1*re2); - return new Complex64( float64ToFloat32( re ), float64ToFloat32( im ) ); + var re = f32(re1*re2) - f32(im1*im2); + var im = f32(re1*im2) + f32(im1*re2); + return new Complex64( f32( re ), f32( im ) ); } diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul/lib/strided.js b/lib/node_modules/@stdlib/complex/float32/base/mul/lib/strided.js index 3d4f6cf188be..990ee894fe7c 100755 --- a/lib/node_modules/@stdlib/complex/float32/base/mul/lib/strided.js +++ b/lib/node_modules/@stdlib/complex/float32/base/mul/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 // @@ -53,8 +53,8 @@ function strided( z1, strideZ1, offsetZ1, z2, strideZ2, offsetZ2, out, strideOut var im1 = z1[ offsetZ1+strideZ1 ]; var re2 = z2[ offsetZ2 ]; var im2 = z2[ offsetZ2+strideZ2 ]; - out[ offsetOut ] = float64ToFloat32(re1*re2) - float64ToFloat32(im1*im2); - out[ offsetOut+strideOut ] = float64ToFloat32(re1*im2) + float64ToFloat32(im1*re2); + out[ offsetOut ] = f32(re1*re2) - f32(im1*im2); + out[ offsetOut+strideOut ] = f32(re1*im2) + f32(im1*re2); return out; } From 80fde06e54da4df980dba865a28a0e558fd69a8e Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Mon, 2 Jun 2025 22:43:02 +0530 Subject: [PATCH 2/4] 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: 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 --- --- .../complex/float32/base/mul/README.md | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul/README.md b/lib/node_modules/@stdlib/complex/float32/base/mul/README.md index c0f8548f2f07..b08b09f13651 100644 --- a/lib/node_modules/@stdlib/complex/float32/base/mul/README.md +++ b/lib/node_modules/@stdlib/complex/float32/base/mul/README.md @@ -124,22 +124,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 mul = require( '@stdlib/complex/float32/base/mul' ); -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 = mul( z1, z2 ); - console.log( '(%s) * (%s) = %s', z1.toString(), z2.toString(), z3.toString() ); -} +// Generate arrays 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, mul ); ``` From adde591fb78579cae854326b1a7ef63e79ba52e9 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Mon, 2 Jun 2025 23:45:29 +0530 Subject: [PATCH 3/4] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/complex/float32/base/mul/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul/README.md b/lib/node_modules/@stdlib/complex/float32/base/mul/README.md index b08b09f13651..5c92bcfc996b 100644 --- a/lib/node_modules/@stdlib/complex/float32/base/mul/README.md +++ b/lib/node_modules/@stdlib/complex/float32/base/mul/README.md @@ -133,7 +133,7 @@ var mul = require( '@stdlib/complex/float32/base/mul' ); var z1 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); var z2 = new Complex64Array( discreteUniform( 200, -50, 50 ) ); -// Scale each by a scalar constant: +// Perform multiplication on each element of arrays: logEachMap( '(%s) * (%s) = %s', z1, z2, mul ); ``` From 04fa0f8d4ae6d3757cdfc3a693dc74eadadf8927 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Mon, 2 Jun 2025 23:46:16 +0530 Subject: [PATCH 4/4] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- .../@stdlib/complex/float32/base/mul/examples/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/complex/float32/base/mul/examples/index.js b/lib/node_modules/@stdlib/complex/float32/base/mul/examples/index.js index 1b9b46794fa8..5f418b260f4f 100644 --- a/lib/node_modules/@stdlib/complex/float32/base/mul/examples/index.js +++ b/lib/node_modules/@stdlib/complex/float32/base/mul/examples/index.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2025 The Stdlib Authors. +* Copyright (c) 2021 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.