From 9651a1adc602afb3fbfa3890e90b39a75541dee8 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Sat, 5 Apr 2025 19:11:14 +0530 Subject: [PATCH 01/48] feat: add c implementation for blas/base/dsyr --- 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: passed - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: missing_dependencies - task: lint_c_examples status: missing_dependencies - task: lint_c_benchmarks status: missing_dependencies - 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/blas/base/dsyr/README.md | 85 ++- .../base/dsyr/benchmark/benchmark.native.js | 109 ++++ .../benchmark/benchmark.ndarray.native.js | 109 ++++ .../blas/base/dsyr/benchmark/c/Makefile | 146 +++++ .../blas/base/dsyr/benchmark/c/benchmark.c | 179 ++++++ .../@stdlib/blas/base/dsyr/binding.gyp | 265 +++++++++ .../blas/base/dsyr/examples/c/Makefile | 146 +++++ .../blas/base/dsyr/examples/c/example.c | 46 ++ .../@stdlib/blas/base/dsyr/include.gypi | 70 +++ .../base/dsyr/include/stdlib/blas/base/dsyr.h | 48 ++ .../include/stdlib/blas/base/dsyr_cblas.h | 43 ++ .../@stdlib/blas/base/dsyr/lib/dsyr.native.js | 60 ++ .../@stdlib/blas/base/dsyr/lib/native.js | 35 ++ .../blas/base/dsyr/lib/ndarray.native.js | 61 ++ .../@stdlib/blas/base/dsyr/manifest.json | 319 ++++++++++ .../@stdlib/blas/base/dsyr/package.json | 3 + .../@stdlib/blas/base/dsyr/src/Makefile | 70 +++ .../@stdlib/blas/base/dsyr/src/addon.c | 86 +++ .../@stdlib/blas/base/dsyr/src/dsyr.c | 131 ++++ .../@stdlib/blas/base/dsyr/src/dsyr_cblas.c | 37 ++ .../blas/base/dsyr/test/test.dsyr.native.js | 300 ++++++++++ .../base/dsyr/test/test.ndarray.native.js | 563 ++++++++++++++++++ 22 files changed, 2904 insertions(+), 7 deletions(-) create mode 100644 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/Makefile create mode 100644 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c create mode 100644 lib/node_modules/@stdlib/blas/base/dsyr/binding.gyp create mode 100644 lib/node_modules/@stdlib/blas/base/dsyr/examples/c/Makefile create mode 100644 lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c create mode 100644 lib/node_modules/@stdlib/blas/base/dsyr/include.gypi create mode 100644 lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr.h create mode 100644 lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h create mode 100644 lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dsyr/lib/native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dsyr/manifest.json create mode 100644 lib/node_modules/@stdlib/blas/base/dsyr/src/Makefile create mode 100644 lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c create mode 100644 lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c create mode 100644 lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c create mode 100644 lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.native.js diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/README.md b/lib/node_modules/@stdlib/blas/base/dsyr/README.md index 62b1b6179a5d..cbc4f682ef0e 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/README.md +++ b/lib/node_modules/@stdlib/blas/base/dsyr/README.md @@ -183,21 +183,65 @@ console.log( A ); ### Usage ```c -TODO +#include "stdlib/blas/base/dsyr.h" ``` -#### TODO +#### c_dsyr( order, uplo, N, alpha, \*X, strideX, \*A, LDA ) -TODO. +Performs the symmetric rank 1 operation `A = α*x*x^T + A`. ```c -TODO +#include "stdlib/blas/base/shared.h" + +double A[] = { 1.0, 0.0, 0.0, 2.0, 1.0, 0.0, 3.0, 2.0, 1.0 }; +const double x[] = { 1.0, 2.0, 3.0 }; + +c_dsyr( CblasColMajor, CblasUpper, 3, 1.0, x, 1, A, 3 ); +``` + +The function accepts the following arguments: + +- **order**: `[in] CBLAS_LAYOUT` storage layout. +- **uplo**: `[in] CBLAS_UPLO` specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced. +- **N**: `[in] CBLAS_INT` number of elements along each dimension of `A`. +- **alpha**: `[in] double` scalar. +- **X**: `[in] double*` input array. +- **strideX**: `[in] CBLAS_INT` index increment for `X`. +- **A**: `[inout] double*` input matrix. +- **LDA**: `[in] CBLAS_INT` stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`). + +```c +void c_dsyr( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *A, const CBLAS_INT LDA ) ``` -TODO +#### c_dsyr_ndarray( uplo, N, alpha, \*X, strideX, offsetX, \*A, sa1, sa2, oa ) + +Performs the symmetric rank 1 operation `A = α*x*x^T + A` using alternative indexing semantics. + +```c +#include "stdlib/blas/base/shared.h" + +double A[] = { 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 }; +const double x[] = { 1.0, 2.0, 3.0 }; + +c_dsyr_ndarray( CblasUpper, 3, 1.0f, x, 1, 0, A, 3, 1, 0 ); +``` + +The function accepts the following arguments: + +- **uplo**: `[in] CBLAS_UPLO` specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced. +- **N**: `[in] CBLAS_INT` number of elements along each dimension of `A`. +- **alpha**: `[in] double` scalar. +- **X**: `[in] double*` input array. +- **strideX**: `[in] CBLAS_INT` index increment for `X`. +- **offsetX**: `[in] CBLAS_INT` starting index for `X`. +- **A**: `[inout] double*` input matrix. +- **sa1**: `[in] CBLAS_INT` stride of the first dimension of `A`. +- **sa2**: `[in] CBLAS_INT` stride of the second dimension of `A`. +- **oa**: `[in] CBLAS_INT` starting index for `A`. ```c -TODO +void c_dsyr_ndarray( const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, double *A, const CBLAS_INT sa1, const CBLAS_INT sa2, const CBLAS_INT oa ) ``` @@ -219,7 +263,34 @@ TODO ### Examples ```c -TODO +#include "stdlib/blas/base/dsyr.h" +#include "stdlib/blas/base/shared.h" +#include + +int main( void ) { + // Create strided arrays: + double A[] = { 1.0, 0.0, 0.0, 2.0, 1.0, 0.0, 3.0, 2.0, 1.0 }; + const double x[] = { 1.0, 2.0, 3.0 }; + + // Specify the number of elements along each dimension of `A`: + const int N = 3; + + // Perform the symmetric rank 1 operation `A = α*x*x^T + A`: + c_dsyr( CblasColMajor, CblasUpper, N, 1.0, x, 1, A, N ); + + // Print the result: + for ( int i = 0; i < N*N; i++ ) { + printf( "A[ %i ] = %f\n", i, A[ i ] ); + } + + // Perform the symmetric rank 1 operation `A = α*x*x^T + A`: + c_dsyr_ndarray( CblasUpper, N, 1.0, x, 1, 0, A, N, 1, 0 ); + + // Print the result: + for ( int i = 0; i < N*N; i++ ) { + printf( "A[ %i ] = %f\n", i, A[ i ] ); + } +} ``` diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.native.js new file mode 100644 index 000000000000..ec7bf95c8b72 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.native.js @@ -0,0 +1,109 @@ +/** +* @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 isnan = require( '@stdlib/math/base/assert/is-nan' ); +var ones = require( '@stdlib/array/ones' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dsyr = tryRequire( resolve( __dirname, './../lib/dsyr.native.js' ) ); +var opts = { + 'skip': ( dsyr instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - number of elements along each dimension +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var x = ones( N, options.dtype ); + var A = ones( N*N, options.dtype ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dsyr( 'row-major', 'upper', N, 1.0, x, 1, A, N ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+'::native:size='+(N*N), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.ndarray.native.js new file mode 100644 index 000000000000..d9c133e73870 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.ndarray.native.js @@ -0,0 +1,109 @@ +/** +* @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 isnan = require( '@stdlib/math/base/assert/is-nan' ); +var ones = require( '@stdlib/array/ones' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dsyr = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dsyr instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - number of elements along each dimension +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var x = ones( N, options.dtype ); + var A = ones( N*N, options.dtype ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dsyr( 'upper', N, 1.0, x, 1, 0, A, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+'::native:ndarray:size='+(N*N), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/Makefile b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/Makefile new file mode 100644 index 000000000000..a4bd7b38fd74 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/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 := 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 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c new file mode 100644 index 000000000000..80bdea3c21f0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c @@ -0,0 +1,179 @@ +/** +* @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/blas/base/dsyr.h" +#include "stdlib/blas/base/shared.h" +#include "stdlib/blas/ext/base/sfill.h" +#include +#include +#include +#include +#include + +#define NAME "dsyr" +#define ITERATIONS 10000000 +#define REPEATS 3 +#define MIN 1 +#define MAX 6 + +/** +* 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 iterations number of iterations +* @param elapsed elapsed time in seconds +*/ +static void print_results( int iterations, 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; +} + +/** +* Runs a benchmark. +* +* @param iterations number of iterations +* @param N number of elements along each dimension +* @return elapsed time in seconds +*/ +static double benchmark1( int iterations, int N ) { + double elapsed; + double A[ N*N ]; + double x[ N ]; + double t; + int i; + + stdlib_strided_sfill( N, 0.5, x, 1 ); + stdlib_strided_sfill( N*N, 1.0, A, 1 ); + t = tic(); + for ( i = 0; i < iterations; i++ ) { + c_dsyr( CblasRowMajor, CblasUpper, N, 1.0, x, 1, A, N ); + if ( A[ 0 ] != A[ 0 ] ) { + printf( "should not return NaN\n" ); + break; + } + } + elapsed = tic() - t; + if ( A[ 0 ] != A[ 0 ] ) { + printf( "should not return NaN\n" ); + } + return elapsed; +} + +/** +* Runs a benchmark. +* +* @param iterations number of iterations +* @param N number of elements along each dimension +* @return elapsed time in seconds +*/ +static double benchmark2( int iterations, int N ) { + double elapsed; + double A[ N*N ]; + double x[ N ]; + double t; + int i; + + stdlib_strided_sfill( N, 0.5, x, 1 ); + stdlib_strided_sfill( N*N, 1.0, A, 1 ); + t = tic(); + for ( i = 0; i < iterations; i++ ) { + c_dsyr_ndarray( CblasUpper, N, 1.0, x, 1, 0, A, N, 1, 0 ); + if ( A[ 0 ] != A[ 0 ] ) { + printf( "should not return NaN\n" ); + break; + } + } + elapsed = tic() - t; + if ( A[ 0 ] != A[ 0 ] ) { + printf( "should not return NaN\n" ); + } + return elapsed; +} + +/** +* Main execution sequence. +*/ +int main( void ) { + double elapsed; + int count; + int iter; + int i; + int j; + int N; + + // Use the current time to seed the random number generator: + srand( time( NULL ) ); + + print_version(); + count = 0; + for ( i = MIN; i <= MAX; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + iter = ITERATIONS / pow( 10, i-1 ); + for ( j = 0; j < REPEATS; j++ ) { + count += 1; + printf( "# c::%s:size=%d\n", NAME, N*N ); + elapsed = benchmark1( iter, N ); + print_results( iter, elapsed ); + printf( "ok %d benchmark finished\n", count ); + } + for ( j = 0; j < REPEATS; j++ ) { + count += 1; + printf( "# c::%s:ndarray:size=%d\n", NAME, N*N ); + elapsed = benchmark2( iter, N ); + print_results( iter, elapsed ); + printf( "ok %d benchmark finished\n", count ); + } + } + print_summary( count, count ); +} diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/binding.gyp b/lib/node_modules/@stdlib/blas/base/dsyr/binding.gyp new file mode 100644 index 000000000000..08de71a2020e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsyr/binding.gyp @@ -0,0 +1,265 @@ +# @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', + + # Fortran compiler (to override -Dfortran_compiler=): + 'fortran_compiler%': 'gfortran', + + # Fortran compiler flags: + 'fflags': [ + # Specify the Fortran standard to which a program is expected to conform: + '-std=f95', + + # Indicate that the layout is free-form source code: + '-ffree-form', + + # Aggressive optimization: + '-O3', + + # Enable commonly used warning options: + '-Wall', + + # Warn if source code contains problematic language features: + '-Wextra', + + # Warn if a procedure is called without an explicit interface: + '-Wimplicit-interface', + + # Do not transform names of entities specified in Fortran source files by appending underscores (i.e., don't mangle names, thus allowing easier usage in C wrappers): + '-fno-underscoring', + + # Warn if source code contains Fortran 95 extensions and C-language constructs: + '-pedantic', + + # Compile but do not link (output is an object file): + '-c', + ], + + # 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 + + # Define custom build actions for particular inputs: + 'rules': [ + { + # Define a rule for processing Fortran files: + 'extension': 'f', + + # Define the pathnames to be used as inputs when performing processing: + 'inputs': [ + # Full path of the current input: + '<(RULE_INPUT_PATH)' + ], + + # Define the outputs produced during processing: + 'outputs': [ + # Store an output object file in a directory for placing intermediate results (only accessible within a single target): + '<(INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).<(obj)' + ], + + # Define the rule for compiling Fortran based on the host OS: + 'conditions': [ + [ + 'OS=="win"', + + # Rule to compile Fortran on Windows: + { + 'rule_name': 'compile_fortran_windows', + 'message': 'Compiling Fortran file <(RULE_INPUT_PATH) on Windows...', + + 'process_outputs_as_sources': 0, + + # Define the command-line invocation: + 'action': [ + '<(fortran_compiler)', + '<@(fflags)', + '<@(_inputs)', + '-o', + '<@(_outputs)', + ], + }, + + # Rule to compile Fortran on non-Windows: + { + 'rule_name': 'compile_fortran_linux', + 'message': 'Compiling Fortran file <(RULE_INPUT_PATH) on Linux...', + + 'process_outputs_as_sources': 1, + + # Define the command-line invocation: + 'action': [ + '<(fortran_compiler)', + '<@(fflags)', + '-fPIC', # generate platform-independent code + '<@(_inputs)', + '-o', + '<@(_outputs)', + ], + } + ], # end condition (OS=="win") + ], # end conditions + }, # end rule (extension=="f") + ], # end rules + }, # 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 +} diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/Makefile b/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/Makefile new file mode 100644 index 000000000000..25ced822f96a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsyr/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 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c b/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c new file mode 100644 index 000000000000..7205643b0a60 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsyr/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/blas/base/ssyr.h" +#include "stdlib/blas/base/shared.h" +#include + +int main( void ) { + // Create strided arrays: + double A[] = { 1.0, 0.0, 0.0, 2.0, 1.0, 0.0, 3.0, 2.0, 1.0 }; + const double x[] = { 1.0, 2.0, 3.0 }; + + // Specify the number of elements along each dimension of `A`: + const int N = 3; + + // Perform the symmetric rank 1 operation `A = α*x*x^T + A`: + c_dsyr( CblasColMajor, CblasUpper, N, 1.0, x, 1, A, N ); + + // Print the result: + for ( int i = 0; i < N*N; i++ ) { + printf( "A[ %i ] = %f\n", i, A[ i ] ); + } + + // Perform the symmetric rank 1 operation `A = α*x*x^T + A`: + c_dsyr_ndarray( CblasUpper, N, 1.0, x, 1, 0, A, N, 1, 0 ); + + // Print the result: + for ( int i = 0; i < N*N; i++ ) { + printf( "A[ %i ] = %f\n", i, A[ i ] ); + } +} diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/include.gypi b/lib/node_modules/@stdlib/blas/base/dsyr/include.gypi new file mode 100644 index 000000000000..4217944b5d20 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsyr/include.gypi @@ -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. + +# A GYP include file for building a Node.js native add-on. +# +# Note that nesting variables is required due to how GYP processes a configuration. Any variables defined within a nested 'variables' section is defined in the outer scope. Thus, conditions in the outer variable scope are free to use these variables without running into "variable undefined" errors. +# +# Main documentation: +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +# +# Variable nesting hacks: +# +# [3]: https://chromium.googlesource.com/external/skia/gyp/+/master/common_variables.gypi +# [4]: https://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi?revision=127004 +{ + # Define variables to be used throughout the configuration for all targets: + 'variables': { + 'variables': { + # Host BLAS library (to override -Dblas=): + 'blas%': '', + + # Path to BLAS library (to override -Dblas_dir=): + 'blas_dir%': '', + }, # end variables + + # Source directory: + 'src_dir': './src', + + # Include directories: + 'include_dirs': [ + '<@(blas_dir)', + ' [ [ 1.0, 2.0, 3.0 ], [ 0.0, 1.0, 2.0 ], [ 0.0, 0.0, 1.0 ] ] +* var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +* +* dsyr( 'row-major', 'upper', 3, 1.0, x, 1, A, 3 ); +* // A => [ 2.0, 4.0, 6.0, 0.0, 5.0, 8.0, 0.0, 0.0, 10.0 ] +*/ +function dsyr( order, uplo, N, alpha, x, strideX, A, LDA ) { + addon( resolveOrder( order ), resolveUplo( uplo ), N, alpha, x, strideX, A, LDA ); // eslint-disable-line max-len + return A; +} + + +// EXPORTS // + +module.exports = dsyr; diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/native.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/native.js new file mode 100644 index 000000000000..4c4d0bb3579d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsyr/lib/native.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var dsyr = require( './dsyr.native.js' ); +var ndarray = require( './ndarray.native.js' ); + + +// MAIN // + +setReadOnly( dsyr, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = dsyr; diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js new file mode 100644 index 000000000000..72bd9717561e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js @@ -0,0 +1,61 @@ +/** +* @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 resolveUplo = require( '@stdlib/blas/base/matrix-triangle-resolve-enum' ); +var addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Performs the symmetric rank 1 operation `A = α*x*x^T + A`. +* +* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced +* @param {NonNegativeInteger} N - number of elements along each dimension of `A` +* @param {number} alpha - scalar +* @param {Float64Array} x - input vector +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting index for `x` +* @param {Float64Array} A - input matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @returns {Float64Array} `A` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 0.0, 1.0, 2.0 ], [ 0.0, 0.0, 1.0 ] ] +* var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +* +* dsyr( 'upper', 3, 1.0, x, 1, 0, A, 3, 1, 0 ); +* // A => [ 2.0, 4.0, 6.0, 0.0, 5.0, 8.0, 0.0, 0.0, 10.0 ] +*/ +function dsyr( uplo, N, alpha, x, strideX, offsetX, A, strideA1, strideA2, offsetA ) { // eslint-disable-line max-len + addon.ndarray( resolveUplo( uplo ), N, alpha, x, strideX, offsetX, A, strideA1, strideA2, offsetA ); // eslint-disable-line max-len + return A; +} + + +// EXPORTS // + +module.exports = dsyr; diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json b/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json new file mode 100644 index 000000000000..05fa40f5a71c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json @@ -0,0 +1,319 @@ +{ + "options": { + "task": "build", + "os": "linux", + "blas": "", + "wasm": false + }, + "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", + "os": "win", + "blas": "openblas", + "wasm": false, + "src": [ + "./src/dsyr_cblas.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lopenblas", + "-lpthread" + ], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-int32", + "@stdlib/napi/argv-strided-float64array", + "@stdlib/napi/argv-strided-float64array2d", + "@stdlib/napi/argv-double" + ] + }, + { + "task": "benchmark", + "os": "win", + "blas": "openblas", + "wasm": false, + "src": [ + "./src/dsyr_cblas.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lopenblas", + "-lpthread" + ], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared" + ] + }, + { + "task": "examples", + "os": "win", + "blas": "openblas", + "wasm": false, + "src": [ + "./src/dsyr_cblas.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lopenblas", + "-lpthread" + ], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared" + ] + }, + + { + "task": "build", + "os": "mac", + "blas": "apple_accelerate_framework", + "wasm": false, + "src": [ + "./src/dsyr_cblas.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lblas" + ], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-int32", + "@stdlib/napi/argv-strided-float64array", + "@stdlib/napi/argv-strided-float64array2d", + "@stdlib/napi/argv-double" + ] + }, + { + "task": "benchmark", + "os": "mac", + "blas": "apple_accelerate_framework", + "wasm": false, + "src": [ + "./src/dsyr_cblas.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lblas" + ], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared" + ] + }, + { + "task": "examples", + "os": "mac", + "blas": "apple_accelerate_framework", + "wasm": false, + "src": [ + "./src/dsyr_cblas.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lblas" + ], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared" + ] + }, + + { + "task": "build", + "os": "mac", + "blas": "openblas", + "wasm": false, + "src": [ + "./src/dsyr_cblas.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lopenblas", + "-lpthread" + ], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-int32", + "@stdlib/napi/argv-strided-float64array", + "@stdlib/napi/argv-strided-float64array2d", + "@stdlib/napi/argv-double" + ] + }, + { + "task": "benchmark", + "os": "mac", + "blas": "openblas", + "wasm": false, + "src": [ + "./src/dsyr_cblas.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lopenblas", + "-lpthread" + ], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared" + ] + }, + { + "task": "examples", + "os": "mac", + "blas": "openblas", + "wasm": false, + "src": [ + "./src/dsyr_cblas.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lopenblas", + "-lpthread" + ], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared" + ] + }, + + { + "task": "build", + "os": "linux", + "blas": "", + "wasm": false, + "src": [ + "./src/dsyr.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-int32", + "@stdlib/napi/argv-strided-float64array", + "@stdlib/napi/argv-strided-float64array2d", + "@stdlib/napi/argv-double", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major" + ] + }, + { + "task": "benchmark", + "os": "linux", + "blas": "", + "wasm": false, + "src": [ + "./src/dsyr.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/ext/base/sfill", + "@stdlib/math/base/special/floor", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major" + ] + }, + { + "task": "examples", + "os": "linux", + "blas": "", + "wasm": false, + "src": [ + "./src/dsyr.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major" + ] + }, + + { + "task": "build", + "os": "", + "blas": "", + "wasm": true, + "src": [ + "./src/dsyr.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major" + ] + } + ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/package.json b/lib/node_modules/@stdlib/blas/base/dsyr/package.json index 9c3c693ea93c..ab37bcb25b13 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/package.json +++ b/lib/node_modules/@stdlib/blas/base/dsyr/package.json @@ -14,11 +14,14 @@ } ], "main": "./lib", + "gypfile": true, "directories": { "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", + "src": "./src", "test": "./test" }, "types": "./docs/types", diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/Makefile b/lib/node_modules/@stdlib/blas/base/dsyr/src/Makefile new file mode 100644 index 000000000000..7733b6180cb4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsyr/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/blas/base/dsyr/src/addon.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c new file mode 100644 index 000000000000..fe6089114973 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c @@ -0,0 +1,86 @@ +/** +* @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/blas/base/dsyr.h" +#include "stdlib/blas/base/shared.h" +#include "stdlib/napi/export.h" +#include "stdlib/napi/argv.h" +#include "stdlib/napi/argv_int64.h" +#include "stdlib/napi/argv_int32.h" +#include "stdlib/napi/argv_double.h" +#include "stdlib/napi/argv_strided_float64array.h" +#include "stdlib/napi/argv_strided_float64array2d.h" +#include + +/** +* Receives JavaScript callback invocation data. +* +* @param env environment under which the function is invoked +* @param info callback data +* @return Node-API value +*/ +static napi_value addon( napi_env env, napi_callback_info info ) { + STDLIB_NAPI_ARGV( env, info, argv, argc, 8 ); + + STDLIB_NAPI_ARGV_INT32( env, order, argv, 0 ); + STDLIB_NAPI_ARGV_INT32( env, uplo, argv, 1 ); + + STDLIB_NAPI_ARGV_INT64( env, N, argv, 2 ); + STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 5 ); + STDLIB_NAPI_ARGV_INT64( env, LDA, argv, 7 ); + + STDLIB_NAPI_ARGV_DOUBLE( env, alpha, argv, 3 ); + + STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 4 ); + STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, A, ((N-1)*LDA) + N, 1, argv, 6 ); + + API_SUFFIX(c_dsyr)( order, uplo, N, alpha, X, strideX, A, LDA ); + + return NULL; +} + +/** +* Receives JavaScript callback invocation data. +* +* @param env environment under which the function is invoked +* @param info callback data +* @return Node-API value +*/ +static napi_value addon_method( napi_env env, napi_callback_info info ) { + STDLIB_NAPI_ARGV( env, info, argv, argc, 10 ); + + STDLIB_NAPI_ARGV_INT32( env, uplo, argv, 0 ); + + STDLIB_NAPI_ARGV_INT64( env, N, argv, 1 ); + STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 4 ); + STDLIB_NAPI_ARGV_INT64( env, offsetX, argv, 5 ); + STDLIB_NAPI_ARGV_INT64( env, strideA1, argv, 7 ); + STDLIB_NAPI_ARGV_INT64( env, strideA2, argv, 8 ); + STDLIB_NAPI_ARGV_INT64( env, offsetA, argv, 9 ); + + STDLIB_NAPI_ARGV_DOUBLE( env, alpha, argv, 2 ); + + STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 3 ); + STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY2D( env, A, N, N, strideA1, strideA2, argv, 6 ); + + API_SUFFIX(c_dsyr_ndarray)( uplo, N, alpha, X, strideX, offsetX, A, strideA1, strideA2, offsetA ); + + return NULL; +} + +STDLIB_NAPI_MODULE_EXPORT_FCN_WITH_METHOD( addon, "ndarray", addon_method ) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c new file mode 100644 index 000000000000..c1ce804e3f1d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c @@ -0,0 +1,131 @@ +/** +* @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/blas/base/dsyr.h" +#include "stdlib/blas/base/shared.h" +#include "stdlib/strided/base/stride2offset.h" +#include "stdlib/ndarray/base/assert/is_row_major.h" + +/** +* Performs the symmetric rank 1 operation `A = α*x*x^T + A`. +* +* @param order storage layout +* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced +* @param N number of elements along each dimension of `A` +* @param alpha scalar +* @param X input vector +* @param strideX `X` stride length +* @param A input matrix +* @param LDA stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +*/ +void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *A, const CBLAS_INT LDA ) { + CBLAS_INT sa1; + CBLAS_INT sa2; + CBLAS_INT ox; + + if ( N == 0 || alpha == 0.0 ) { + return; + } + if ( order == CblasColMajor ) { + sa1 = 1; + sa2 = LDA; + } else { // order === 'row-major' + sa1 = LDA; + sa2 = 1; + } + ox = STDLIB_BLAS_BASE_STRIDE2OFFSET( N, strideX ); + API_SUFFIX(c_dsyr_ndarray)( uplo, N, alpha, X, strideX, ox, A, sa1, sa2, 0 ); + return; +} + +/** +* Performs the symmetric rank 1 operation `A = α*x*x^T + A` using alternative indexing semantics. +* +* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced +* @param N number of elements along each dimension of `A` +* @param alpha scalar +* @param X input vector +* @param strideX `X` stride length +* @param offsetX starting index of `X` +* @param A input matrix +* @param strideA1 stride of the first dimension of `A` +* @param strideA2 stride of the second dimension of `A` +* @param offsetA starting index of `A` +*/ +void API_SUFFIX(c_dsyr_ndarray)( const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, double *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA ) { + CBLAS_INT isrm; + CBLAS_INT ix0; + CBLAS_INT ix1; + CBLAS_INT sa0; + CBLAS_INT sa1; + CBLAS_INT i0; + CBLAS_INT i1; + CBLAS_INT oa; + CBLAS_INT ox; + double tmp; + + int64_t strides[] = { strideA1, strideA2 }; + if ( N == 0 || alpha == 0.0 ) { + return; + } + isrm = stdlib_ndarray_is_row_major( 2, strides ); + if ( isrm ) { + // For row-major matrices, the last dimension has the fastest changing index... + sa0 = strideA2; // stride for innermost loop + sa1 = strideA1; // stride for outermost loop + } else { // isColMajor + // For column-major matrices, the first dimension has the fastest changing index... + sa0 = strideA1; // stride for innermost loop + sa1 = strideA2; // stride for outermost loop + } + ox = offsetX; + if ( + ( isrm && uplo == CblasLower ) || + ( !isrm && uplo == CblasUpper ) + ) { + ix1 = ox; + for ( i1 = 0; i1 < N; i1++ ) { + if ( X[ ix1 ] != 0.0 ) { + tmp = alpha * X[ ix1 ]; + oa = offsetA + (sa1*i1); + ix0 = ox; + for ( i0 = 0; i0 <= i1; i0++ ) { + A[ oa+(sa0*i0) ] += X[ ix0 ] * tmp; + ix0 += strideX; + } + } + ix1 += strideX; + } + return; + } + // ( isrm && uplo == 'CblasUpper' ) || ( !isrm && uplo === 'CblasLower' ) + ix1 = ox; + for ( i1 = 0; i1 < N; i1++ ) { + if ( X[ ix1 ] != 0.0 ) { + tmp = alpha * X[ ix1 ]; + oa = offsetA + (sa1*i1); + ix0 = ix1; + for ( i0 = i1; i0 < N; i0++ ) { + A[ oa+(sa0*i0) ] += X[ ix0 ] * tmp; + ix0 += strideX; + } + } + ix1 += strideX; + } + return; +} diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c new file mode 100644 index 000000000000..83e431fb07a9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c @@ -0,0 +1,37 @@ +/** +* @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/blas/base/dsyr.h" +#include "stdlib/blas/base/dsyr_cblas.h" +#include "stdlib/blas/base/shared.h" + +/** +* Performs the symmetric rank 1 operation `A = α*x*x^T + A`. +* +* @param order storage layout +* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced +* @param N number of elements along each dimension of `A` +* @param alpha scalar +* @param x input vector +* @param strideX `X` stride length +* @param A input matrix +* @param LDA stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +*/ +void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *A, const CBLAS_INT LDA ) { + API_SUFFIX(cblas_dsyr)( order, uplo, N, alpha, X, strideX, A, LDA ); +} diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.native.js new file mode 100644 index 000000000000..75d3591652c0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.native.js @@ -0,0 +1,300 @@ +/** +* @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. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var str2enum = require( '@stdlib/blas/base/matrix-triangle-str2enum' ); +var str2enumLayout = require( '@stdlib/blas/base/layout-str2enum' ); +var tryRequire = require( '@stdlib/utils/try-require' ); + + +// FIXTURES // + +var ru = require( './fixtures/row_major_u.json' ); +var rl = require( './fixtures/row_major_l.json' ); +var rxp = require( './fixtures/row_major_xp.json' ); +var rxn = require( './fixtures/row_major_xn.json' ); + +var cu = require( './fixtures/column_major_u.json' ); +var cl = require( './fixtures/column_major_l.json' ); +var cxp = require( './fixtures/column_major_xp.json' ); +var cxn = require( './fixtures/column_major_xn.json' ); + + +// VARIABLES // + +var dsyr = tryRequire( resolve( __dirname, './../lib/dsyr.native.js' ) ); +var opts = { + 'skip': ( dsyr instanceof Error ) +}; + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dsyr, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 8', opts, function test( t ) { + t.strictEqual( dsyr.length, 8, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` (row-major, upper)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = ru; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A_out ); + + out = dsyr( str2enumLayout( data.order ), str2enum( data.uplo ), data.N, data.alpha, x, data.strideX, a, data.lda ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` (column-major, upper)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A_out ); + + out = dsyr( str2enumLayout( data.order ), str2enum( data.uplo ), data.N, data.alpha, x, data.strideX, a, data.lda ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` (row-major, lower)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rl; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A_out ); + + out = dsyr( str2enumLayout( data.order ), str2enum( data.uplo ), data.N, data.alpha, x, data.strideX, a, data.lda ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` (column-major, lower)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cl; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A_out ); + + out = dsyr( str2enumLayout( data.order ), str2enum( data.uplo ), data.N, data.alpha, x, data.strideX, a, data.lda ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a reference to the input matrix `A`', opts, function test( t ) { + var data; + var out; + var a; + var x; + + data = ru; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + out = dsyr( str2enumLayout( data.order ), str2enum( data.uplo ), data.N, data.alpha, x, data.strideX, a, data.lda ); + t.strictEqual( out, a, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `N` is zero or the scalar constant is zero, the function returns the input matrix `A` unchanged (row-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rl; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A ); + + out = dsyr( str2enumLayout( data.order ), str2enum( data.uplo ), 0, data.alpha, x, data.strideX, a, data.lda ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( a, expected, 'returns expected value' ); + + out = dsyr( str2enumLayout( data.order ), str2enum( data.uplo ), data.N, 0.0, x, data.strideX, a, data.lda ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( a, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `N` is zero or the scalar constant is zero, the function returns the input matrix `A` unchanged (column-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cl; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A ); + + out = dsyr( str2enumLayout( data.order ), str2enum( data.uplo ), 0, data.alpha, x, data.strideX, a, data.lda ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( a, expected, 'returns expected value' ); + + out = dsyr( str2enumLayout( data.order ), str2enum( data.uplo ), data.N, 0.0, x, data.strideX, a, data.lda ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( a, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an `x` stride (row-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rxp; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A_out ); + + out = dsyr( str2enumLayout( data.order ), str2enum( data.uplo ), data.N, data.alpha, x, data.strideX, a, data.lda ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an `x` stride (column-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cxp; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A_out ); + + out = dsyr( str2enumLayout( data.order ), str2enum( data.uplo ), data.N, data.alpha, x, data.strideX, a, data.lda ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `x` stride (row-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rxn; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A_out ); + + out = dsyr( str2enumLayout( data.order ), str2enum( data.uplo ), data.N, data.alpha, x, data.strideX, a, data.lda ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `x` stride (column-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cxn; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A_out ); + + out = dsyr( str2enumLayout( data.order ), str2enum( data.uplo ), data.N, data.alpha, x, data.strideX, a, data.lda ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.native.js new file mode 100644 index 000000000000..a2b341fe4498 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.native.js @@ -0,0 +1,563 @@ +/** +* @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. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var str2enumMatrixTriangle = require( '@stdlib/blas/base/matrix-triangle-str2enum' ); +var tryRequire = require( '@stdlib/utils/try-require' ); + + +// FIXTURES // + +var ru = require( './fixtures/row_major_u.json' ); +var rl = require( './fixtures/row_major_l.json' ); +var rxp = require( './fixtures/row_major_xp.json' ); +var rxn = require( './fixtures/row_major_xn.json' ); +var roa = require( './fixtures/row_major_oa.json' ); +var rsa1sa2 = require( './fixtures/row_major_sa1_sa2.json' ); +var rsa1nsa2 = require( './fixtures/row_major_sa1n_sa2.json' ); +var rsa1sa2n = require( './fixtures/row_major_sa1_sa2n.json' ); +var rsa1nsa2n = require( './fixtures/row_major_sa1n_sa2n.json' ); +var rcap = require( './fixtures/row_major_complex_access_pattern.json' ); + +var cu = require( './fixtures/column_major_u.json' ); +var cl = require( './fixtures/column_major_l.json' ); +var cxp = require( './fixtures/column_major_xp.json' ); +var cxn = require( './fixtures/column_major_xn.json' ); +var coa = require( './fixtures/column_major_oa.json' ); +var csa1sa2 = require( './fixtures/column_major_sa1_sa2.json' ); +var csa1nsa2 = require( './fixtures/column_major_sa1n_sa2.json' ); +var csa1sa2n = require( './fixtures/column_major_sa1_sa2n.json' ); +var csa1nsa2n = require( './fixtures/column_major_sa1n_sa2n.json' ); +var ccap = require( './fixtures/column_major_complex_access_pattern.json' ); + + +// VARIABLES // + +var dsyr = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dsyr instanceof Error ) +}; + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dsyr, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 10', opts, function test( t ) { + t.strictEqual( dsyr.length, 10, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` (row-major, upper)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = ru; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A_out ); + + out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` (column-major, upper)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A_out ); + + out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` (row-major, lower)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rl; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A_out ); + + out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` (column-major, lower)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cl; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A_out ); + + out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a reference to the input matrix `A`', opts, function test( t ) { + var data; + var out; + var a; + var x; + + data = ru; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( out, a, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `N` is zero or the scalar constant is zero, the function returns the input matrix `A` unchanged (row-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rl; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A ); + + out = dsyr( str2enumMatrixTriangle( data.uplo ), 0, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( a, expected, 'returns expected value' ); + + out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, 0.0, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( a, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `N` is zero or the scalar constant is zero, the function returns the input matrix `A` unchanged (column-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cl; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A ); + + out = dsyr( str2enumMatrixTriangle( data.uplo ), 0, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( a, expected, 'returns expected value' ); + + out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, 0.0, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( a, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying the strides of the first and second dimensions of `A` (row-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rsa1sa2; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A_out ); + + out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying the strides of the first and second dimensions of `A` (column-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = csa1sa2; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A_out ); + + out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the first dimension of `A` (row-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rsa1nsa2; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A_out ); + + out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the first dimension of `A` (column-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = csa1nsa2; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A_out ); + + out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the second dimension of `A` (row-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rsa1sa2n; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A_out ); + + out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports a negative stride for the second dimension of `A` (column-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = csa1sa2n; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A_out ); + + out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports negative strides for both dimensions of `A` (row-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rsa1nsa2n; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A_out ); + + out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports negative strides for both dimensions of `A` (column-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = csa1nsa2n; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A_out ); + + out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an `A` offset (row-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = roa; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A_out ); + + out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an `A` offset (column-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = coa; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A_out ); + + out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an `x` stride (row-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rxp; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A_out ); + + out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an `x` stride (column-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cxp; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A_out ); + + out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `x` stride (row-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rxn; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A_out ); + + out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `x` stride (column-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cxn; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A_out ); + + out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports complex access patterns (row-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rcap; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A_out ); + + out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports complex access patterns (column-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = ccap; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.A_out ); + + out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + t.strictEqual( out, a, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); From c10bdedd2d3e10089d9826237b1327f916a1bb8d Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Sat, 5 Apr 2025 20:02:15 +0530 Subject: [PATCH 02/48] feat: add c implementation for blas/base/dsyr --- 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: passed - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: missing_dependencies - task: lint_c_examples status: missing_dependencies - task: lint_c_benchmarks status: missing_dependencies - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/blas/base/dsyr/README.md | 0 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.js | 0 .../@stdlib/blas/base/dsyr/benchmark/benchmark.native.js | 0 .../@stdlib/blas/base/dsyr/benchmark/benchmark.ndarray.js | 0 .../blas/base/dsyr/benchmark/benchmark.ndarray.native.js | 0 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/Makefile | 0 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c | 0 lib/node_modules/@stdlib/blas/base/dsyr/binding.gyp | 0 lib/node_modules/@stdlib/blas/base/dsyr/docs/repl.txt | 0 lib/node_modules/@stdlib/blas/base/dsyr/docs/types/index.d.ts | 0 lib/node_modules/@stdlib/blas/base/dsyr/docs/types/test.ts | 0 lib/node_modules/@stdlib/blas/base/dsyr/examples/c/Makefile | 0 lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c | 2 +- lib/node_modules/@stdlib/blas/base/dsyr/examples/index.js | 0 lib/node_modules/@stdlib/blas/base/dsyr/include.gypi | 0 .../@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr.h | 0 .../blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h | 0 lib/node_modules/@stdlib/blas/base/dsyr/lib/base.js | 0 lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.js | 0 lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.native.js | 0 lib/node_modules/@stdlib/blas/base/dsyr/lib/index.js | 0 lib/node_modules/@stdlib/blas/base/dsyr/lib/main.js | 0 lib/node_modules/@stdlib/blas/base/dsyr/lib/native.js | 0 lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js | 0 lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js | 0 lib/node_modules/@stdlib/blas/base/dsyr/manifest.json | 0 lib/node_modules/@stdlib/blas/base/dsyr/package.json | 0 lib/node_modules/@stdlib/blas/base/dsyr/src/Makefile | 0 lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c | 0 lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c | 0 lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c | 0 .../dsyr/test/fixtures/column_major_complex_access_pattern.json | 0 .../@stdlib/blas/base/dsyr/test/fixtures/column_major_l.json | 0 .../@stdlib/blas/base/dsyr/test/fixtures/column_major_oa.json | 0 .../blas/base/dsyr/test/fixtures/column_major_sa1_sa2.json | 0 .../blas/base/dsyr/test/fixtures/column_major_sa1_sa2n.json | 0 .../blas/base/dsyr/test/fixtures/column_major_sa1n_sa2.json | 0 .../blas/base/dsyr/test/fixtures/column_major_sa1n_sa2n.json | 0 .../@stdlib/blas/base/dsyr/test/fixtures/column_major_u.json | 0 .../@stdlib/blas/base/dsyr/test/fixtures/column_major_xn.json | 0 .../@stdlib/blas/base/dsyr/test/fixtures/column_major_xp.json | 0 .../dsyr/test/fixtures/row_major_complex_access_pattern.json | 0 .../@stdlib/blas/base/dsyr/test/fixtures/row_major_l.json | 0 .../@stdlib/blas/base/dsyr/test/fixtures/row_major_oa.json | 0 .../@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1_sa2.json | 0 .../blas/base/dsyr/test/fixtures/row_major_sa1_sa2n.json | 0 .../blas/base/dsyr/test/fixtures/row_major_sa1n_sa2.json | 0 .../blas/base/dsyr/test/fixtures/row_major_sa1n_sa2n.json | 0 .../@stdlib/blas/base/dsyr/test/fixtures/row_major_u.json | 0 .../@stdlib/blas/base/dsyr/test/fixtures/row_major_xn.json | 0 .../@stdlib/blas/base/dsyr/test/fixtures/row_major_xp.json | 0 lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.js | 0 .../@stdlib/blas/base/dsyr/test/test.dsyr.native.js | 0 lib/node_modules/@stdlib/blas/base/dsyr/test/test.js | 0 lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.js | 0 .../@stdlib/blas/base/dsyr/test/test.ndarray.native.js | 0 56 files changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/README.md mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.js mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.native.js mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.ndarray.js mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.ndarray.native.js mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/Makefile mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/binding.gyp mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/docs/repl.txt mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/docs/types/index.d.ts mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/docs/types/test.ts mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/examples/c/Makefile mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/examples/index.js mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/include.gypi mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr.h mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/lib/base.js mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.js mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.native.js mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/lib/index.js mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/lib/main.js mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/lib/native.js mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/manifest.json mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/package.json mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/src/Makefile mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_complex_access_pattern.json mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_l.json mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_oa.json mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1_sa2.json mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1_sa2n.json mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1n_sa2.json mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1n_sa2n.json mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_u.json mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_xn.json mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_xp.json mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_complex_access_pattern.json mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_l.json mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_oa.json mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1_sa2.json mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1_sa2n.json mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1n_sa2.json mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1n_sa2n.json mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_u.json mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_xn.json mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_xp.json mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.js mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.native.js mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/test.js mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.js mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.native.js diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/README.md b/lib/node_modules/@stdlib/blas/base/dsyr/README.md old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.js old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.native.js old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.ndarray.js old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.ndarray.native.js old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/Makefile b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/Makefile old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/binding.gyp b/lib/node_modules/@stdlib/blas/base/dsyr/binding.gyp old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/dsyr/docs/repl.txt old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/dsyr/docs/types/index.d.ts old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/dsyr/docs/types/test.ts old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/Makefile b/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/Makefile old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c b/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c old mode 100644 new mode 100755 index 7205643b0a60..0ecb27a64801 --- a/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c @@ -16,7 +16,7 @@ * limitations under the License. */ -#include "stdlib/blas/base/ssyr.h" +#include "stdlib/blas/base/dsyr.h" #include "stdlib/blas/base/shared.h" #include diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/examples/index.js b/lib/node_modules/@stdlib/blas/base/dsyr/examples/index.js old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/include.gypi b/lib/node_modules/@stdlib/blas/base/dsyr/include.gypi old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr.h b/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr.h old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h b/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/base.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/base.js old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.js old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.native.js old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/index.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/index.js old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/main.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/main.js old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/native.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/native.js old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json b/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/package.json b/lib/node_modules/@stdlib/blas/base/dsyr/package.json old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/Makefile b/lib/node_modules/@stdlib/blas/base/dsyr/src/Makefile old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_complex_access_pattern.json old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_l.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_l.json old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_oa.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_oa.json old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1_sa2.json old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1_sa2n.json old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1n_sa2.json old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1n_sa2n.json old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_u.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_u.json old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_xn.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_xn.json old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_xp.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_xp.json old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_complex_access_pattern.json old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_l.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_l.json old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_oa.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_oa.json old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1_sa2.json old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1_sa2n.json old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1n_sa2.json old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1n_sa2n.json old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_u.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_u.json old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_xn.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_xn.json old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_xp.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_xp.json old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.js b/lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.js old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.native.js old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/test.js b/lib/node_modules/@stdlib/blas/base/dsyr/test/test.js old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.js old mode 100644 new mode 100755 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.native.js old mode 100644 new mode 100755 From c6e3f16aa0e8560656af831bb0e3abe37ed36060 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Sat, 5 Apr 2025 20:26:13 +0530 Subject: [PATCH 03/48] fix: file permissions --- 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: passed - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: missing_dependencies - task: lint_c_examples status: missing_dependencies - task: lint_c_benchmarks status: missing_dependencies - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/blas/base/dsyr/README.md | 0 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.js | 0 .../@stdlib/blas/base/dsyr/benchmark/benchmark.native.js | 0 .../@stdlib/blas/base/dsyr/benchmark/benchmark.ndarray.js | 0 .../@stdlib/blas/base/dsyr/benchmark/benchmark.ndarray.native.js | 0 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/Makefile | 0 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c | 0 lib/node_modules/@stdlib/blas/base/dsyr/binding.gyp | 0 lib/node_modules/@stdlib/blas/base/dsyr/docs/repl.txt | 0 lib/node_modules/@stdlib/blas/base/dsyr/docs/types/index.d.ts | 0 lib/node_modules/@stdlib/blas/base/dsyr/docs/types/test.ts | 0 lib/node_modules/@stdlib/blas/base/dsyr/examples/c/Makefile | 0 lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c | 0 lib/node_modules/@stdlib/blas/base/dsyr/examples/index.js | 0 lib/node_modules/@stdlib/blas/base/dsyr/include.gypi | 0 .../@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr.h | 0 .../@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h | 0 lib/node_modules/@stdlib/blas/base/dsyr/lib/base.js | 0 lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.js | 0 lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.native.js | 0 lib/node_modules/@stdlib/blas/base/dsyr/lib/index.js | 0 lib/node_modules/@stdlib/blas/base/dsyr/lib/main.js | 0 lib/node_modules/@stdlib/blas/base/dsyr/lib/native.js | 0 lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js | 0 lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js | 0 lib/node_modules/@stdlib/blas/base/dsyr/manifest.json | 0 lib/node_modules/@stdlib/blas/base/dsyr/package.json | 0 lib/node_modules/@stdlib/blas/base/dsyr/src/Makefile | 0 lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c | 0 lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c | 0 lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c | 0 .../dsyr/test/fixtures/column_major_complex_access_pattern.json | 0 .../@stdlib/blas/base/dsyr/test/fixtures/column_major_l.json | 0 .../@stdlib/blas/base/dsyr/test/fixtures/column_major_oa.json | 0 .../blas/base/dsyr/test/fixtures/column_major_sa1_sa2.json | 0 .../blas/base/dsyr/test/fixtures/column_major_sa1_sa2n.json | 0 .../blas/base/dsyr/test/fixtures/column_major_sa1n_sa2.json | 0 .../blas/base/dsyr/test/fixtures/column_major_sa1n_sa2n.json | 0 .../@stdlib/blas/base/dsyr/test/fixtures/column_major_u.json | 0 .../@stdlib/blas/base/dsyr/test/fixtures/column_major_xn.json | 0 .../@stdlib/blas/base/dsyr/test/fixtures/column_major_xp.json | 0 .../base/dsyr/test/fixtures/row_major_complex_access_pattern.json | 0 .../@stdlib/blas/base/dsyr/test/fixtures/row_major_l.json | 0 .../@stdlib/blas/base/dsyr/test/fixtures/row_major_oa.json | 0 .../@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1_sa2.json | 0 .../@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1_sa2n.json | 0 .../@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1n_sa2.json | 0 .../@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1n_sa2n.json | 0 .../@stdlib/blas/base/dsyr/test/fixtures/row_major_u.json | 0 .../@stdlib/blas/base/dsyr/test/fixtures/row_major_xn.json | 0 .../@stdlib/blas/base/dsyr/test/fixtures/row_major_xp.json | 0 lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.js | 0 lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.native.js | 0 lib/node_modules/@stdlib/blas/base/dsyr/test/test.js | 0 lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.js | 0 .../@stdlib/blas/base/dsyr/test/test.ndarray.native.js | 0 56 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/README.md mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.js mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.native.js mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.ndarray.js mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.ndarray.native.js mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/Makefile mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/binding.gyp mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/docs/repl.txt mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/docs/types/index.d.ts mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/docs/types/test.ts mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/examples/c/Makefile mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/examples/index.js mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/include.gypi mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr.h mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/lib/base.js mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.js mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.native.js mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/lib/index.js mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/lib/main.js mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/lib/native.js mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/manifest.json mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/package.json mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/src/Makefile mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_complex_access_pattern.json mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_l.json mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_oa.json mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1_sa2.json mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1_sa2n.json mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1n_sa2.json mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1n_sa2n.json mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_u.json mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_xn.json mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_xp.json mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_complex_access_pattern.json mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_l.json mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_oa.json mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1_sa2.json mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1_sa2n.json mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1n_sa2.json mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1n_sa2n.json mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_u.json mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_xn.json mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_xp.json mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.js mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.native.js mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/test/test.js mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.js mode change 100755 => 100644 lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.native.js diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/README.md b/lib/node_modules/@stdlib/blas/base/dsyr/README.md old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.js old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.native.js old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.ndarray.js old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.ndarray.native.js old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/Makefile b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/Makefile old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/binding.gyp b/lib/node_modules/@stdlib/blas/base/dsyr/binding.gyp old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/dsyr/docs/repl.txt old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/dsyr/docs/types/index.d.ts old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/dsyr/docs/types/test.ts old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/Makefile b/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/Makefile old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c b/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/examples/index.js b/lib/node_modules/@stdlib/blas/base/dsyr/examples/index.js old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/include.gypi b/lib/node_modules/@stdlib/blas/base/dsyr/include.gypi old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr.h b/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr.h old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h b/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/base.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/base.js old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.js old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.native.js old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/index.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/index.js old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/main.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/main.js old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/native.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/native.js old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json b/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/package.json b/lib/node_modules/@stdlib/blas/base/dsyr/package.json old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/Makefile b/lib/node_modules/@stdlib/blas/base/dsyr/src/Makefile old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_complex_access_pattern.json old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_l.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_l.json old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_oa.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_oa.json old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1_sa2.json old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1_sa2n.json old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1n_sa2.json old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1n_sa2n.json old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_u.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_u.json old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_xn.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_xn.json old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_xp.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_xp.json old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_complex_access_pattern.json old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_l.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_l.json old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_oa.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_oa.json old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1_sa2.json old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1_sa2n.json old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1n_sa2.json old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1n_sa2n.json old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_u.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_u.json old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_xn.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_xn.json old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_xp.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_xp.json old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.js b/lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.js old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.native.js old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/test.js b/lib/node_modules/@stdlib/blas/base/dsyr/test/test.js old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.js old mode 100755 new mode 100644 diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.native.js old mode 100755 new mode 100644 From ac5310c1c3a03740a97610927a71f5c579ea7c8e Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Sun, 6 Apr 2025 00:10:34 +0530 Subject: [PATCH 04/48] remove: floating point Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/dsyr/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/README.md b/lib/node_modules/@stdlib/blas/base/dsyr/README.md index cbc4f682ef0e..dbfe5131e9e4 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/README.md +++ b/lib/node_modules/@stdlib/blas/base/dsyr/README.md @@ -224,7 +224,7 @@ Performs the symmetric rank 1 operation `A = α*x*x^T + A` using alternative ind double A[] = { 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 }; const double x[] = { 1.0, 2.0, 3.0 }; -c_dsyr_ndarray( CblasUpper, 3, 1.0f, x, 1, 0, A, 3, 1, 0 ); +c_dsyr_ndarray( CblasUpper, 3, 1.0, x, 1, 0, A, 3, 1, 0 ); ``` The function accepts the following arguments: From 9c4b3077abdc7d331be24c1ab9d1be4a02fd7034 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Wed, 7 May 2025 17:13:56 +0530 Subject: [PATCH 05/48] 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: 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: missing_dependencies - 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 --- --- .../include/stdlib/blas/base/dsyr_cblas.h | 2 +- .../@stdlib/blas/base/dsyr/manifest.json | 12 ++- .../@stdlib/blas/base/dsyr/src/dsyr.c | 77 --------------- .../@stdlib/blas/base/dsyr/src/dsyr_cblas.c | 34 ++++++- .../@stdlib/blas/base/dsyr/src/dsyr_ndarray.c | 98 +++++++++++++++++++ 5 files changed, 140 insertions(+), 83 deletions(-) create mode 100644 lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h b/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h index ceb0f69dcba5..30b78d21b2a1 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h +++ b/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h @@ -34,7 +34,7 @@ extern "C" { /** * Performs the symmetric rank 1 operation `A = α*x*x^T + A`. */ -void API_SUFFIX(cblas_ssyr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *A, const CBLAS_INT LDA ); +void API_SUFFIX(cblas_dsyr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *A, const CBLAS_INT LDA ); #ifdef __cplusplus } diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json b/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json index 05fa40f5a71c..617430d6e282 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json +++ b/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json @@ -235,7 +235,8 @@ "blas": "", "wasm": false, "src": [ - "./src/dsyr.c" + "./src/dsyr.c", + "./src/dsyr_ndarray.c" ], "include": [ "./include" @@ -261,7 +262,8 @@ "blas": "", "wasm": false, "src": [ - "./src/dsyr.c" + "./src/dsyr.c", + "./src/dsyr_ndarray.c" ], "include": [ "./include" @@ -282,7 +284,8 @@ "blas": "", "wasm": false, "src": [ - "./src/dsyr.c" + "./src/dsyr.c", + "./src/dsyr_ndarray.c" ], "include": [ "./include" @@ -302,7 +305,8 @@ "blas": "", "wasm": true, "src": [ - "./src/dsyr.c" + "./src/dsyr.c", + "./src/dsyr_ndarray.c" ], "include": [ "./include" diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c index c1ce804e3f1d..ca8b5b5305d5 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c @@ -52,80 +52,3 @@ void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const API_SUFFIX(c_dsyr_ndarray)( uplo, N, alpha, X, strideX, ox, A, sa1, sa2, 0 ); return; } - -/** -* Performs the symmetric rank 1 operation `A = α*x*x^T + A` using alternative indexing semantics. -* -* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced -* @param N number of elements along each dimension of `A` -* @param alpha scalar -* @param X input vector -* @param strideX `X` stride length -* @param offsetX starting index of `X` -* @param A input matrix -* @param strideA1 stride of the first dimension of `A` -* @param strideA2 stride of the second dimension of `A` -* @param offsetA starting index of `A` -*/ -void API_SUFFIX(c_dsyr_ndarray)( const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, double *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA ) { - CBLAS_INT isrm; - CBLAS_INT ix0; - CBLAS_INT ix1; - CBLAS_INT sa0; - CBLAS_INT sa1; - CBLAS_INT i0; - CBLAS_INT i1; - CBLAS_INT oa; - CBLAS_INT ox; - double tmp; - - int64_t strides[] = { strideA1, strideA2 }; - if ( N == 0 || alpha == 0.0 ) { - return; - } - isrm = stdlib_ndarray_is_row_major( 2, strides ); - if ( isrm ) { - // For row-major matrices, the last dimension has the fastest changing index... - sa0 = strideA2; // stride for innermost loop - sa1 = strideA1; // stride for outermost loop - } else { // isColMajor - // For column-major matrices, the first dimension has the fastest changing index... - sa0 = strideA1; // stride for innermost loop - sa1 = strideA2; // stride for outermost loop - } - ox = offsetX; - if ( - ( isrm && uplo == CblasLower ) || - ( !isrm && uplo == CblasUpper ) - ) { - ix1 = ox; - for ( i1 = 0; i1 < N; i1++ ) { - if ( X[ ix1 ] != 0.0 ) { - tmp = alpha * X[ ix1 ]; - oa = offsetA + (sa1*i1); - ix0 = ox; - for ( i0 = 0; i0 <= i1; i0++ ) { - A[ oa+(sa0*i0) ] += X[ ix0 ] * tmp; - ix0 += strideX; - } - } - ix1 += strideX; - } - return; - } - // ( isrm && uplo == 'CblasUpper' ) || ( !isrm && uplo === 'CblasLower' ) - ix1 = ox; - for ( i1 = 0; i1 < N; i1++ ) { - if ( X[ ix1 ] != 0.0 ) { - tmp = alpha * X[ ix1 ]; - oa = offsetA + (sa1*i1); - ix0 = ix1; - for ( i0 = i1; i0 < N; i0++ ) { - A[ oa+(sa0*i0) ] += X[ ix0 ] * tmp; - ix0 += strideX; - } - } - ix1 += strideX; - } - return; -} diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c index 83e431fb07a9..301b1baaee0c 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c @@ -19,6 +19,8 @@ #include "stdlib/blas/base/dsyr.h" #include "stdlib/blas/base/dsyr_cblas.h" #include "stdlib/blas/base/shared.h" +#include "stdlib/strided/base/min_view_buffer_index.h" +#include "stdlib/ndarray/base/min_view_buffer_index.h" /** * Performs the symmetric rank 1 operation `A = α*x*x^T + A`. @@ -33,5 +35,35 @@ * @param LDA stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) */ void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *A, const CBLAS_INT LDA ) { - API_SUFFIX(cblas_dsyr)( order, uplo, N, alpha, X, strideX, A, LDA ); + CBLAS_INT sx = strideX; + if ( sx < 0 ) { + sx = -sx; + } + API_SUFFIX(cblas_dsyr)( order, uplo, N, alpha, X, sx, AP ); +} + +/** +* Performs the symmetric rank 1 operation `A = α*x*x^T + A` using alternative indexing semantics. +* +* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced +* @param N number of elements along each dimension of `A` +* @param alpha scalar +* @param X input vector +* @param strideX `x` stride length +* @param offsetX starting index for `x` +* @param A input matrix +* @param strideA1 stride of the first dimension of `A` +* @param strideA2 stride of the second dimension of `A` +* @param offsetA starting index for `AP` +*/ +void API_SUFFIX(c_dsyr_ndarray)( const CBLAS_UPLO uplo, const CBLAS_INT N, const float alpha, const float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, float *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA ) { + CBLAS_INT sx = strideX; + X += stdlib_strided_min_view_buffer_index( N, strideX, offsetX ); // adjust array pointer + CBLAS_INT shape[] = { N, N }; + CBLAS_INT strides[] = { strideA1, strideA2 }; + A += stdlib_ndarray_min_view_buffer_index( 2, shape, strides, offsetA); // adjust array pointer + if ( sx < 0 ) { + sx = -sx; + } + API_SUFFIX(cblas_dsyr)( uplo, N, alpha, X, sx, offsetX, A, strideA1, strideA2, offsetA ); } diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c new file mode 100644 index 000000000000..b55826364224 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c @@ -0,0 +1,98 @@ +/** +* @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/blas/base/dsyr.h" +#include "stdlib/blas/base/shared.h" +#include "stdlib/ndarray/base/assert/is_row_major.h" + +/** +* Performs the symmetric rank 1 operation `A = α*x*x^T + A` using alternative indexing semantics. +* +* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced +* @param N number of elements along each dimension of `A` +* @param alpha scalar +* @param X input vector +* @param strideX `X` stride length +* @param offsetX starting index of `X` +* @param A input matrix +* @param strideA1 stride of the first dimension of `A` +* @param strideA2 stride of the second dimension of `A` +* @param offsetA starting index of `A` +*/ +void API_SUFFIX(c_dsyr_ndarray)( const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, double *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA ) { + CBLAS_INT isrm; + CBLAS_INT ix0; + CBLAS_INT ix1; + CBLAS_INT sa0; + CBLAS_INT sa1; + CBLAS_INT i0; + CBLAS_INT i1; + CBLAS_INT oa; + CBLAS_INT ox; + double tmp; + + int64_t strides[] = { strideA1, strideA2 }; + if ( N == 0 || alpha == 0.0 ) { + return; + } + isrm = stdlib_ndarray_is_row_major( 2, strides ); + if ( isrm ) { + // For row-major matrices, the last dimension has the fastest changing index... + sa0 = strideA2; // stride for innermost loop + sa1 = strideA1; // stride for outermost loop + } else { // isColMajor + // For column-major matrices, the first dimension has the fastest changing index... + sa0 = strideA1; // stride for innermost loop + sa1 = strideA2; // stride for outermost loop + } + ox = offsetX; + if ( + ( isrm && uplo == CblasLower ) || + ( !isrm && uplo == CblasUpper ) + ) { + ix1 = ox; + for ( i1 = 0; i1 < N; i1++ ) { + if ( X[ ix1 ] != 0.0 ) { + tmp = alpha * X[ ix1 ]; + oa = offsetA + (sa1*i1); + ix0 = ox; + for ( i0 = 0; i0 <= i1; i0++ ) { + A[ oa+(sa0*i0) ] += X[ ix0 ] * tmp; + ix0 += strideX; + } + } + ix1 += strideX; + } + return; + } + // ( isrm && uplo == 'CblasUpper' ) || ( !isrm && uplo === 'CblasLower' ) + ix1 = ox; + for ( i1 = 0; i1 < N; i1++ ) { + if ( X[ ix1 ] != 0.0 ) { + tmp = alpha * X[ ix1 ]; + oa = offsetA + (sa1*i1); + ix0 = ix1; + for ( i0 = i1; i0 < N; i0++ ) { + A[ oa+(sa0*i0) ] += X[ ix0 ] * tmp; + ix0 += strideX; + } + } + ix1 += strideX; + } + return; +} From ce571b155c97434c683286051fe09bc1410d062a Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Wed, 7 May 2025 17:25:15 +0530 Subject: [PATCH 06/48] chore: minor changes Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c index ca8b5b5305d5..5adaccfc1e63 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c @@ -19,7 +19,6 @@ #include "stdlib/blas/base/dsyr.h" #include "stdlib/blas/base/shared.h" #include "stdlib/strided/base/stride2offset.h" -#include "stdlib/ndarray/base/assert/is_row_major.h" /** * Performs the symmetric rank 1 operation `A = α*x*x^T + A`. @@ -48,7 +47,7 @@ void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const sa1 = LDA; sa2 = 1; } - ox = STDLIB_BLAS_BASE_STRIDE2OFFSET( N, strideX ); + ox = stdlib_strided_stride2offset( N, strideX ); API_SUFFIX(c_dsyr_ndarray)( uplo, N, alpha, X, strideX, ox, A, sa1, sa2, 0 ); return; } From 635d2afaf39c7b61ac36562cd534079e6126eb3b Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Wed, 7 May 2025 17:28:03 +0530 Subject: [PATCH 07/48] chore: change datatypes Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c index 301b1baaee0c..f1356c01d1a9 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c @@ -59,8 +59,8 @@ void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const void API_SUFFIX(c_dsyr_ndarray)( const CBLAS_UPLO uplo, const CBLAS_INT N, const float alpha, const float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, float *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA ) { CBLAS_INT sx = strideX; X += stdlib_strided_min_view_buffer_index( N, strideX, offsetX ); // adjust array pointer - CBLAS_INT shape[] = { N, N }; - CBLAS_INT strides[] = { strideA1, strideA2 }; + int64_t shape[] = { N, N }; + int64_t strides[] = { strideA1, strideA2 }; A += stdlib_ndarray_min_view_buffer_index( 2, shape, strides, offsetA); // adjust array pointer if ( sx < 0 ) { sx = -sx; From e5ef1192593190e337c04b6e9b9a9d2f889b68e9 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Wed, 7 May 2025 17:33:26 +0530 Subject: [PATCH 08/48] chore: update implementation Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c index f1356c01d1a9..c2d293086fba 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c @@ -39,7 +39,7 @@ void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const if ( sx < 0 ) { sx = -sx; } - API_SUFFIX(cblas_dsyr)( order, uplo, N, alpha, X, sx, AP ); + API_SUFFIX(cblas_dsyr)( order, uplo, N, alpha, X, sx, A, LDA ); } /** @@ -65,5 +65,5 @@ void API_SUFFIX(c_dsyr_ndarray)( const CBLAS_UPLO uplo, const CBLAS_INT N, const if ( sx < 0 ) { sx = -sx; } - API_SUFFIX(cblas_dsyr)( uplo, N, alpha, X, sx, offsetX, A, strideA1, strideA2, offsetA ); + API_SUFFIX(cblas_dsyr)( order, uplo, N, alpha, X, sx, A, LDA ); } From a66e7ab042cd70c0388ddc6369839cfafc1ae98e Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Wed, 7 May 2025 17:41:15 +0530 Subject: [PATCH 09/48] chore: update jsdoc Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c index c2d293086fba..2ae4ebee0c17 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c @@ -54,7 +54,7 @@ void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const * @param A input matrix * @param strideA1 stride of the first dimension of `A` * @param strideA2 stride of the second dimension of `A` -* @param offsetA starting index for `AP` +* @param offsetA starting index for `A` */ void API_SUFFIX(c_dsyr_ndarray)( const CBLAS_UPLO uplo, const CBLAS_INT N, const float alpha, const float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, float *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA ) { CBLAS_INT sx = strideX; From a92e9d015e5dd72a0d8c79987d10dc528750706b Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Wed, 7 May 2025 17:43:49 +0530 Subject: [PATCH 10/48] chore: update datatypes Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c index 2ae4ebee0c17..a118c71b2ee1 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c @@ -59,8 +59,8 @@ void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const void API_SUFFIX(c_dsyr_ndarray)( const CBLAS_UPLO uplo, const CBLAS_INT N, const float alpha, const float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, float *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA ) { CBLAS_INT sx = strideX; X += stdlib_strided_min_view_buffer_index( N, strideX, offsetX ); // adjust array pointer - int64_t shape[] = { N, N }; - int64_t strides[] = { strideA1, strideA2 }; + const int64_t shape[] = { N, N }; + const int64_t strides[] = { strideA1, strideA2 }; A += stdlib_ndarray_min_view_buffer_index( 2, shape, strides, offsetA); // adjust array pointer if ( sx < 0 ) { sx = -sx; From 5226edba0e44fbb29768682bbc914be11cc8729b Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Wed, 7 May 2025 18:02:47 +0530 Subject: [PATCH 11/48] chore: add indentation Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c index a118c71b2ee1..fbda3e897520 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c @@ -61,7 +61,7 @@ void API_SUFFIX(c_dsyr_ndarray)( const CBLAS_UPLO uplo, const CBLAS_INT N, const X += stdlib_strided_min_view_buffer_index( N, strideX, offsetX ); // adjust array pointer const int64_t shape[] = { N, N }; const int64_t strides[] = { strideA1, strideA2 }; - A += stdlib_ndarray_min_view_buffer_index( 2, shape, strides, offsetA); // adjust array pointer + A += stdlib_ndarray_min_view_buffer_index( 2, shape, strides, offsetA ); // adjust array pointer if ( sx < 0 ) { sx = -sx; } From f93b8a78a00a30f0aa5f7cecd4fb396904cb6f30 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Fri, 30 May 2025 17:07:33 +0530 Subject: [PATCH 12/48] 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: 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: missing_dependencies - 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 --- --- .../blas/base/dsyr/benchmark/c/benchmark.c | 1 - .../@stdlib/blas/base/dsyr/manifest.json | 201 +++++++++++++++--- 2 files changed, 177 insertions(+), 25 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c index 80bdea3c21f0..89878c17d8e4 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c @@ -18,7 +18,6 @@ #include "stdlib/blas/base/dsyr.h" #include "stdlib/blas/base/shared.h" -#include "stdlib/blas/ext/base/sfill.h" #include #include #include diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json b/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json index 617430d6e282..f35efa13e257 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json +++ b/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json @@ -1,3 +1,4 @@ + { "options": { "task": "build", @@ -30,7 +31,75 @@ "confs": [ { "task": "build", - "os": "win", + "os": "linux", + "blas": "", + "wasm": false, + "src": [ + "./src/dsyr.c", + "./src/dsyr_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major", + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-int32", + "@stdlib/napi/argv-double", + "@stdlib/napi/argv-strided-float64array", + "@stdlib/napi/argv-strided-float64array2d" + ] + }, + { + "task": "benchmark", + "os": "linux", + "blas": "", + "wasm": false, + "src": [ + "./src/dsyr.c", + "./src/dsyr_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major" + ] + }, + { + "task": "examples", + "os": "linux", + "blas": "", + "wasm": false, + "src": [ + "./src/dsyr.c", + "./src/dsyr_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major" + ] + }, + + { + "task": "build", + "os": "linux", "blas": "openblas", "wasm": false, "src": [ @@ -46,18 +115,20 @@ "libpath": [], "dependencies": [ "@stdlib/blas/base/shared", + "@stdlib/strided/base/min-view-buffer-index", + "@stdlib/ndarray/base/min-view-buffer-index", "@stdlib/napi/export", "@stdlib/napi/argv", "@stdlib/napi/argv-int64", "@stdlib/napi/argv-int32", + "@stdlib/napi/argv-double", "@stdlib/napi/argv-strided-float64array", - "@stdlib/napi/argv-strided-float64array2d", - "@stdlib/napi/argv-double" + "@stdlib/napi/argv-strided-float64array2d" ] }, { "task": "benchmark", - "os": "win", + "os": "linux", "blas": "openblas", "wasm": false, "src": [ @@ -72,12 +143,14 @@ ], "libpath": [], "dependencies": [ - "@stdlib/blas/base/shared" + "@stdlib/blas/base/shared", + "@stdlib/strided/base/min-view-buffer-index", + "@stdlib/ndarray/base/min-view-buffer-index" ] }, { "task": "examples", - "os": "win", + "os": "linux", "blas": "openblas", "wasm": false, "src": [ @@ -92,7 +165,77 @@ ], "libpath": [], "dependencies": [ - "@stdlib/blas/base/shared" + "@stdlib/blas/base/shared", + "@stdlib/strided/base/min-view-buffer-index", + "@stdlib/ndarray/base/min-view-buffer-index" + ] + }, + + { + "task": "build", + "os": "mac", + "blas": "", + "wasm": false, + "src": [ + "./src/dsyr.c", + "./src/dsyr_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major", + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-int32", + "@stdlib/napi/argv-double", + "@stdlib/napi/argv-strided-float64array", + "@stdlib/napi/argv-strided-float64array2d" + ] + }, + { + "task": "benchmark", + "os": "mac", + "blas": "", + "wasm": false, + "src": [ + "./src/dsyr.c", + "./src/dsyr_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major" + ] + }, + { + "task": "examples", + "os": "mac", + "blas": "", + "wasm": false, + "src": [ + "./src/dsyr.c", + "./src/dsyr_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major" ] }, @@ -113,13 +256,15 @@ "libpath": [], "dependencies": [ "@stdlib/blas/base/shared", + "@stdlib/strided/base/min-view-buffer-index", + "@stdlib/ndarray/base/min-view-buffer-index", "@stdlib/napi/export", "@stdlib/napi/argv", "@stdlib/napi/argv-int64", "@stdlib/napi/argv-int32", + "@stdlib/napi/argv-double", "@stdlib/napi/argv-strided-float64array", - "@stdlib/napi/argv-strided-float64array2d", - "@stdlib/napi/argv-double" + "@stdlib/napi/argv-strided-float64array2d" ] }, { @@ -138,7 +283,9 @@ ], "libpath": [], "dependencies": [ - "@stdlib/blas/base/shared" + "@stdlib/blas/base/shared", + "@stdlib/strided/base/min-view-buffer-index", + "@stdlib/ndarray/base/min-view-buffer-index" ] }, { @@ -157,7 +304,9 @@ ], "libpath": [], "dependencies": [ - "@stdlib/blas/base/shared" + "@stdlib/blas/base/shared", + "@stdlib/strided/base/min-view-buffer-index", + "@stdlib/ndarray/base/min-view-buffer-index" ] }, @@ -179,13 +328,15 @@ "libpath": [], "dependencies": [ "@stdlib/blas/base/shared", + "@stdlib/strided/base/min-view-buffer-index", + "@stdlib/ndarray/base/min-view-buffer-index", "@stdlib/napi/export", "@stdlib/napi/argv", "@stdlib/napi/argv-int64", "@stdlib/napi/argv-int32", + "@stdlib/napi/argv-double", "@stdlib/napi/argv-strided-float64array", - "@stdlib/napi/argv-strided-float64array2d", - "@stdlib/napi/argv-double" + "@stdlib/napi/argv-strided-float64array2d" ] }, { @@ -205,7 +356,9 @@ ], "libpath": [], "dependencies": [ - "@stdlib/blas/base/shared" + "@stdlib/blas/base/shared", + "@stdlib/strided/base/min-view-buffer-index", + "@stdlib/ndarray/base/min-view-buffer-index" ] }, { @@ -225,13 +378,15 @@ ], "libpath": [], "dependencies": [ - "@stdlib/blas/base/shared" + "@stdlib/blas/base/shared", + "@stdlib/strided/base/min-view-buffer-index", + "@stdlib/ndarray/base/min-view-buffer-index" ] }, { "task": "build", - "os": "linux", + "os": "win", "blas": "", "wasm": false, "src": [ @@ -245,20 +400,20 @@ "libpath": [], "dependencies": [ "@stdlib/blas/base/shared", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major", "@stdlib/napi/export", "@stdlib/napi/argv", "@stdlib/napi/argv-int64", "@stdlib/napi/argv-int32", - "@stdlib/napi/argv-strided-float64array", - "@stdlib/napi/argv-strided-float64array2d", "@stdlib/napi/argv-double", - "@stdlib/strided/base/stride2offset", - "@stdlib/ndarray/base/assert/is-row-major" + "@stdlib/napi/argv-strided-float64array", + "@stdlib/napi/argv-strided-float64array2d" ] }, { "task": "benchmark", - "os": "linux", + "os": "win", "blas": "", "wasm": false, "src": [ @@ -272,15 +427,13 @@ "libpath": [], "dependencies": [ "@stdlib/blas/base/shared", - "@stdlib/blas/ext/base/sfill", - "@stdlib/math/base/special/floor", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] }, { "task": "examples", - "os": "linux", + "os": "win", "blas": "", "wasm": false, "src": [ From 149b5d9af7a4e387a9d0ad0868889aba47c14e29 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Fri, 30 May 2025 17:13:55 +0530 Subject: [PATCH 13/48] 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: 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: missing_dependencies - 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 --- --- .../blas/base/dsyr/benchmark/c/benchmark.c | 9 +++++---- .../@stdlib/blas/base/dsyr/manifest.json | 18 ++++++++++++------ 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c index 89878c17d8e4..8c904cc9b9fd 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c @@ -18,6 +18,7 @@ #include "stdlib/blas/base/dsyr.h" #include "stdlib/blas/base/shared.h" +#include "stdlib/blas/ext/base/dfill.h" #include #include #include @@ -92,8 +93,8 @@ static double benchmark1( int iterations, int N ) { double t; int i; - stdlib_strided_sfill( N, 0.5, x, 1 ); - stdlib_strided_sfill( N*N, 1.0, A, 1 ); + stdlib_strided_dfill( N, 0.5, x, 1 ); + stdlib_strided_dfill( N*N, 1.0, A, 1 ); t = tic(); for ( i = 0; i < iterations; i++ ) { c_dsyr( CblasRowMajor, CblasUpper, N, 1.0, x, 1, A, N ); @@ -123,8 +124,8 @@ static double benchmark2( int iterations, int N ) { double t; int i; - stdlib_strided_sfill( N, 0.5, x, 1 ); - stdlib_strided_sfill( N*N, 1.0, A, 1 ); + stdlib_strided_dfill( N, 0.5, x, 1 ); + stdlib_strided_dfill( N*N, 1.0, A, 1 ); t = tic(); for ( i = 0; i < iterations; i++ ) { c_dsyr_ndarray( CblasUpper, N, 1.0, x, 1, 0, A, N, 1, 0 ); diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json b/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json index f35efa13e257..6534108f9901 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json +++ b/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json @@ -73,7 +73,8 @@ "dependencies": [ "@stdlib/blas/base/shared", "@stdlib/strided/base/stride2offset", - "@stdlib/ndarray/base/assert/is-row-major" + "@stdlib/ndarray/base/assert/is-row-major", + "@stdlib/blas/ext/base/dfill" ] }, { @@ -145,7 +146,8 @@ "dependencies": [ "@stdlib/blas/base/shared", "@stdlib/strided/base/min-view-buffer-index", - "@stdlib/ndarray/base/min-view-buffer-index" + "@stdlib/ndarray/base/min-view-buffer-index", + "@stdlib/blas/ext/base/dfill" ] }, { @@ -215,7 +217,8 @@ "dependencies": [ "@stdlib/blas/base/shared", "@stdlib/strided/base/stride2offset", - "@stdlib/ndarray/base/assert/is-row-major" + "@stdlib/ndarray/base/assert/is-row-major", + "@stdlib/blas/ext/base/dfill" ] }, { @@ -285,7 +288,8 @@ "dependencies": [ "@stdlib/blas/base/shared", "@stdlib/strided/base/min-view-buffer-index", - "@stdlib/ndarray/base/min-view-buffer-index" + "@stdlib/ndarray/base/min-view-buffer-index", + "@stdlib/blas/ext/base/dfill" ] }, { @@ -358,7 +362,8 @@ "dependencies": [ "@stdlib/blas/base/shared", "@stdlib/strided/base/min-view-buffer-index", - "@stdlib/ndarray/base/min-view-buffer-index" + "@stdlib/ndarray/base/min-view-buffer-index", + "@stdlib/blas/ext/base/dfill" ] }, { @@ -428,7 +433,8 @@ "dependencies": [ "@stdlib/blas/base/shared", "@stdlib/strided/base/stride2offset", - "@stdlib/ndarray/base/assert/is-row-major" + "@stdlib/ndarray/base/assert/is-row-major", + "@stdlib/blas/ext/base/dfill" ] }, { From d0b30b1a92e4db864ac14ab0a88bb59877bf8585 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Fri, 30 May 2025 17:30:34 +0530 Subject: [PATCH 14/48] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/dsyr/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/README.md b/lib/node_modules/@stdlib/blas/base/dsyr/README.md index dbfe5131e9e4..c1bcb2854fe5 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/README.md +++ b/lib/node_modules/@stdlib/blas/base/dsyr/README.md @@ -47,7 +47,7 @@ dsyr( 'row-major', 'upper', 3, 1.0, x, 1, A, 3 ); The function has the following parameters: - **order**: storage layout. -- **uplo**: specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced. +- **uplo**: specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied. - **N**: number of elements along each dimension of `A`. - **α**: scalar constant. - **x**: input [`Float64Array`][mdn-float64array]. @@ -202,7 +202,7 @@ c_dsyr( CblasColMajor, CblasUpper, 3, 1.0, x, 1, A, 3 ); The function accepts the following arguments: - **order**: `[in] CBLAS_LAYOUT` storage layout. -- **uplo**: `[in] CBLAS_UPLO` specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced. +- **uplo**: `[in] CBLAS_UPLO` specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied. - **N**: `[in] CBLAS_INT` number of elements along each dimension of `A`. - **alpha**: `[in] double` scalar. - **X**: `[in] double*` input array. @@ -229,7 +229,7 @@ c_dsyr_ndarray( CblasUpper, 3, 1.0, x, 1, 0, A, 3, 1, 0 ); The function accepts the following arguments: -- **uplo**: `[in] CBLAS_UPLO` specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced. +- **uplo**: `[in] CBLAS_UPLO` specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied. - **N**: `[in] CBLAS_INT` number of elements along each dimension of `A`. - **alpha**: `[in] double` scalar. - **X**: `[in] double*` input array. From aef4a1d515d94d61e9bae8d7f30feb88018bbba0 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Fri, 30 May 2025 17:58:03 +0530 Subject: [PATCH 15/48] remove: whitespace Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/dsyr/manifest.json | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json b/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json index 6534108f9901..5240f72e65b7 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json +++ b/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json @@ -1,4 +1,3 @@ - { "options": { "task": "build", From 291cee50ba933b59947c73bd67138cdedf18f09e Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Sat, 28 Jun 2025 13:32:23 +0530 Subject: [PATCH 16/48] chore: clean-up --- 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: 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: missing_dependencies - task: lint_c_examples status: na - task: lint_c_benchmarks status: missing_dependencies - 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/blas/base/dsyr/README.md | 4 +-- .../blas/base/dsyr/benchmark/c/benchmark.c | 12 +++---- .../base/dsyr/include/stdlib/blas/base/dsyr.h | 4 +-- .../include/stdlib/blas/base/dsyr_cblas.h | 2 +- .../@stdlib/blas/base/dsyr/lib/dsyr.native.js | 4 +-- .../blas/base/dsyr/lib/ndarray.native.js | 4 +-- .../@stdlib/blas/base/dsyr/src/addon.c | 13 ++++++- .../@stdlib/blas/base/dsyr/src/dsyr.c | 4 +-- .../@stdlib/blas/base/dsyr/src/dsyr_cblas.c | 36 ++----------------- .../@stdlib/blas/base/dsyr/src/dsyr_ndarray.c | 4 +-- 10 files changed, 34 insertions(+), 53 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/README.md b/lib/node_modules/@stdlib/blas/base/dsyr/README.md index c1bcb2854fe5..7b5d635f03a3 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/README.md +++ b/lib/node_modules/@stdlib/blas/base/dsyr/README.md @@ -188,7 +188,7 @@ console.log( A ); #### c_dsyr( order, uplo, N, alpha, \*X, strideX, \*A, LDA ) -Performs the symmetric rank 1 operation `A = α*x*x^T + A`. +Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. ```c #include "stdlib/blas/base/shared.h" @@ -216,7 +216,7 @@ void c_dsyr( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N, #### c_dsyr_ndarray( uplo, N, alpha, \*X, strideX, offsetX, \*A, sa1, sa2, oa ) -Performs the symmetric rank 1 operation `A = α*x*x^T + A` using alternative indexing semantics. +Performs the symmetric rank 1 operation `A = α*x*x^T + A`, using alternative indexing semantics and where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. ```c #include "stdlib/blas/base/shared.h" diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c index 8c904cc9b9fd..2e189a6c19ee 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c @@ -93,18 +93,18 @@ static double benchmark1( int iterations, int N ) { double t; int i; - stdlib_strided_dfill( N, 0.5, x, 1 ); + stdlib_strided_dfill( N, 1.0, x, 1 ); stdlib_strided_dfill( N*N, 1.0, A, 1 ); t = tic(); for ( i = 0; i < iterations; i++ ) { c_dsyr( CblasRowMajor, CblasUpper, N, 1.0, x, 1, A, N ); - if ( A[ 0 ] != A[ 0 ] ) { + if ( A[ i%(N*2) ] != A[ i%(N*2) ] ) { printf( "should not return NaN\n" ); break; } } elapsed = tic() - t; - if ( A[ 0 ] != A[ 0 ] ) { + if ( A[ i%(N*2) ] != A[ i%(N*2) ] ) { printf( "should not return NaN\n" ); } return elapsed; @@ -124,18 +124,18 @@ static double benchmark2( int iterations, int N ) { double t; int i; - stdlib_strided_dfill( N, 0.5, x, 1 ); + stdlib_strided_dfill( N, 1.0, x, 1 ); stdlib_strided_dfill( N*N, 1.0, A, 1 ); t = tic(); for ( i = 0; i < iterations; i++ ) { c_dsyr_ndarray( CblasUpper, N, 1.0, x, 1, 0, A, N, 1, 0 ); - if ( A[ 0 ] != A[ 0 ] ) { + if ( A[ i%(N*2) ] != A[ i%(N*2) ] ) { printf( "should not return NaN\n" ); break; } } elapsed = tic() - t; - if ( A[ 0 ] != A[ 0 ] ) { + if ( A[ i%(N*2) ] != A[ i%(N*2) ] ) { printf( "should not return NaN\n" ); } return elapsed; diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr.h b/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr.h index 8d192bc4007d..c14a64568689 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr.h +++ b/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr.h @@ -32,12 +32,12 @@ extern "C" { #endif /** -* Performs the symmetric rank 1 operation `A = α*x*x^T + A`. +* Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. */ void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *A, const CBLAS_INT LDA ); /** -* Performs the symmetric rank 1 operation `A = α*x*x^T + A` using alternative indexing semantics. +* Performs the symmetric rank 1 operation `A = α*x*x^T + A`, using alternative indexing semantics and where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. */ void API_SUFFIX(c_dsyr_ndarray)( const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, double *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA ); diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h b/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h index 30b78d21b2a1..e70ce7a45576 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h +++ b/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h @@ -32,7 +32,7 @@ extern "C" { #endif /** -* Performs the symmetric rank 1 operation `A = α*x*x^T + A`. +* Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. */ void API_SUFFIX(cblas_dsyr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *A, const CBLAS_INT LDA ); diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.native.js index 47d2292e7306..446854a522af 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.native.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.native.js @@ -28,10 +28,10 @@ var addon = require( './../src/addon.node' ); // MAIN // /** -* Performs the symmetric rank 1 operation `A = α*x*x^T + A`. +* Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. * * @param {string} order - storage layout -* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced +* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied * @param {NonNegativeInteger} N - number of elements along each dimension of `A` * @param {number} alpha - scalar * @param {Float64Array} x - input vector diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js index 72bd9717561e..32c23a3b00b0 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js @@ -27,9 +27,9 @@ var addon = require( './../src/addon.node' ); // MAIN // /** -* Performs the symmetric rank 1 operation `A = α*x*x^T + A`. +* Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. * -* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced +* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied * @param {NonNegativeInteger} N - number of elements along each dimension of `A` * @param {number} alpha - scalar * @param {Float64Array} x - input vector diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c index fe6089114973..32747907dd81 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c @@ -35,6 +35,9 @@ * @return Node-API value */ static napi_value addon( napi_env env, napi_callback_info info ) { + CBLAS_INT sa1; + CBLAS_INT sa2; + STDLIB_NAPI_ARGV( env, info, argv, argc, 8 ); STDLIB_NAPI_ARGV_INT32( env, order, argv, 0 ); @@ -46,8 +49,16 @@ static napi_value addon( napi_env env, napi_callback_info info ) { STDLIB_NAPI_ARGV_DOUBLE( env, alpha, argv, 3 ); + if ( order == CblasColMajor ) { + sa1 = 1; + sa2 = LDA; + } else { // order === 'row-major' + sa1 = LDA; + sa2 = 1; + } + STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 4 ); - STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, A, ((N-1)*LDA) + N, 1, argv, 6 ); + STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY2D( env, A, N, N, sa1, sa2, argv, 6 ); API_SUFFIX(c_dsyr)( order, uplo, N, alpha, X, strideX, A, LDA ); diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c index 5adaccfc1e63..ddcda9eb8c5f 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c @@ -21,10 +21,10 @@ #include "stdlib/strided/base/stride2offset.h" /** -* Performs the symmetric rank 1 operation `A = α*x*x^T + A`. +* Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. * * @param order storage layout -* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced +* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied * @param N number of elements along each dimension of `A` * @param alpha scalar * @param X input vector diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c index fbda3e897520..2319d96f7e20 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c @@ -23,10 +23,10 @@ #include "stdlib/ndarray/base/min_view_buffer_index.h" /** -* Performs the symmetric rank 1 operation `A = α*x*x^T + A`. +* Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. * * @param order storage layout -* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced +* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied * @param N number of elements along each dimension of `A` * @param alpha scalar * @param x input vector @@ -35,35 +35,5 @@ * @param LDA stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) */ void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *A, const CBLAS_INT LDA ) { - CBLAS_INT sx = strideX; - if ( sx < 0 ) { - sx = -sx; - } - API_SUFFIX(cblas_dsyr)( order, uplo, N, alpha, X, sx, A, LDA ); -} - -/** -* Performs the symmetric rank 1 operation `A = α*x*x^T + A` using alternative indexing semantics. -* -* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced -* @param N number of elements along each dimension of `A` -* @param alpha scalar -* @param X input vector -* @param strideX `x` stride length -* @param offsetX starting index for `x` -* @param A input matrix -* @param strideA1 stride of the first dimension of `A` -* @param strideA2 stride of the second dimension of `A` -* @param offsetA starting index for `A` -*/ -void API_SUFFIX(c_dsyr_ndarray)( const CBLAS_UPLO uplo, const CBLAS_INT N, const float alpha, const float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, float *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA ) { - CBLAS_INT sx = strideX; - X += stdlib_strided_min_view_buffer_index( N, strideX, offsetX ); // adjust array pointer - const int64_t shape[] = { N, N }; - const int64_t strides[] = { strideA1, strideA2 }; - A += stdlib_ndarray_min_view_buffer_index( 2, shape, strides, offsetA ); // adjust array pointer - if ( sx < 0 ) { - sx = -sx; - } - API_SUFFIX(cblas_dsyr)( order, uplo, N, alpha, X, sx, A, LDA ); + API_SUFFIX(cblas_dsyr)( order, uplo, N, alpha, X, strideX, A, LDA ); } diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c index b55826364224..1fe873093160 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c @@ -21,9 +21,9 @@ #include "stdlib/ndarray/base/assert/is_row_major.h" /** -* Performs the symmetric rank 1 operation `A = α*x*x^T + A` using alternative indexing semantics. +* Performs the symmetric rank 1 operation `A = α*x*x^T + A`, using alternative indexing semantics and where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. * -* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced +* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied * @param N number of elements along each dimension of `A` * @param alpha scalar * @param X input vector From 51b7a4b7838cf06be39ee4a8279753d505c4b190 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Sat, 28 Jun 2025 15:38:17 +0530 Subject: [PATCH 17/48] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- .../include/stdlib/blas/base/dsyr_cblas.h | 62 +++++++++++++------ 1 file changed, 44 insertions(+), 18 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h b/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h index e70ce7a45576..ed03a9e0a86f 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h +++ b/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h @@ -16,28 +16,54 @@ * limitations under the License. */ -/** -* Header file containing function declarations for the C interface to the CBLAS Level 2 routine `cblas_dsyr`. -*/ -#ifndef DSYR_CBLAS_H -#define DSYR_CBLAS_H - +#include "stdlib/blas/base/dsyr.h" +#include "stdlib/blas/base/dsyr_cblas.h" #include "stdlib/blas/base/shared.h" - -/* -* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. -*/ -#ifdef __cplusplus -extern "C" { -#endif +#include "stdlib/strided/base/min_view_buffer_index.h" +#include "stdlib/ndarray/base/min_view_buffer_index.h" /** * Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. +* +* @param order storage layout +* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied +* @param N number of elements along each dimension of `A` +* @param alpha scalar +* @param x input vector +* @param strideX `X` stride length +* @param A input matrix +* @param LDA stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) */ -void API_SUFFIX(cblas_dsyr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *A, const CBLAS_INT LDA ); - -#ifdef __cplusplus +void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *A, const CBLAS_INT LDA ) { + CBLAS_INT sx = strideX; + if ( sx < 0 ) { + sx = -sx; + } + API_SUFFIX(cblas_dsyr)( order, uplo, N, alpha, X, sx, AP ); } -#endif -#endif // !DSYR_CBLAS_H +/** +* Performs the symmetric rank 1 operation `A = α*x*x^T + A`, using alternative indexing semantics and where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. +* +* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied +* @param N number of elements along each dimension of `A` +* @param alpha scalar +* @param X input vector +* @param strideX `x` stride length +* @param offsetX starting index for `x` +* @param A input matrix +* @param strideA1 stride of the first dimension of `A` +* @param strideA2 stride of the second dimension of `A` +* @param offsetA starting index for `AP` +*/ +void API_SUFFIX(c_dsyr_ndarray)( const CBLAS_UPLO uplo, const CBLAS_INT N, const float alpha, const float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, float *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA ) { + CBLAS_INT sx = strideX; + X += stdlib_strided_min_view_buffer_index( N, strideX, offsetX ); // adjust array pointer + CBLAS_INT shape[] = { N, N }; + CBLAS_INT strides[] = { strideA1, strideA2 }; + A += stdlib_ndarray_min_view_buffer_index( 2, shape, strides, offsetA); // adjust array pointer + if ( sx < 0 ) { + sx = -sx; + } + API_SUFFIX(cblas_dsyr)( uplo, N, alpha, X, sx, offsetX, A, strideA1, strideA2, offsetA ); +} From aecaa92e9c5582e22d775ee727eb8a7e045bb381 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Sat, 28 Jun 2025 15:42:18 +0530 Subject: [PATCH 18/48] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- .../blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h b/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h index ed03a9e0a86f..bc17546ef788 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h +++ b/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h @@ -39,7 +39,7 @@ void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const if ( sx < 0 ) { sx = -sx; } - API_SUFFIX(cblas_dsyr)( order, uplo, N, alpha, X, sx, AP ); + API_SUFFIX(cblas_dsyr)( order, uplo, N, alpha, X, sx, A, LDA ); } /** @@ -65,5 +65,5 @@ void API_SUFFIX(c_dsyr_ndarray)( const CBLAS_UPLO uplo, const CBLAS_INT N, const if ( sx < 0 ) { sx = -sx; } - API_SUFFIX(cblas_dsyr)( uplo, N, alpha, X, sx, offsetX, A, strideA1, strideA2, offsetA ); + API_SUFFIX(cblas_dsyr)( order, uplo, N, alpha, X, sx, A, LDA ); } From add2333b80153c33db085d417fa20010fb300507 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Sat, 28 Jun 2025 15:49:29 +0530 Subject: [PATCH 19/48] c Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c index 1fe873093160..5a77b165608d 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c @@ -80,7 +80,7 @@ void API_SUFFIX(c_dsyr_ndarray)( const CBLAS_UPLO uplo, const CBLAS_INT N, const } return; } - // ( isrm && uplo == 'CblasUpper' ) || ( !isrm && uplo === 'CblasLower' ) + // ( isrm && uplo == CblasUpper ) || ( !isrm && uplo === CblasLower ) ix1 = ox; for ( i1 = 0; i1 < N; i1++ ) { if ( X[ ix1 ] != 0.0 ) { From 6c831d5fa28f0dde9ef4e22fd473e27ea4956d00 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Sat, 28 Jun 2025 15:59:43 +0530 Subject: [PATCH 20/48] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- .../include/stdlib/blas/base/dsyr_cblas.h | 62 ++++++------------- 1 file changed, 18 insertions(+), 44 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h b/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h index bc17546ef788..e70ce7a45576 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h +++ b/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h @@ -16,54 +16,28 @@ * limitations under the License. */ -#include "stdlib/blas/base/dsyr.h" -#include "stdlib/blas/base/dsyr_cblas.h" +/** +* Header file containing function declarations for the C interface to the CBLAS Level 2 routine `cblas_dsyr`. +*/ +#ifndef DSYR_CBLAS_H +#define DSYR_CBLAS_H + #include "stdlib/blas/base/shared.h" -#include "stdlib/strided/base/min_view_buffer_index.h" -#include "stdlib/ndarray/base/min_view_buffer_index.h" -/** -* Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. -* -* @param order storage layout -* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied -* @param N number of elements along each dimension of `A` -* @param alpha scalar -* @param x input vector -* @param strideX `X` stride length -* @param A input matrix -* @param LDA stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +/* +* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. */ -void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *A, const CBLAS_INT LDA ) { - CBLAS_INT sx = strideX; - if ( sx < 0 ) { - sx = -sx; - } - API_SUFFIX(cblas_dsyr)( order, uplo, N, alpha, X, sx, A, LDA ); -} +#ifdef __cplusplus +extern "C" { +#endif /** -* Performs the symmetric rank 1 operation `A = α*x*x^T + A`, using alternative indexing semantics and where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. -* -* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied -* @param N number of elements along each dimension of `A` -* @param alpha scalar -* @param X input vector -* @param strideX `x` stride length -* @param offsetX starting index for `x` -* @param A input matrix -* @param strideA1 stride of the first dimension of `A` -* @param strideA2 stride of the second dimension of `A` -* @param offsetA starting index for `AP` +* Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. */ -void API_SUFFIX(c_dsyr_ndarray)( const CBLAS_UPLO uplo, const CBLAS_INT N, const float alpha, const float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, float *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA ) { - CBLAS_INT sx = strideX; - X += stdlib_strided_min_view_buffer_index( N, strideX, offsetX ); // adjust array pointer - CBLAS_INT shape[] = { N, N }; - CBLAS_INT strides[] = { strideA1, strideA2 }; - A += stdlib_ndarray_min_view_buffer_index( 2, shape, strides, offsetA); // adjust array pointer - if ( sx < 0 ) { - sx = -sx; - } - API_SUFFIX(cblas_dsyr)( order, uplo, N, alpha, X, sx, A, LDA ); +void API_SUFFIX(cblas_dsyr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *A, const CBLAS_INT LDA ); + +#ifdef __cplusplus } +#endif + +#endif // !DSYR_CBLAS_H From 81acffa01a7ebb36e38a37f3042a714fc3043309 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Sat, 28 Jun 2025 16:00:54 +0530 Subject: [PATCH 21/48] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- .../@stdlib/blas/base/dsyr/src/dsyr_cblas.c | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c index 2319d96f7e20..bc17546ef788 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c @@ -35,5 +35,35 @@ * @param LDA stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) */ void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *A, const CBLAS_INT LDA ) { - API_SUFFIX(cblas_dsyr)( order, uplo, N, alpha, X, strideX, A, LDA ); + CBLAS_INT sx = strideX; + if ( sx < 0 ) { + sx = -sx; + } + API_SUFFIX(cblas_dsyr)( order, uplo, N, alpha, X, sx, A, LDA ); +} + +/** +* Performs the symmetric rank 1 operation `A = α*x*x^T + A`, using alternative indexing semantics and where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. +* +* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied +* @param N number of elements along each dimension of `A` +* @param alpha scalar +* @param X input vector +* @param strideX `x` stride length +* @param offsetX starting index for `x` +* @param A input matrix +* @param strideA1 stride of the first dimension of `A` +* @param strideA2 stride of the second dimension of `A` +* @param offsetA starting index for `AP` +*/ +void API_SUFFIX(c_dsyr_ndarray)( const CBLAS_UPLO uplo, const CBLAS_INT N, const float alpha, const float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, float *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA ) { + CBLAS_INT sx = strideX; + X += stdlib_strided_min_view_buffer_index( N, strideX, offsetX ); // adjust array pointer + CBLAS_INT shape[] = { N, N }; + CBLAS_INT strides[] = { strideA1, strideA2 }; + A += stdlib_ndarray_min_view_buffer_index( 2, shape, strides, offsetA); // adjust array pointer + if ( sx < 0 ) { + sx = -sx; + } + API_SUFFIX(cblas_dsyr)( order, uplo, N, alpha, X, sx, A, LDA ); } From 93409ab2c092194c1bb4526b71cbd2d66f556f6a Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Sat, 28 Jun 2025 16:12:46 +0530 Subject: [PATCH 22/48] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c index bc17546ef788..78473569a599 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c @@ -59,8 +59,8 @@ void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const void API_SUFFIX(c_dsyr_ndarray)( const CBLAS_UPLO uplo, const CBLAS_INT N, const float alpha, const float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, float *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA ) { CBLAS_INT sx = strideX; X += stdlib_strided_min_view_buffer_index( N, strideX, offsetX ); // adjust array pointer - CBLAS_INT shape[] = { N, N }; - CBLAS_INT strides[] = { strideA1, strideA2 }; + const shape[] = { N, N }; + const strides[] = { strideA1, strideA2 }; A += stdlib_ndarray_min_view_buffer_index( 2, shape, strides, offsetA); // adjust array pointer if ( sx < 0 ) { sx = -sx; From 15f4a2886f9e46bbb431ceedf2768254c6ff95fe Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Sat, 28 Jun 2025 16:14:02 +0530 Subject: [PATCH 23/48] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c b/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c index 0ecb27a64801..dd53323775f1 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c @@ -36,7 +36,7 @@ int main( void ) { printf( "A[ %i ] = %f\n", i, A[ i ] ); } - // Perform the symmetric rank 1 operation `A = α*x*x^T + A`: + // Perform the symmetric rank 1 operation `A = α*x*x^T + A` using alternative semantics indexing: c_dsyr_ndarray( CblasUpper, N, 1.0, x, 1, 0, A, N, 1, 0 ); // Print the result: From 893a3368392718e4a8e4d1e4e9dbf696b4867e06 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Sat, 28 Jun 2025 16:14:54 +0530 Subject: [PATCH 24/48] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/dsyr/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/README.md b/lib/node_modules/@stdlib/blas/base/dsyr/README.md index 7b5d635f03a3..9cb19f42f717 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/README.md +++ b/lib/node_modules/@stdlib/blas/base/dsyr/README.md @@ -283,7 +283,7 @@ int main( void ) { printf( "A[ %i ] = %f\n", i, A[ i ] ); } - // Perform the symmetric rank 1 operation `A = α*x*x^T + A`: + // Perform the symmetric rank 1 operation `A = α*x*x^T + A` using alternative semantics indexing: c_dsyr_ndarray( CblasUpper, N, 1.0, x, 1, 0, A, N, 1, 0 ); // Print the result: From 1e78d95f3710fc29a8d3a941f0d66a93cfbd3244 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Sat, 28 Jun 2025 17:15:46 +0530 Subject: [PATCH 25/48] chore: minor clean-up\ Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c index 32747907dd81..28faac8f10d6 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c @@ -52,7 +52,7 @@ static napi_value addon( napi_env env, napi_callback_info info ) { if ( order == CblasColMajor ) { sa1 = 1; sa2 = LDA; - } else { // order === 'row-major' + } else { // order === CblasRowMajor sa1 = LDA; sa2 = 1; } From f3bbcea90619263778c04d88ba9bb218283a8b74 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Sat, 28 Jun 2025 17:20:02 +0530 Subject: [PATCH 26/48] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c index ddcda9eb8c5f..c6f211408b1c 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c @@ -43,7 +43,7 @@ void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const if ( order == CblasColMajor ) { sa1 = 1; sa2 = LDA; - } else { // order === 'row-major' + } else { // order === CblasRowMajor sa1 = LDA; sa2 = 1; } From 8d5d2e7676f3cded80723448ed8499eefc5652aa Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Sun, 29 Jun 2025 10:55:55 +0530 Subject: [PATCH 27/48] chore: add checks --- 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: missing_dependencies - 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/blas/base/dsyr/manifest.json | 10 ++++++++ .../@stdlib/blas/base/dsyr/src/dsyr.c | 23 ++++++++++++++++++ .../@stdlib/blas/base/dsyr/src/dsyr_ndarray.c | 24 +++++++++++++++++-- 3 files changed, 55 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json b/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json index 5240f72e65b7..d467d3f06eee 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json +++ b/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json @@ -44,6 +44,7 @@ "libpath": [], "dependencies": [ "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major", "@stdlib/napi/export", @@ -71,6 +72,7 @@ "libpath": [], "dependencies": [ "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major", "@stdlib/blas/ext/base/dfill" @@ -92,6 +94,7 @@ "libpath": [], "dependencies": [ "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] @@ -188,6 +191,7 @@ "libpath": [], "dependencies": [ "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major", "@stdlib/napi/export", @@ -215,6 +219,7 @@ "libpath": [], "dependencies": [ "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major", "@stdlib/blas/ext/base/dfill" @@ -236,6 +241,7 @@ "libpath": [], "dependencies": [ "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] @@ -404,6 +410,7 @@ "libpath": [], "dependencies": [ "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major", "@stdlib/napi/export", @@ -431,6 +438,7 @@ "libpath": [], "dependencies": [ "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major", "@stdlib/blas/ext/base/dfill" @@ -452,6 +460,7 @@ "libpath": [], "dependencies": [ "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] @@ -473,6 +482,7 @@ "libpath": [], "dependencies": [ "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", "@stdlib/strided/base/stride2offset", "@stdlib/ndarray/base/assert/is-row-major" ] diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c index c6f211408b1c..0ad4103d13b0 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c @@ -18,6 +18,7 @@ #include "stdlib/blas/base/dsyr.h" #include "stdlib/blas/base/shared.h" +#include "stdlib/blas/base/xerbla.h" #include "stdlib/strided/base/stride2offset.h" /** @@ -37,6 +38,28 @@ void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT sa2; CBLAS_INT ox; + // Perform input argument validation... + if ( order != CblasRowMajor && order != CblasColMajor ) { + c_xerbla( 1, "c_dsyr", "Error: invalid argument. First argument must be a valid order. Value: `%d`.", order ); + return; + } + if ( uplo != CblasLower && uplo != CblasUpper ) { + c_xerbla( 2, "c_dsyr", "Error: invalid argument. Second argument must specify whether to reference the lower or upper triangular matrixecond argument must specify whether to reference the lower or upper triangular matrix. Value: `%d`.", uplo ); + return; + } + if ( N < 0 ) { + c_xerbla( 3, "c_dsyr", "Error: invalid argument. Third argument must be a nonnegative integer. Value: `%d`.", N ); + return; + } + if ( strideX == 0 ) { + c_xerbla( 6, "c_dsyr", "Error: invalid argument. Sixth argument must be nonzero. Value: `%d`.", strideX ); + return; + } + if ( LDA < N ) { + c_xerbla( 10, "c_dsyr", "Error: invalid argument. Eighth argument must be greater than or equal to max(1,%d). Value: `%d`.", N, LDA ); + return; + } + // Check whether we can avoid computation altogether... if ( N == 0 || alpha == 0.0 ) { return; } diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c index 5a77b165608d..5c30646dcb20 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c @@ -18,6 +18,7 @@ #include "stdlib/blas/base/dsyr.h" #include "stdlib/blas/base/shared.h" +#include "stdlib/blas/base/xerbla.h" #include "stdlib/ndarray/base/assert/is_row_major.h" /** @@ -35,6 +36,7 @@ * @param offsetA starting index of `A` */ void API_SUFFIX(c_dsyr_ndarray)( const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, double *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA ) { + int64_t sa[ 2 ]; CBLAS_INT isrm; CBLAS_INT ix0; CBLAS_INT ix1; @@ -46,11 +48,29 @@ void API_SUFFIX(c_dsyr_ndarray)( const CBLAS_UPLO uplo, const CBLAS_INT N, const CBLAS_INT ox; double tmp; - int64_t strides[] = { strideA1, strideA2 }; + // Note on variable naming convention: S#, ix#, iy#, i# where # corresponds to the loop number, with `0` being the innermost loop... + + // Perform input argument validation... + if ( uplo != CblasLower && uplo != CblasUpper ) { + c_xerbla( 1, "c_dsyr_ndarray", "Error: invalid argument. First argument must specify whether to reference the lower or upper triangular matrixecond argument must specify whether to reference the lower or upper triangular matrix. Value: `%d`.", uplo ); + return; + } + if ( N < 0 ) { + c_xerbla( 2, "c_dsyr_ndarray", "Error: invalid argument. Second argument must be a nonnegative integer. Value: `%d`.", N ); + return; + } + if ( strideX == 0 ) { + c_xerbla( 5, "c_dsyr_ndarray", "Error: invalid argument. Fifth argument must be a nonzero. Value: `%d`.", strideX ); + return; + } + // Check whether we can avoid computation altogether... if ( N == 0 || alpha == 0.0 ) { return; } - isrm = stdlib_ndarray_is_row_major( 2, strides ); + // Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments... + sa[ 0 ] = strideA1; + sa[ 1 ] = strideA2; + isrm = stdlib_ndarray_is_row_major( 2, sa ); if ( isrm ) { // For row-major matrices, the last dimension has the fastest changing index... sa0 = strideA2; // stride for innermost loop From 3c6f9967669d3452698c4b92e645f50ccab0b1d1 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Sun, 29 Jun 2025 20:01:50 +0530 Subject: [PATCH 28/48] chore: clean-up --- 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: passed - task: lint_javascript_src status: passed - 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: missing_dependencies - task: lint_c_examples status: missing_dependencies - task: lint_c_benchmarks status: missing_dependencies - 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/blas/base/dsyr/README.md | 34 +++-- .../blas/base/dsyr/benchmark/c/benchmark.c | 4 +- .../@stdlib/blas/base/dsyr/docs/repl.txt | 14 ++ .../blas/base/dsyr/examples/c/example.c | 12 +- .../base/dsyr/include/stdlib/blas/base/dsyr.h | 2 +- .../include/stdlib/blas/base/dsyr_cblas.h | 2 +- .../@stdlib/blas/base/dsyr/lib/dsyr.js | 7 +- .../@stdlib/blas/base/dsyr/lib/dsyr.native.js | 28 ++++ .../@stdlib/blas/base/dsyr/lib/ndarray.js | 1 + .../blas/base/dsyr/lib/ndarray.native.js | 18 +++ .../@stdlib/blas/base/dsyr/manifest.json | 72 ++++++---- .../@stdlib/blas/base/dsyr/src/addon.c | 9 +- .../@stdlib/blas/base/dsyr/src/dsyr.c | 12 +- .../@stdlib/blas/base/dsyr/src/dsyr_cblas.c | 38 +----- .../@stdlib/blas/base/dsyr/src/dsyr_ndarray.c | 2 +- .../blas/base/dsyr/test/test.dsyr.native.js | 128 ++++++++++++++++++ .../base/dsyr/test/test.ndarray.native.js | 74 ++++++++++ 17 files changed, 359 insertions(+), 98 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/README.md b/lib/node_modules/@stdlib/blas/base/dsyr/README.md index 9cb19f42f717..e3a5f6c8255d 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/README.md +++ b/lib/node_modules/@stdlib/blas/base/dsyr/README.md @@ -51,7 +51,7 @@ The function has the following parameters: - **N**: number of elements along each dimension of `A`. - **α**: scalar constant. - **x**: input [`Float64Array`][mdn-float64array]. -- **sx**: index increment for `x`. +- **sx**: stride length for `x`. - **A**: input matrix stored in linear memory as a [`Float64Array`][mdn-float64array]. - **lda**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`). @@ -186,7 +186,7 @@ console.log( A ); #include "stdlib/blas/base/dsyr.h" ``` -#### c_dsyr( order, uplo, N, alpha, \*X, strideX, \*A, LDA ) +#### c_dsyr( layout, uplo, N, alpha, \*X, sx, \*A, LDA ) Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. @@ -201,20 +201,20 @@ c_dsyr( CblasColMajor, CblasUpper, 3, 1.0, x, 1, A, 3 ); The function accepts the following arguments: -- **order**: `[in] CBLAS_LAYOUT` storage layout. +- **layout**: `[in] CBLAS_LAYOUT` storage layout. - **uplo**: `[in] CBLAS_UPLO` specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied. - **N**: `[in] CBLAS_INT` number of elements along each dimension of `A`. -- **alpha**: `[in] double` scalar. +- **alpha**: `[in] double` scalar constant. - **X**: `[in] double*` input array. -- **strideX**: `[in] CBLAS_INT` index increment for `X`. +- **sx**: `[in] CBLAS_INT` stride length for `X`. - **A**: `[inout] double*` input matrix. - **LDA**: `[in] CBLAS_INT` stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`). ```c -void c_dsyr( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *A, const CBLAS_INT LDA ) +void c_dsyr( const CBLAS_LAYOUT layout, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *x, const CBLAS_INT strideX, double *A, const CBLAS_INT LDA ) ``` -#### c_dsyr_ndarray( uplo, N, alpha, \*X, strideX, offsetX, \*A, sa1, sa2, oa ) +#### c_dsyr_ndarray( uplo, N, alpha, \*X, sx, ox, \*A, sa1, sa2, oa ) Performs the symmetric rank 1 operation `A = α*x*x^T + A`, using alternative indexing semantics and where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. @@ -231,17 +231,17 @@ The function accepts the following arguments: - **uplo**: `[in] CBLAS_UPLO` specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied. - **N**: `[in] CBLAS_INT` number of elements along each dimension of `A`. -- **alpha**: `[in] double` scalar. +- **alpha**: `[in] double` scalar constant. - **X**: `[in] double*` input array. -- **strideX**: `[in] CBLAS_INT` index increment for `X`. -- **offsetX**: `[in] CBLAS_INT` starting index for `X`. +- **sx**: `[in] CBLAS_INT` stride length for `X`. +- **ox**: `[in] CBLAS_INT` starting index for `X`. - **A**: `[inout] double*` input matrix. - **sa1**: `[in] CBLAS_INT` stride of the first dimension of `A`. - **sa2**: `[in] CBLAS_INT` stride of the second dimension of `A`. - **oa**: `[in] CBLAS_INT` starting index for `A`. ```c -void c_dsyr_ndarray( const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, double *A, const CBLAS_INT sa1, const CBLAS_INT sa2, const CBLAS_INT oa ) +void c_dsyr_ndarray( const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *x, const CBLAS_INT strideX, const CBLAS_INT offsetX, double *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA ) ``` @@ -268,9 +268,15 @@ void c_dsyr_ndarray( const CBLAS_UPLO uplo, const CBLAS_INT N, const double alph #include int main( void ) { - // Create strided arrays: - double A[] = { 1.0, 0.0, 0.0, 2.0, 1.0, 0.0, 3.0, 2.0, 1.0 }; - const double x[] = { 1.0, 2.0, 3.0 }; + // Define a 3x3 symmetric matrix stored in row-major layout: + double A[ 3*3 ] = { + 1.0, 0.0, 0.0, + 2.0, 1.0, 0.0, + 3.0, 2.0, 1.0 + }; + + // Define `x` vector: + const double x[ 3 ] = { 1.0, 2.0, 3.0 }; // Specify the number of elements along each dimension of `A`: const int N = 3; diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c index 2e189a6c19ee..6d4e4da76475 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c @@ -83,7 +83,7 @@ static double tic( void ) { * Runs a benchmark. * * @param iterations number of iterations -* @param N number of elements along each dimension +* @param N array dimension size * @return elapsed time in seconds */ static double benchmark1( int iterations, int N ) { @@ -114,7 +114,7 @@ static double benchmark1( int iterations, int N ) { * Runs a benchmark. * * @param iterations number of iterations -* @param N number of elements along each dimension +* @param N array dimension size * @return elapsed time in seconds */ static double benchmark2( int iterations, int N ) { diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/dsyr/docs/repl.txt index b417cd9e60c5..c301ffd1d0c9 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/dsyr/docs/repl.txt @@ -46,11 +46,25 @@ Examples -------- + // Standard usage: > var x = new {{alias:@stdlib/array/float64}}( [ 1.0, 1.0 ] ); > var A = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0, 0.0, 2.0 ] ); > {{alias}}( 'row-major', 'upper', 2, 1.0, x, 1, A, 2 ) [ 2.0, 3.0, 0.0, 3.0 ] + // Advanced indexing: + > var x = new {{alias:@stdlib/array/float64}}( [ 1.0, 1.0 ] ); + > var A = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0, 0.0, 2.0 ] ); + > {{alias}}( 'row-major', 'upper', 2, 1.0, x, -1, A, 2 ) + [ 2.0, 3.0, 0.0, 3.0 ] + + // Using typed array views: + > var x0 = new {{alias:@stdlib/array/float64}}( [ 0.0, 1.0, 1.0 ] ); + > A = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0, 0.0, 2.0 ] ); + > var x1 = new {{alias:@stdlib/array/float64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); + > {{alias}}( 'row-major', 'upper', 2, 1.0, x, 1, A, 2 ) + [ 2.0, 3.0, 0.0, 3.0 ] + {{alias}}.ndarray( uplo, N, α, x, sx, ox, A, sa1, sa2, oa ) Performs the symmetric rank 1 operation `A = α*x*x^T + A`, using alternative diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c b/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c index dd53323775f1..d231135cf411 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c @@ -21,9 +21,15 @@ #include int main( void ) { - // Create strided arrays: - double A[] = { 1.0, 0.0, 0.0, 2.0, 1.0, 0.0, 3.0, 2.0, 1.0 }; - const double x[] = { 1.0, 2.0, 3.0 }; + // Define a 3x3 symmetric matrix stored in row-major layout: + double A[ 3*3 ] = { + 1.0, 0.0, 0.0, + 2.0, 1.0, 0.0, + 3.0, 2.0, 1.0 + }; + + // Define `x` vector: + const double x[ 3 ] = { 1.0, 2.0, 3.0 }; // Specify the number of elements along each dimension of `A`: const int N = 3; diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr.h b/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr.h index c14a64568689..ce7c9f7b5b0c 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr.h +++ b/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr.h @@ -34,7 +34,7 @@ extern "C" { /** * Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. */ -void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *A, const CBLAS_INT LDA ); +void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT layout, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *A, const CBLAS_INT LDA ); /** * Performs the symmetric rank 1 operation `A = α*x*x^T + A`, using alternative indexing semantics and where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h b/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h index e70ce7a45576..882163e29f18 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h +++ b/lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h @@ -34,7 +34,7 @@ extern "C" { /** * Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. */ -void API_SUFFIX(cblas_dsyr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *A, const CBLAS_INT LDA ); +void API_SUFFIX(cblas_dsyr)( const CBLAS_LAYOUT layout, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *A, const CBLAS_INT LDA ); #ifdef __cplusplus } diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.js index 2f6f395661aa..0a2d396da822 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.js @@ -20,10 +20,10 @@ // MODULES // -var max = require( '@stdlib/math/base/special/fast/max' ); +var stride2offset = require( '@stdlib/strided/base/stride2offset' ); var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); -var stride2offset = require( '@stdlib/strided/base/stride2offset' ); +var max = require( '@stdlib/math/base/special/fast/max' ); var format = require( '@stdlib/string/format' ); var base = require( './base.js' ); @@ -45,7 +45,7 @@ var base = require( './base.js' ); * @throws {TypeError} second argument must specify whether to reference the lower or upper triangular matrix * @throws {RangeError} third argument must be a nonnegative integer * @throws {RangeError} sixth argument must be non-zero -* @throws {RangeError} eighth argument must be greater than or equal to max(1,N) +* @throws {RangeError} eighth argument must be a valid stride * @returns {Float64Array} `A` * * @example @@ -77,6 +77,7 @@ function dsyr( order, uplo, N, alpha, x, strideX, A, LDA ) { if ( LDA < max( 1, N ) ) { throw new RangeError( format( 'invalid argument. Eighth argument must be greater than or equal to max(1,%d). Value: `%d`.', N, LDA ) ); } + // Check if we can early return... if ( N === 0 || alpha === 0.0 ) { return A; } diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.native.js index 446854a522af..22d3f3aab0ff 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.native.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.native.js @@ -20,8 +20,12 @@ // MODULES // +var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); +var max = require( '@stdlib/math/base/special/fast/max' ); var resolveOrder = require( '@stdlib/blas/base/layout-resolve-enum' ); var resolveUplo = require( '@stdlib/blas/base/matrix-triangle-resolve-enum' ); +var format = require( '@stdlib/string/format' ); var addon = require( './../src/addon.node' ); @@ -38,6 +42,11 @@ var addon = require( './../src/addon.node' ); * @param {integer} strideX - `x` stride length * @param {Float64Array} A - input matrix * @param {integer} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @throws {TypeError} first argument must be a valid order +* @throws {TypeError} second argument must specify whether to reference the lower or upper triangular matrix +* @throws {RangeError} third argument must be a nonnegative integer +* @throws {RangeError} sixth argument must be non-zero +* @throws {RangeError} eighth argument must be a valid stride * @returns {Float64Array} `A` * * @example @@ -50,6 +59,25 @@ var addon = require( './../src/addon.node' ); * // A => [ 2.0, 4.0, 6.0, 0.0, 5.0, 8.0, 0.0, 0.0, 10.0 ] */ function dsyr( order, uplo, N, alpha, x, strideX, A, LDA ) { + if ( !isLayout( order ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); + } + if ( !isMatrixTriangle( uplo ) ) { + throw new TypeError( format( 'invalid argument. Second argument must specify whether to reference the lower or upper triangular matrix. Value: `%s`.', uplo ) ); + } + if ( N < 0 ) { + throw new RangeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%d`.', N ) ); + } + if ( strideX === 0 ) { + throw new RangeError( format( 'invalid argument. Sixth argument must be non-zero. Value: `%d`.', strideX ) ); + } + if ( LDA < max( 1, N ) ) { + throw new RangeError( format( 'invalid argument. Eighth argument must be greater than or equal to max(1,%d). Value: `%d`.', N, LDA ) ); + } + // Check if we can early return... + if ( N === 0 || alpha === 0.0 ) { + return A; + } addon( resolveOrder( order ), resolveUplo( uplo ), N, alpha, x, strideX, A, LDA ); // eslint-disable-line max-len return A; } diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js index 490056e2b0e9..e6ed1e7ccab1 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js @@ -64,6 +64,7 @@ function dsyr( uplo, N, alpha, x, strideX, offsetX, A, strideA1, strideA2, offse if ( strideX === 0 ) { throw new RangeError( format( 'invalid argument. Fifth argument must be non-zero. Value: `%d`.', strideX ) ); } + // Check if we can early return... if ( N === 0 || alpha === 0.0 ) { return A; } diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js index 32c23a3b00b0..ea4883200923 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js @@ -20,7 +20,9 @@ // MODULES // +var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); var resolveUplo = require( '@stdlib/blas/base/matrix-triangle-resolve-enum' ); +var format = require( '@stdlib/string/format' ); var addon = require( './../src/addon.node' ); @@ -39,6 +41,9 @@ var addon = require( './../src/addon.node' ); * @param {integer} strideA1 - stride of the first dimension of `A` * @param {integer} strideA2 - stride of the second dimension of `A` * @param {NonNegativeInteger} offsetA - starting index for `A` +* @throws {TypeError} first argument must specify whether to reference the lower or upper triangular matrix +* @throws {RangeError} second argument must be a nonnegative integer +* @throws {RangeError} fifth argument must be non-zero * @returns {Float64Array} `A` * * @example @@ -51,6 +56,19 @@ var addon = require( './../src/addon.node' ); * // A => [ 2.0, 4.0, 6.0, 0.0, 5.0, 8.0, 0.0, 0.0, 10.0 ] */ function dsyr( uplo, N, alpha, x, strideX, offsetX, A, strideA1, strideA2, offsetA ) { // eslint-disable-line max-len + if ( !isMatrixTriangle( uplo ) ) { + throw new TypeError( format( 'invalid argument. First argument must specify whether to reference the lower or upper triangular matrix. Value: `%s`.', uplo ) ); + } + if ( N < 0 ) { + throw new RangeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%d`.', N ) ); + } + if ( strideX === 0 ) { + throw new RangeError( format( 'invalid argument. Fifth argument must be non-zero. Value: `%d`.', strideX ) ); + } + // Check if we can early return... + if ( N === 0 || alpha === 0.0 ) { + return A; + } addon.ndarray( resolveUplo( uplo ), N, alpha, x, strideX, offsetX, A, strideA1, strideA2, offsetA ); // eslint-disable-line max-len return A; } diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json b/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json index d467d3f06eee..8bb48aaaeca1 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json +++ b/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json @@ -106,7 +106,8 @@ "blas": "openblas", "wasm": false, "src": [ - "./src/dsyr_cblas.c" + "./src/dsyr_cblas.c", + "./src/dsyr_ndarray.c" ], "include": [ "./include" @@ -118,8 +119,9 @@ "libpath": [], "dependencies": [ "@stdlib/blas/base/shared", - "@stdlib/strided/base/min-view-buffer-index", - "@stdlib/ndarray/base/min-view-buffer-index", + "@stdlib/blas/base/xerbla", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major", "@stdlib/napi/export", "@stdlib/napi/argv", "@stdlib/napi/argv-int64", @@ -135,7 +137,8 @@ "blas": "openblas", "wasm": false, "src": [ - "./src/dsyr_cblas.c" + "./src/dsyr_cblas.c", + "./src/dsyr_ndarray.c" ], "include": [ "./include" @@ -147,8 +150,9 @@ "libpath": [], "dependencies": [ "@stdlib/blas/base/shared", - "@stdlib/strided/base/min-view-buffer-index", - "@stdlib/ndarray/base/min-view-buffer-index", + "@stdlib/blas/base/xerbla", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major", "@stdlib/blas/ext/base/dfill" ] }, @@ -158,7 +162,8 @@ "blas": "openblas", "wasm": false, "src": [ - "./src/dsyr_cblas.c" + "./src/dsyr_cblas.c", + "./src/dsyr_ndarray.c" ], "include": [ "./include" @@ -170,8 +175,9 @@ "libpath": [], "dependencies": [ "@stdlib/blas/base/shared", - "@stdlib/strided/base/min-view-buffer-index", - "@stdlib/ndarray/base/min-view-buffer-index" + "@stdlib/blas/base/xerbla", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major" ] }, @@ -253,7 +259,8 @@ "blas": "apple_accelerate_framework", "wasm": false, "src": [ - "./src/dsyr_cblas.c" + "./src/dsyr_cblas.c", + "./src/dsyr_ndarray.c" ], "include": [ "./include" @@ -264,8 +271,9 @@ "libpath": [], "dependencies": [ "@stdlib/blas/base/shared", - "@stdlib/strided/base/min-view-buffer-index", - "@stdlib/ndarray/base/min-view-buffer-index", + "@stdlib/blas/base/xerbla", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major", "@stdlib/napi/export", "@stdlib/napi/argv", "@stdlib/napi/argv-int64", @@ -281,7 +289,8 @@ "blas": "apple_accelerate_framework", "wasm": false, "src": [ - "./src/dsyr_cblas.c" + "./src/dsyr_cblas.c", + "./src/dsyr_ndarray.c" ], "include": [ "./include" @@ -292,8 +301,9 @@ "libpath": [], "dependencies": [ "@stdlib/blas/base/shared", - "@stdlib/strided/base/min-view-buffer-index", - "@stdlib/ndarray/base/min-view-buffer-index", + "@stdlib/blas/base/xerbla", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major", "@stdlib/blas/ext/base/dfill" ] }, @@ -303,7 +313,8 @@ "blas": "apple_accelerate_framework", "wasm": false, "src": [ - "./src/dsyr_cblas.c" + "./src/dsyr_cblas.c", + "./src/dsyr_ndarray.c" ], "include": [ "./include" @@ -314,8 +325,9 @@ "libpath": [], "dependencies": [ "@stdlib/blas/base/shared", - "@stdlib/strided/base/min-view-buffer-index", - "@stdlib/ndarray/base/min-view-buffer-index" + "@stdlib/blas/base/xerbla", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major" ] }, @@ -325,7 +337,8 @@ "blas": "openblas", "wasm": false, "src": [ - "./src/dsyr_cblas.c" + "./src/dsyr_cblas.c", + "./src/dsyr_ndarray.c" ], "include": [ "./include" @@ -337,8 +350,9 @@ "libpath": [], "dependencies": [ "@stdlib/blas/base/shared", - "@stdlib/strided/base/min-view-buffer-index", - "@stdlib/ndarray/base/min-view-buffer-index", + "@stdlib/blas/base/xerbla", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major", "@stdlib/napi/export", "@stdlib/napi/argv", "@stdlib/napi/argv-int64", @@ -354,7 +368,8 @@ "blas": "openblas", "wasm": false, "src": [ - "./src/dsyr_cblas.c" + "./src/dsyr_cblas.c", + "./src/dsyr_ndarray.c" ], "include": [ "./include" @@ -366,8 +381,9 @@ "libpath": [], "dependencies": [ "@stdlib/blas/base/shared", - "@stdlib/strided/base/min-view-buffer-index", - "@stdlib/ndarray/base/min-view-buffer-index", + "@stdlib/blas/base/xerbla", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major", "@stdlib/blas/ext/base/dfill" ] }, @@ -377,7 +393,8 @@ "blas": "openblas", "wasm": false, "src": [ - "./src/dsyr_cblas.c" + "./src/dsyr_cblas.c", + "./src/dsyr_ndarray.c" ], "include": [ "./include" @@ -389,8 +406,9 @@ "libpath": [], "dependencies": [ "@stdlib/blas/base/shared", - "@stdlib/strided/base/min-view-buffer-index", - "@stdlib/ndarray/base/min-view-buffer-index" + "@stdlib/blas/base/xerbla", + "@stdlib/strided/base/stride2offset", + "@stdlib/ndarray/base/assert/is-row-major" ] }, diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c index 28faac8f10d6..dd85d6f8cbb9 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c @@ -40,7 +40,7 @@ static napi_value addon( napi_env env, napi_callback_info info ) { STDLIB_NAPI_ARGV( env, info, argv, argc, 8 ); - STDLIB_NAPI_ARGV_INT32( env, order, argv, 0 ); + STDLIB_NAPI_ARGV_INT32( env, layout, argv, 0 ); STDLIB_NAPI_ARGV_INT32( env, uplo, argv, 1 ); STDLIB_NAPI_ARGV_INT64( env, N, argv, 2 ); @@ -49,18 +49,17 @@ static napi_value addon( napi_env env, napi_callback_info info ) { STDLIB_NAPI_ARGV_DOUBLE( env, alpha, argv, 3 ); - if ( order == CblasColMajor ) { + if ( layout == CblasColMajor ) { sa1 = 1; sa2 = LDA; - } else { // order === CblasRowMajor + } else { // layout === CblasRowMajor sa1 = LDA; sa2 = 1; } - STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 4 ); STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY2D( env, A, N, N, sa1, sa2, argv, 6 ); - API_SUFFIX(c_dsyr)( order, uplo, N, alpha, X, strideX, A, LDA ); + API_SUFFIX(c_dsyr)( layout, uplo, N, alpha, X, strideX, A, LDA ); return NULL; } diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c index 0ad4103d13b0..42a2569739bd 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c @@ -24,7 +24,7 @@ /** * Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. * -* @param order storage layout +* @param layout storage layout * @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied * @param N number of elements along each dimension of `A` * @param alpha scalar @@ -33,14 +33,14 @@ * @param A input matrix * @param LDA stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) */ -void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *A, const CBLAS_INT LDA ) { +void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT layout, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *A, const CBLAS_INT LDA ) { CBLAS_INT sa1; CBLAS_INT sa2; CBLAS_INT ox; // Perform input argument validation... - if ( order != CblasRowMajor && order != CblasColMajor ) { - c_xerbla( 1, "c_dsyr", "Error: invalid argument. First argument must be a valid order. Value: `%d`.", order ); + if ( layout != CblasRowMajor && layout != CblasColMajor ) { + c_xerbla( 1, "c_dsyr", "Error: invalid argument. First argument must be a valid layout. Value: `%d`.", layout ); return; } if ( uplo != CblasLower && uplo != CblasUpper ) { @@ -63,10 +63,10 @@ void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const if ( N == 0 || alpha == 0.0 ) { return; } - if ( order == CblasColMajor ) { + if ( layout == CblasColMajor ) { sa1 = 1; sa2 = LDA; - } else { // order === CblasRowMajor + } else { // layout === CblasRowMajor sa1 = LDA; sa2 = 1; } diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c index 78473569a599..4464fca56fce 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c @@ -19,13 +19,11 @@ #include "stdlib/blas/base/dsyr.h" #include "stdlib/blas/base/dsyr_cblas.h" #include "stdlib/blas/base/shared.h" -#include "stdlib/strided/base/min_view_buffer_index.h" -#include "stdlib/ndarray/base/min_view_buffer_index.h" /** * Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. * -* @param order storage layout +* @param layout storage layout * @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied * @param N number of elements along each dimension of `A` * @param alpha scalar @@ -34,36 +32,6 @@ * @param A input matrix * @param LDA stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) */ -void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *A, const CBLAS_INT LDA ) { - CBLAS_INT sx = strideX; - if ( sx < 0 ) { - sx = -sx; - } - API_SUFFIX(cblas_dsyr)( order, uplo, N, alpha, X, sx, A, LDA ); -} - -/** -* Performs the symmetric rank 1 operation `A = α*x*x^T + A`, using alternative indexing semantics and where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. -* -* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied -* @param N number of elements along each dimension of `A` -* @param alpha scalar -* @param X input vector -* @param strideX `x` stride length -* @param offsetX starting index for `x` -* @param A input matrix -* @param strideA1 stride of the first dimension of `A` -* @param strideA2 stride of the second dimension of `A` -* @param offsetA starting index for `AP` -*/ -void API_SUFFIX(c_dsyr_ndarray)( const CBLAS_UPLO uplo, const CBLAS_INT N, const float alpha, const float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, float *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA ) { - CBLAS_INT sx = strideX; - X += stdlib_strided_min_view_buffer_index( N, strideX, offsetX ); // adjust array pointer - const shape[] = { N, N }; - const strides[] = { strideA1, strideA2 }; - A += stdlib_ndarray_min_view_buffer_index( 2, shape, strides, offsetA); // adjust array pointer - if ( sx < 0 ) { - sx = -sx; - } - API_SUFFIX(cblas_dsyr)( order, uplo, N, alpha, X, sx, A, LDA ); +void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT layout, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *A, const CBLAS_INT LDA ) { + API_SUFFIX(cblas_dsyr)( layout, uplo, N, alpha, X, strideX, A, LDA ); } diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c index 5c30646dcb20..ad1c9d4aa2e2 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c @@ -48,7 +48,7 @@ void API_SUFFIX(c_dsyr_ndarray)( const CBLAS_UPLO uplo, const CBLAS_INT N, const CBLAS_INT ox; double tmp; - // Note on variable naming convention: S#, ix#, iy#, i# where # corresponds to the loop number, with `0` being the innermost loop... + // Note on variable naming convention: sa#, ix#, iy#, i# where # corresponds to the loop number, with `0` being the innermost loop... // Perform input argument validation... if ( uplo != CblasLower && uplo != CblasUpper ) { diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.native.js index 75d3591652c0..403425eeb527 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.native.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.native.js @@ -64,6 +64,134 @@ tape( 'the function has an arity of 8', opts, function test( t ) { t.end(); }); +tape( 'the function throws an error if provided an invalid first argument', opts, function test( t ) { + var values; + var data; + var i; + + data = ru; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dsyr( value, data.uplo, data.N, data.alpha, new Float64Array( data.x ), data.strideX, new Float64Array( data.A ), data.lda ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid second argument', opts, function test( t ) { + var values; + var data; + var i; + + data = ru; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dsyr( data.order, value, data.N, data.alpha, new Float64Array( data.x ), data.strideX, new Float64Array( data.A ), data.lda ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid third argument', opts, function test( t ) { + var values; + var data; + var i; + + data = ru; + + values = [ + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dsyr( data.order, data.uplo, value, data.alpha, new Float64Array( data.x ), data.strideX, new Float64Array( data.A ), data.lda ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid sixth argument', opts, function test( t ) { + var values; + var data; + var i; + + data = ru; + + values = [ + 0 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dsyr( data.order, data.uplo, data.N, data.alpha, new Float64Array( data.x ), value, new Float64Array( data.A ), data.lda ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid eighth argument', opts, function test( t ) { + var values; + var data; + var i; + + data = ru; + + values = [ + 2, + 1, + 0, + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dsyr( data.order, data.uplo, data.N, data.alpha, new Float64Array( data.x ), data.strideX, new Float64Array( data.A ), value ); + }; + } +}); + tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` (row-major, upper)', opts, function test( t ) { var expected; var data; diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.native.js index a2b341fe4498..269ade63186b 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.native.js @@ -75,6 +75,80 @@ tape( 'the function has an arity of 10', opts, function test( t ) { t.end(); }); +tape( 'the function throws an error if provided an invalid first argument', opts, function test( t ) { + var values; + var data; + var i; + + data = ru; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dsyr( value, data.N, data.alpha, new Float64Array( data.x ), data.strideX, data.offsetX, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid second argument', opts, function test( t ) { + var values; + var data; + var i; + + data = ru; + + values = [ + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dsyr( data.uplo, value, data.alpha, new Float64Array( data.x ), data.strideX, data.offsetX, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid fifth argument', opts, function test( t ) { + var values; + var data; + var i; + + data = ru; + + values = [ + 0 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dsyr( data.uplo, data.N, data.alpha, new Float64Array( data.x ), value, data.offsetX, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA ); + }; + } +}); + tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` (row-major, upper)', opts, function test( t ) { var expected; var data; From e1ddd8a1397ddcaf3e5cfe195a299e512f4fef51 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Sun, 29 Jun 2025 20:06:41 +0530 Subject: [PATCH 29/48] chore: clean-up --- 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 --- --- .../blas/base/dsyr/test/test.dsyr.native.js | 28 +++++----- .../base/dsyr/test/test.ndarray.native.js | 51 +++++++++---------- 2 files changed, 38 insertions(+), 41 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.native.js index 403425eeb527..dc8903192013 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.native.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.native.js @@ -25,8 +25,6 @@ var resolve = require( 'path' ).resolve; var tape = require( 'tape' ); var Float64Array = require( '@stdlib/array/float64' ); -var str2enum = require( '@stdlib/blas/base/matrix-triangle-str2enum' ); -var str2enumLayout = require( '@stdlib/blas/base/layout-str2enum' ); var tryRequire = require( '@stdlib/utils/try-require' ); @@ -206,7 +204,7 @@ tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` ( expected = new Float64Array( data.A_out ); - out = dsyr( str2enumLayout( data.order ), str2enum( data.uplo ), data.N, data.alpha, x, data.strideX, a, data.lda ); + out = dsyr( data.order, data.uplo, data.N, data.alpha, x, data.strideX, a, data.lda ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -227,7 +225,7 @@ tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` ( expected = new Float64Array( data.A_out ); - out = dsyr( str2enumLayout( data.order ), str2enum( data.uplo ), data.N, data.alpha, x, data.strideX, a, data.lda ); + out = dsyr( data.order, data.uplo, data.N, data.alpha, x, data.strideX, a, data.lda ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -248,7 +246,7 @@ tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` ( expected = new Float64Array( data.A_out ); - out = dsyr( str2enumLayout( data.order ), str2enum( data.uplo ), data.N, data.alpha, x, data.strideX, a, data.lda ); + out = dsyr( data.order, data.uplo, data.N, data.alpha, x, data.strideX, a, data.lda ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -269,7 +267,7 @@ tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` ( expected = new Float64Array( data.A_out ); - out = dsyr( str2enumLayout( data.order ), str2enum( data.uplo ), data.N, data.alpha, x, data.strideX, a, data.lda ); + out = dsyr( data.order, data.uplo, data.N, data.alpha, x, data.strideX, a, data.lda ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -287,7 +285,7 @@ tape( 'the function returns a reference to the input matrix `A`', opts, function a = new Float64Array( data.A ); x = new Float64Array( data.x ); - out = dsyr( str2enumLayout( data.order ), str2enum( data.uplo ), data.N, data.alpha, x, data.strideX, a, data.lda ); + out = dsyr( data.order, data.uplo, data.N, data.alpha, x, data.strideX, a, data.lda ); t.strictEqual( out, a, 'returns expected value' ); t.end(); @@ -307,11 +305,11 @@ tape( 'if `N` is zero or the scalar constant is zero, the function returns the i expected = new Float64Array( data.A ); - out = dsyr( str2enumLayout( data.order ), str2enum( data.uplo ), 0, data.alpha, x, data.strideX, a, data.lda ); + out = dsyr( data.order, data.uplo, 0, data.alpha, x, data.strideX, a, data.lda ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( a, expected, 'returns expected value' ); - out = dsyr( str2enumLayout( data.order ), str2enum( data.uplo ), data.N, 0.0, x, data.strideX, a, data.lda ); + out = dsyr( data.order, data.uplo, data.N, 0.0, x, data.strideX, a, data.lda ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( a, expected, 'returns expected value' ); @@ -332,11 +330,11 @@ tape( 'if `N` is zero or the scalar constant is zero, the function returns the i expected = new Float64Array( data.A ); - out = dsyr( str2enumLayout( data.order ), str2enum( data.uplo ), 0, data.alpha, x, data.strideX, a, data.lda ); + out = dsyr( data.order, data.uplo, 0, data.alpha, x, data.strideX, a, data.lda ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( a, expected, 'returns expected value' ); - out = dsyr( str2enumLayout( data.order ), str2enum( data.uplo ), data.N, 0.0, x, data.strideX, a, data.lda ); + out = dsyr( data.order, data.uplo, data.N, 0.0, x, data.strideX, a, data.lda ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( a, expected, 'returns expected value' ); @@ -357,7 +355,7 @@ tape( 'the function supports specifying an `x` stride (row-major)', opts, functi expected = new Float64Array( data.A_out ); - out = dsyr( str2enumLayout( data.order ), str2enum( data.uplo ), data.N, data.alpha, x, data.strideX, a, data.lda ); + out = dsyr( data.order, data.uplo, data.N, data.alpha, x, data.strideX, a, data.lda ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -378,7 +376,7 @@ tape( 'the function supports specifying an `x` stride (column-major)', opts, fun expected = new Float64Array( data.A_out ); - out = dsyr( str2enumLayout( data.order ), str2enum( data.uplo ), data.N, data.alpha, x, data.strideX, a, data.lda ); + out = dsyr( data.order, data.uplo, data.N, data.alpha, x, data.strideX, a, data.lda ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -399,7 +397,7 @@ tape( 'the function supports specifying a negative `x` stride (row-major)', opts expected = new Float64Array( data.A_out ); - out = dsyr( str2enumLayout( data.order ), str2enum( data.uplo ), data.N, data.alpha, x, data.strideX, a, data.lda ); + out = dsyr( data.order, data.uplo, data.N, data.alpha, x, data.strideX, a, data.lda ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -420,7 +418,7 @@ tape( 'the function supports specifying a negative `x` stride (column-major)', o expected = new Float64Array( data.A_out ); - out = dsyr( str2enumLayout( data.order ), str2enum( data.uplo ), data.N, data.alpha, x, data.strideX, a, data.lda ); + out = dsyr( data.order, data.uplo, data.N, data.alpha, x, data.strideX, a, data.lda ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.native.js index 269ade63186b..47d8f61a5137 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.native.js @@ -25,7 +25,6 @@ var resolve = require( 'path' ).resolve; var tape = require( 'tape' ); var Float64Array = require( '@stdlib/array/float64' ); -var str2enumMatrixTriangle = require( '@stdlib/blas/base/matrix-triangle-str2enum' ); var tryRequire = require( '@stdlib/utils/try-require' ); @@ -163,7 +162,7 @@ tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` ( expected = new Float64Array( data.A_out ); - out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + out = dsyr( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -184,7 +183,7 @@ tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` ( expected = new Float64Array( data.A_out ); - out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + out = dsyr( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -205,7 +204,7 @@ tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` ( expected = new Float64Array( data.A_out ); - out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + out = dsyr( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -226,7 +225,7 @@ tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` ( expected = new Float64Array( data.A_out ); - out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + out = dsyr( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -244,7 +243,7 @@ tape( 'the function returns a reference to the input matrix `A`', opts, function a = new Float64Array( data.A ); x = new Float64Array( data.x ); - out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + out = dsyr( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); t.end(); @@ -264,11 +263,11 @@ tape( 'if `N` is zero or the scalar constant is zero, the function returns the i expected = new Float64Array( data.A ); - out = dsyr( str2enumMatrixTriangle( data.uplo ), 0, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + out = dsyr( data.uplo, 0, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( a, expected, 'returns expected value' ); - out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, 0.0, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + out = dsyr( data.uplo, data.N, 0.0, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( a, expected, 'returns expected value' ); @@ -289,11 +288,11 @@ tape( 'if `N` is zero or the scalar constant is zero, the function returns the i expected = new Float64Array( data.A ); - out = dsyr( str2enumMatrixTriangle( data.uplo ), 0, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + out = dsyr( data.uplo, 0, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( a, expected, 'returns expected value' ); - out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, 0.0, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + out = dsyr( data.uplo, data.N, 0.0, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( a, expected, 'returns expected value' ); @@ -314,7 +313,7 @@ tape( 'the function supports specifying the strides of the first and second dime expected = new Float64Array( data.A_out ); - out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + out = dsyr( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -335,7 +334,7 @@ tape( 'the function supports specifying the strides of the first and second dime expected = new Float64Array( data.A_out ); - out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + out = dsyr( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -356,7 +355,7 @@ tape( 'the function supports a negative stride for the first dimension of `A` (r expected = new Float64Array( data.A_out ); - out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + out = dsyr( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -377,7 +376,7 @@ tape( 'the function supports a negative stride for the first dimension of `A` (c expected = new Float64Array( data.A_out ); - out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + out = dsyr( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -398,7 +397,7 @@ tape( 'the function supports a negative stride for the second dimension of `A` ( expected = new Float64Array( data.A_out ); - out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + out = dsyr( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -419,7 +418,7 @@ tape( 'the function supports a negative stride for the second dimension of `A` ( expected = new Float64Array( data.A_out ); - out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + out = dsyr( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -440,7 +439,7 @@ tape( 'the function supports negative strides for both dimensions of `A` (row-ma expected = new Float64Array( data.A_out ); - out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + out = dsyr( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -461,7 +460,7 @@ tape( 'the function supports negative strides for both dimensions of `A` (column expected = new Float64Array( data.A_out ); - out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + out = dsyr( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -482,7 +481,7 @@ tape( 'the function supports specifying an `A` offset (row-major)', opts, functi expected = new Float64Array( data.A_out ); - out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + out = dsyr( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -503,7 +502,7 @@ tape( 'the function supports specifying an `A` offset (column-major)', opts, fun expected = new Float64Array( data.A_out ); - out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + out = dsyr( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -524,7 +523,7 @@ tape( 'the function supports specifying an `x` stride (row-major)', opts, functi expected = new Float64Array( data.A_out ); - out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + out = dsyr( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -545,7 +544,7 @@ tape( 'the function supports specifying an `x` stride (column-major)', opts, fun expected = new Float64Array( data.A_out ); - out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + out = dsyr( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -566,7 +565,7 @@ tape( 'the function supports specifying a negative `x` stride (row-major)', opts expected = new Float64Array( data.A_out ); - out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + out = dsyr( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -587,7 +586,7 @@ tape( 'the function supports specifying a negative `x` stride (column-major)', o expected = new Float64Array( data.A_out ); - out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + out = dsyr( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -608,7 +607,7 @@ tape( 'the function supports complex access patterns (row-major)', opts, functio expected = new Float64Array( data.A_out ); - out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + out = dsyr( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); @@ -629,7 +628,7 @@ tape( 'the function supports complex access patterns (column-major)', opts, func expected = new Float64Array( data.A_out ); - out = dsyr( str2enumMatrixTriangle( data.uplo ), data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); + out = dsyr( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, a, data.strideA1, data.strideA2, data.offsetA ); t.strictEqual( out, a, 'returns expected value' ); t.deepEqual( out, expected, 'returns expected value' ); From 6534b3fc22272ec0530ce2faea77f6e614b25b5f Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Sun, 29 Jun 2025 21:59:23 +0530 Subject: [PATCH 30/48] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c index 4464fca56fce..55a08568fc71 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c @@ -26,7 +26,7 @@ * @param layout storage layout * @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied * @param N number of elements along each dimension of `A` -* @param alpha scalar +* @param alpha scalar constant * @param x input vector * @param strideX `X` stride length * @param A input matrix From 3df6b713a53cb0393c26b2c755ef09210e9ee194 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Sun, 29 Jun 2025 21:59:34 +0530 Subject: [PATCH 31/48] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c index 42a2569739bd..91a2e0435917 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c @@ -27,7 +27,7 @@ * @param layout storage layout * @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied * @param N number of elements along each dimension of `A` -* @param alpha scalar +* @param alpha scalar constant * @param X input vector * @param strideX `X` stride length * @param A input matrix From b179a4f9cc28f3a95b1ee6bc12be45abc38ae911 Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Sun, 29 Jun 2025 21:59:45 +0530 Subject: [PATCH 32/48] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c index ad1c9d4aa2e2..065bfabedb27 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c @@ -26,7 +26,7 @@ * * @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied * @param N number of elements along each dimension of `A` -* @param alpha scalar +* @param alpha scalar constant * @param X input vector * @param strideX `X` stride length * @param offsetX starting index of `X` From 8d3d1b630386d7fd507f19118a8479a45c081fae Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Mon, 30 Jun 2025 00:11:03 +0530 Subject: [PATCH 33/48] chore: minor clean-up Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c index 91a2e0435917..7484c0aff3f3 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c @@ -34,6 +34,7 @@ * @param LDA stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) */ void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT layout, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *A, const CBLAS_INT LDA ) { + CBLAS_INT vala; CBLAS_INT sa1; CBLAS_INT sa2; CBLAS_INT ox; @@ -55,8 +56,14 @@ void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT layout, const CBLAS_UPLO uplo, const c_xerbla( 6, "c_dsyr", "Error: invalid argument. Sixth argument must be nonzero. Value: `%d`.", strideX ); return; } - if ( LDA < N ) { - c_xerbla( 10, "c_dsyr", "Error: invalid argument. Eighth argument must be greater than or equal to max(1,%d). Value: `%d`.", N, LDA ); + // max(1, N) + if ( N < 1 ) { + vala = 1; + } else { + vala = N; + } + if ( LDA < vala ) { + c_xerbla( 10, "c_dsyr", "Error: invalid argument. Eighth argument must be greater than or equal to max(1,%d). Value: `%d`.", vala, LDA ); return; } // Check whether we can avoid computation altogether... From 1f027acdbc6761b5d41f8ec5165372e8060acf6c Mon Sep 17 00:00:00 2001 From: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> Date: Mon, 30 Jun 2025 15:52:44 +0530 Subject: [PATCH 34/48] chore: minor clean-up Co-authored-by: Athan Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js index ea4883200923..469d5857fdf5 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js @@ -33,7 +33,7 @@ var addon = require( './../src/addon.node' ); * * @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied * @param {NonNegativeInteger} N - number of elements along each dimension of `A` -* @param {number} alpha - scalar +* @param {number} alpha - scalar constant * @param {Float64Array} x - input vector * @param {integer} strideX - `x` stride length * @param {NonNegativeInteger} offsetX - starting index for `x` From 4f4f0573e0b40c5c49e077139c667a0293ffd6d0 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Mon, 30 Jun 2025 16:24:36 +0530 Subject: [PATCH 35/48] chore: add suggestions --- 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: passed - 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: missing_dependencies - task: lint_c_examples status: missing_dependencies - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/dsyr/README.md | 72 +++++++++++-------- .../@stdlib/blas/base/dsyr/docs/repl.txt | 16 ++--- .../blas/base/dsyr/docs/types/index.d.ts | 20 +++--- .../blas/base/dsyr/examples/c/example.c | 24 ++++--- .../@stdlib/blas/base/dsyr/examples/index.js | 12 +++- .../@stdlib/blas/base/dsyr/lib/base.js | 4 +- .../@stdlib/blas/base/dsyr/lib/dsyr.js | 4 +- .../@stdlib/blas/base/dsyr/lib/dsyr.native.js | 6 +- .../@stdlib/blas/base/dsyr/lib/index.js | 8 +-- .../@stdlib/blas/base/dsyr/lib/ndarray.js | 4 +- .../blas/base/dsyr/lib/ndarray.native.js | 8 +-- .../@stdlib/blas/base/dsyr/src/dsyr.c | 2 +- .../@stdlib/blas/base/dsyr/src/dsyr_ndarray.c | 2 +- 13 files changed, 103 insertions(+), 79 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/README.md b/lib/node_modules/@stdlib/blas/base/dsyr/README.md index e3a5f6c8255d..b5715360b142 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/README.md +++ b/lib/node_modules/@stdlib/blas/base/dsyr/README.md @@ -37,17 +37,17 @@ Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scala ```javascript var Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 1.0, 2.0, 3.0, 2.0, 1.0 ] ); var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); dsyr( 'row-major', 'upper', 3, 1.0, x, 1, A, 3 ); -// A => [ 2.0, 4.0, 6.0, 0.0, 5.0, 8.0, 0.0, 0.0, 10.0 ] +// A => [ 2.0, 4.0, 6.0, 2.0, 5.0, 8.0, 3.0, 2.0, 10.0 ] ``` The function has the following parameters: - **order**: storage layout. -- **uplo**: specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied. +- **uplo**: specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced. - **N**: number of elements along each dimension of `A`. - **α**: scalar constant. - **x**: input [`Float64Array`][mdn-float64array]. @@ -55,16 +55,16 @@ The function has the following parameters: - **A**: input matrix stored in linear memory as a [`Float64Array`][mdn-float64array]. - **lda**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`). -The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to iterate over every other element of `x` in reverse order, +The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to iterate over the elements of `x` in reverse order, ```javascript var Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); -var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 1.0, 2.0, 3.0, 2.0, 1.0 ] ); +var x = new Float64Array( [ 3.0, 2.0, 1.0 ] ); -dsyr( 'row-major', 'upper', 3, 1.0, x, -2, A, 3 ); -// A => [ 26.0, 17.0, 8.0, 0.0, 10.0, 5.0, 0.0, 0.0, 2.0 ] +dsyr( 'row-major', 'upper', 3, 1.0, x, -1, A, 3 ); +// A => [ 2.0, 4.0, 6.0, 2.0, 5.0, 8.0, 3.0, 2.0, 10.0 ] ``` Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. @@ -76,13 +76,13 @@ var Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... var x0 = new Float64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 1.0, 2.0, 3.0, 2.0, 1.0 ] ); // Create offset views... var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element dsyr( 'row-major', 'upper', 3, 1.0, x1, -1, A, 3 ); -// A => [ 2.0, 3.0, 4.0, 0.0, 2.0, 3.0, 0.0, 0.0, 2.0 ] +// A => [ 2.0, 3.0, 4.0, 2.0, 2.0, 3.0, 3.0, 2.0, 2.0 ] ``` #### dsyr.ndarray( uplo, N, α, x, sx, ox, A, sa1, sa2, oa ) @@ -92,11 +92,11 @@ Performs the symmetric rank 1 operation `A = α*x*x^T + A`, using alternative in ```javascript var Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 1.0, 2.0, 3.0, 2.0, 1.0 ] ); var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); dsyr.ndarray( 'upper', 3, 1.0, x, 1, 0, A, 3, 1, 0 ); -// A => [ 2.0, 4.0, 6.0, 0.0, 5.0, 8.0, 0.0, 0.0, 10.0 ] +// A => [ 2.0, 4.0, 6.0, 2.0, 5.0, 8.0, 3.0, 2.0, 10.0 ] ``` The function has the following additional parameters: @@ -111,11 +111,11 @@ While [`typed array`][mdn-typed-array] views mandate a view offset based on the ```javascript var Float64Array = require( '@stdlib/array/float64' ); -var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 1.0, 2.0, 3.0, 2.0, 1.0 ] ); var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); dsyr.ndarray( 'upper', 3, 1.0, x, -2, 4, A, 3, 1, 0 ); -// A => [ 26.0, 17.0, 8.0, 0.0, 10.0, 5.0, 0.0, 0.0, 2.0 ] +// A => [ 26.0, 17.0, 8.0, 2.0, 10.0, 5.0, 3.0, 2.0, 2.0 ] ``` @@ -149,11 +149,17 @@ var opts = { var N = 3; -var A = ones( N*N, opts.dtype ); +// Define 3x3 symmetric matrices: +var A1 = ones( N*N, opts.dtype ); +var A2 = ones( N*N, opts.dtype ); + var x = discreteUniform( N, -10.0, 10.0, opts ); -dsyr( 'row-major', 'upper', 3, 1.0, x, 1, A, 3 ); -console.log( A ); +dsyr( 'row-major', 'upper', 3, 1.0, x, 1, A1, 3 ); +console.log( A1 ); + +dsyr.ndarray( 'upper', 3, 1.0, x, 1, 0, A2, 3, 1, 0 ); +console.log( A2 ); ``` @@ -193,7 +199,7 @@ Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scala ```c #include "stdlib/blas/base/shared.h" -double A[] = { 1.0, 0.0, 0.0, 2.0, 1.0, 0.0, 3.0, 2.0, 1.0 }; +double A[] = { 1.0, 2.0, 3.0, 2.0, 1.0, 2.0, 3.0, 2.0, 1.0 }; const double x[] = { 1.0, 2.0, 3.0 }; c_dsyr( CblasColMajor, CblasUpper, 3, 1.0, x, 1, A, 3 ); @@ -202,7 +208,7 @@ c_dsyr( CblasColMajor, CblasUpper, 3, 1.0, x, 1, A, 3 ); The function accepts the following arguments: - **layout**: `[in] CBLAS_LAYOUT` storage layout. -- **uplo**: `[in] CBLAS_UPLO` specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied. +- **uplo**: `[in] CBLAS_UPLO` specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced. - **N**: `[in] CBLAS_INT` number of elements along each dimension of `A`. - **alpha**: `[in] double` scalar constant. - **X**: `[in] double*` input array. @@ -221,7 +227,7 @@ Performs the symmetric rank 1 operation `A = α*x*x^T + A`, using alternative in ```c #include "stdlib/blas/base/shared.h" -double A[] = { 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 }; +double A[] = { 1.0, 2.0, 3.0, 2.0, 1.0, 2.0, 3.0, 2.0, 1.0 }; const double x[] = { 1.0, 2.0, 3.0 }; c_dsyr_ndarray( CblasUpper, 3, 1.0, x, 1, 0, A, 3, 1, 0 ); @@ -229,7 +235,7 @@ c_dsyr_ndarray( CblasUpper, 3, 1.0, x, 1, 0, A, 3, 1, 0 ); The function accepts the following arguments: -- **uplo**: `[in] CBLAS_UPLO` specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied. +- **uplo**: `[in] CBLAS_UPLO` specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced. - **N**: `[in] CBLAS_INT` number of elements along each dimension of `A`. - **alpha**: `[in] double` scalar constant. - **X**: `[in] double*` input array. @@ -268,33 +274,39 @@ void c_dsyr_ndarray( const CBLAS_UPLO uplo, const CBLAS_INT N, const double alph #include int main( void ) { - // Define a 3x3 symmetric matrix stored in row-major layout: - double A[ 3*3 ] = { - 1.0, 0.0, 0.0, - 2.0, 1.0, 0.0, + // Define 3x3 symmetric matrices stored in row-major layout: + double A1[ 3*3 ] = { + 1.0, 2.0, 3.0, + 2.0, 1.0, 2.0, + 3.0, 2.0, 1.0 + }; + + double A2[ 3*3 ] = { + 1.0, 2.0, 3.0, + 2.0, 1.0, 2.0, 3.0, 2.0, 1.0 }; // Define `x` vector: const double x[ 3 ] = { 1.0, 2.0, 3.0 }; - // Specify the number of elements along each dimension of `A`: + // Specify the number of elements along each dimension of `A1` and `A2`: const int N = 3; // Perform the symmetric rank 1 operation `A = α*x*x^T + A`: - c_dsyr( CblasColMajor, CblasUpper, N, 1.0, x, 1, A, N ); + c_dsyr( CblasColMajor, CblasUpper, N, 1.0, x, 1, A1, N ); // Print the result: for ( int i = 0; i < N*N; i++ ) { - printf( "A[ %i ] = %f\n", i, A[ i ] ); + printf( "A1[ %i ] = %f\n", i, A1[ i ] ); } // Perform the symmetric rank 1 operation `A = α*x*x^T + A` using alternative semantics indexing: - c_dsyr_ndarray( CblasUpper, N, 1.0, x, 1, 0, A, N, 1, 0 ); + c_dsyr_ndarray( CblasUpper, N, 1.0, x, 1, 0, A2, N, 1, 0 ); // Print the result: for ( int i = 0; i < N*N; i++ ) { - printf( "A[ %i ] = %f\n", i, A[ i ] ); + printf( "A2[ %i ] = %f\n", i, A[ i ] ); } } ``` diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/dsyr/docs/repl.txt index c301ffd1d0c9..04fcfcf5b646 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/dsyr/docs/repl.txt @@ -48,22 +48,22 @@ -------- // Standard usage: > var x = new {{alias:@stdlib/array/float64}}( [ 1.0, 1.0 ] ); - > var A = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0, 0.0, 2.0 ] ); + > var A = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0, 2.0, 1.0 ] ); > {{alias}}( 'row-major', 'upper', 2, 1.0, x, 1, A, 2 ) - [ 2.0, 3.0, 0.0, 3.0 ] + [ 2.0, 3.0, 2.0, 2.0 ] // Advanced indexing: > var x = new {{alias:@stdlib/array/float64}}( [ 1.0, 1.0 ] ); - > var A = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0, 0.0, 2.0 ] ); + > var A = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0, 2.0, 1.0 ] ); > {{alias}}( 'row-major', 'upper', 2, 1.0, x, -1, A, 2 ) - [ 2.0, 3.0, 0.0, 3.0 ] + [ 2.0, 3.0, 2.0, 2.0 ] // Using typed array views: > var x0 = new {{alias:@stdlib/array/float64}}( [ 0.0, 1.0, 1.0 ] ); - > A = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0, 0.0, 2.0 ] ); + > A = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0, 2.0, 1.0 ] ); > var x1 = new {{alias:@stdlib/array/float64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); > {{alias}}( 'row-major', 'upper', 2, 1.0, x, 1, A, 2 ) - [ 2.0, 3.0, 0.0, 3.0 ] + [ 2.0, 3.0, 2.0, 2.0 ] {{alias}}.ndarray( uplo, N, α, x, sx, ox, A, sa1, sa2, oa ) @@ -116,9 +116,9 @@ Examples -------- > var x = new {{alias:@stdlib/array/float64}}( [ 1.0, 1.0 ] ); - > var A = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0, 0.0, 2.0 ] ); + > var A = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0, 2.0, 1.0 ] ); > {{alias}}.ndarray( 'upper', 2, 1.0, x, 1, 0, A, 2, 1, 0 ) - [ 2.0, 3.0, 0.0, 3.0 ] + [ 2.0, 3.0, 2.0, 2.0 ] See Also -------- diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/dsyr/docs/types/index.d.ts index 945ee06c50e2..1e87b3720a3c 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/dsyr/docs/types/index.d.ts @@ -42,11 +42,11 @@ interface Routine { * @example * var Float64Array = require( '@stdlib/array/float64' ); * - * var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 0.0, 1.0, 2.0 ], [ 0.0, 0.0, 1.0 ] ] + * var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 1.0, 2.0, 3.0, 2.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 2.0, 1.0, 2.0 ], [ 3.0, 2.0, 1.0 ] ] * var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); * * dsyr( 'row-major', 'upper', 3, 1.0, x, 1, A, 3 ); - * // A => [ 2.0, 4.0, 6.0, 0.0, 5.0, 8.0, 0.0, 0.0, 10.0 ] + * // A => [ 2.0, 4.0, 6.0, 2.0, 5.0, 8.0, 3.0, 2.0, 10.0 ] */ ( order: Layout, uplo: MatrixTriangle, N: number, alpha: number, x: Float64Array, strideX: number, A: Float64Array, LDA: number ): Float64Array; @@ -68,11 +68,11 @@ interface Routine { * @example * var Float64Array = require( '@stdlib/array/float64' ); * - * var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 0.0, 1.0, 2.0 ], [ 0.0, 0.0, 1.0 ] ] + * var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 1.0, 2.0, 3.0, 2.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 2.0, 1.0, 2.0 ], [ 3.0, 2.0, 1.0 ] ] * var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); * * dsyr.ndarray( 'upper', 3, 1.0, x, 1, 0, A, 3, 1, 0 ); - * // A => [ 2.0, 4.0, 6.0, 0.0, 5.0, 8.0, 0.0, 0.0, 10.0 ] + * // A => [ 2.0, 4.0, 6.0, 2.0, 5.0, 8.0, 3.0, 2.0, 10.0 ] */ ndarray( uplo: MatrixTriangle, N: number, alpha: number, x: Float64Array, strideX: number, offsetX: number, A: Float64Array, strideA1: number, strideA2: number, offsetA: number ): Float64Array; } @@ -93,20 +93,20 @@ interface Routine { * @example * var Float64Array = require( '@stdlib/array/float64' ); * -* var A = new Float64Array( [ 1.0, 1.0, 1.0, 0.0, 2.0, 2.0, 0.0, 0.0, 3.0 ] ); +* var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 1.0, 2.0, 3.0, 2.0, 1.0 ] ); * var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); * -* dsyr( 'column-major', 'lower', 3, 2.0, x, 1, A, 3 ); -* // y => [ 3.0, 5.0, 7.0, 0.0, 10.0, 14.0, 0.0, 0.0, 21.0 ] +* dsyr( 'row-major', 'upper', 3, 1.0, x, 1, A, 3 ); +* // A => [ 2.0, 4.0, 6.0, 2.0, 5.0, 8.0, 3.0, 2.0, 10.0 ] * * @example * var Float64Array = require( '@stdlib/array/float64' ); * -* var A = new Float64Array( [ 1.0, 1.0, 1.0, 0.0, 2.0, 2.0, 0.0, 0.0, 3.0 ] ); +* var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 1.0, 2.0, 3.0, 2.0, 1.0 ] ); * var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); * -* dsyr.ndarray( 'lower', 3, 2.0, x, 1, 0, A, 3, 1, 0 ); -* // y => [ 3.0, 5.0, 7.0, 0.0, 10.0, 14.0, 0.0, 0.0, 21.0 ] +* dsyr.ndarray( 'upper', 3, 1.0, x, 1, 0, A, 3, 1, 0 ); +* // A => [ 2.0, 4.0, 6.0, 2.0, 5.0, 8.0, 3.0, 2.0, 10.0 ] */ declare var dsyr: Routine; diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c b/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c index d231135cf411..fcc57cf9d4f4 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c @@ -21,32 +21,38 @@ #include int main( void ) { - // Define a 3x3 symmetric matrix stored in row-major layout: - double A[ 3*3 ] = { - 1.0, 0.0, 0.0, - 2.0, 1.0, 0.0, + // Define 3x3 symmetric matrices stored in row-major layout: + double A1[ 3*3 ] = { + 1.0, 2.0, 3.0, + 2.0, 1.0, 2.0, + 3.0, 2.0, 1.0 + }; + + double A2[ 3*3 ] = { + 1.0, 2.0, 3.0, + 2.0, 1.0, 2.0, 3.0, 2.0, 1.0 }; // Define `x` vector: const double x[ 3 ] = { 1.0, 2.0, 3.0 }; - // Specify the number of elements along each dimension of `A`: + // Specify the number of elements along each dimension of `A1` and `A2`: const int N = 3; // Perform the symmetric rank 1 operation `A = α*x*x^T + A`: - c_dsyr( CblasColMajor, CblasUpper, N, 1.0, x, 1, A, N ); + c_dsyr( CblasColMajor, CblasUpper, N, 1.0, x, 1, A1, N ); // Print the result: for ( int i = 0; i < N*N; i++ ) { - printf( "A[ %i ] = %f\n", i, A[ i ] ); + printf( "A1[ %i ] = %f\n", i, A1[ i ] ); } // Perform the symmetric rank 1 operation `A = α*x*x^T + A` using alternative semantics indexing: - c_dsyr_ndarray( CblasUpper, N, 1.0, x, 1, 0, A, N, 1, 0 ); + c_dsyr_ndarray( CblasUpper, N, 1.0, x, 1, 0, A2, N, 1, 0 ); // Print the result: for ( int i = 0; i < N*N; i++ ) { - printf( "A[ %i ] = %f\n", i, A[ i ] ); + printf( "A2[ %i ] = %f\n", i, A[ i ] ); } } diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/examples/index.js b/lib/node_modules/@stdlib/blas/base/dsyr/examples/index.js index 198ebb4ad194..7a3f4db37470 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr/examples/index.js @@ -28,8 +28,14 @@ var opts = { var N = 3; -var A = ones( N*N, opts.dtype ); +// Define 3x3 symmetric matrices: +var A1 = ones( N*N, opts.dtype ); +var A2 = ones( N*N, opts.dtype ); + var x = discreteUniform( N, -10.0, 10.0, opts ); -dsyr( 'row-major', 'upper', 3, 1.0, x, 1, A, 3 ); -console.log( A ); +dsyr( 'row-major', 'upper', 3, 1.0, x, 1, A1, 3 ); +console.log( A1 ); + +dsyr.ndarray( 'upper', 3, 1.0, x, 1, 0, A2, 3, 1, 0 ); +console.log( A2 ); diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/base.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/base.js index bdc56a39a983..c449760c8c5a 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr/lib/base.js @@ -44,11 +44,11 @@ var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); * @example * var Float64Array = require( '@stdlib/array/float64' ); * -* var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 0.0, 1.0, 2.0 ], [ 0.0, 0.0, 1.0 ] ] +* var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 1.0, 2.0, 3.0, 2.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 2.0, 1.0, 2.0 ], [ 3.0, 2.0, 1.0 ] ] * var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); * * dsyr( 'upper', 3, 1.0, x, 1, 0, A, 3, 1, 0 ); -* // A => [ 2.0, 4.0, 6.0, 0.0, 5.0, 8.0, 0.0, 0.0, 10.0 ] +* // A => [ 2.0, 4.0, 6.0, 2.0, 5.0, 8.0, 3.0, 2.0, 10.0 ] */ function dsyr( uplo, N, alpha, x, strideX, offsetX, A, strideA1, strideA2, offsetA ) { // eslint-disable-line max-len var isrm; diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.js index ab7f293e9ef2..a2e847794afc 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.js @@ -52,11 +52,11 @@ var base = require( './base.js' ); * @example * var Float64Array = require( '@stdlib/array/float64' ); * -* var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 0.0, 1.0, 2.0 ], [ 0.0, 0.0, 1.0 ] ] +* var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 1.0, 2.0, 3.0, 2.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 2.0, 1.0, 2.0 ], [ 3.0, 2.0, 1.0 ] ] * var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); * * dsyr( 'row-major', 'upper', 3, 1.0, x, 1, A, 3 ); -* // A => [ 2.0, 4.0, 6.0, 0.0, 5.0, 8.0, 0.0, 0.0, 10.0 ] +* // A => [ 2.0, 4.0, 6.0, 2.0, 5.0, 8.0, 3.0, 2.0, 10.0 ] */ function dsyr( order, uplo, N, alpha, x, strideX, A, LDA ) { var sa1; diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.native.js index 22d3f3aab0ff..bf0a44fdc62a 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.native.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.native.js @@ -35,7 +35,7 @@ var addon = require( './../src/addon.node' ); * Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. * * @param {string} order - storage layout -* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied +* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced * @param {NonNegativeInteger} N - number of elements along each dimension of `A` * @param {number} alpha - scalar * @param {Float64Array} x - input vector @@ -52,11 +52,11 @@ var addon = require( './../src/addon.node' ); * @example * var Float64Array = require( '@stdlib/array/float64' ); * -* var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 0.0, 1.0, 2.0 ], [ 0.0, 0.0, 1.0 ] ] +* var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 1.0, 2.0, 3.0, 2.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 2.0, 1.0, 2.0 ], [ 3.0, 2.0, 1.0 ] ] * var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); * * dsyr( 'row-major', 'upper', 3, 1.0, x, 1, A, 3 ); -* // A => [ 2.0, 4.0, 6.0, 0.0, 5.0, 8.0, 0.0, 0.0, 10.0 ] +* // A => [ 2.0, 4.0, 6.0, 2.0, 5.0, 8.0, 3.0, 2.0, 10.0 ] */ function dsyr( order, uplo, N, alpha, x, strideX, A, LDA ) { if ( !isLayout( order ) ) { diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/index.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/index.js index 3275f78309cb..1fb4f35fc06b 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr/lib/index.js @@ -27,21 +27,21 @@ * var Float64Array = require( '@stdlib/array/float64' ); * var dsyr = require( '@stdlib/blas/base/dsyr' ); * -* var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 0.0, 1.0, 2.0 ], [ 0.0, 0.0, 1.0 ] ] +* var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 1.0, 2.0, 3.0, 2.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 2.0, 1.0, 2.0 ], [ 3.0, 2.0, 1.0 ] ] * var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); * * dsyr( 'row-major', 'upper', 3, 1.0, x, 1, A, 3 ); -* // A => [ 2.0, 4.0, 6.0, 0.0, 5.0, 8.0, 0.0, 0.0, 10.0 ] +* // A => [ 2.0, 4.0, 6.0, 2.0, 5.0, 8.0, 3.0, 2.0, 10.0 ] * * @example * var Float64Array = require( '@stdlib/array/float64' ); * var dsyr = require( '@stdlib/blas/base/dsyr' ); * -* var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 0.0, 1.0, 2.0 ], [ 0.0, 0.0, 1.0 ] ] +* var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 1.0, 2.0, 3.0, 2.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 2.0, 1.0, 2.0 ], [ 3.0, 2.0, 1.0 ] ] * var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); * * dsyr.ndarray( 'upper', 3, 1.0, x, 1, 0, A, 3, 1, 0 ); -* // A => [ 2.0, 4.0, 6.0, 0.0, 5.0, 8.0, 0.0, 0.0, 10.0 ] +* // A => [ 2.0, 4.0, 6.0, 2.0, 5.0, 8.0, 3.0, 2.0, 10.0 ] */ // MODULES // diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js index 55413d48ca42..17f234ce87e5 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js @@ -50,11 +50,11 @@ var base = require( './base.js' ); * @example * var Float64Array = require( '@stdlib/array/float64' ); * -* var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 0.0, 1.0, 2.0 ], [ 0.0, 0.0, 1.0 ] ] +* var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 1.0, 2.0, 3.0, 2.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 2.0, 1.0, 2.0 ], [ 3.0, 2.0, 1.0 ] ] * var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); * * dsyr( 'upper', 3, 1.0, x, 1, 0, A, 3, 1, 0 ); -* // A => [ 2.0, 4.0, 6.0, 0.0, 5.0, 8.0, 0.0, 0.0, 10.0 ] +* // A => [ 2.0, 4.0, 6.0, 2.0, 5.0, 8.0, 3.0, 2.0, 10.0 ] */ function dsyr( uplo, N, alpha, x, strideX, offsetX, A, strideA1, strideA2, offsetA ) { // eslint-disable-line max-len if ( !isMatrixTriangle( uplo ) ) { diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js index 469d5857fdf5..c4f3da204b09 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js @@ -31,9 +31,9 @@ var addon = require( './../src/addon.node' ); /** * Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. * -* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied +* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced * @param {NonNegativeInteger} N - number of elements along each dimension of `A` -* @param {number} alpha - scalar constant +* @param {number} alpha - scalar * @param {Float64Array} x - input vector * @param {integer} strideX - `x` stride length * @param {NonNegativeInteger} offsetX - starting index for `x` @@ -49,11 +49,11 @@ var addon = require( './../src/addon.node' ); * @example * var Float64Array = require( '@stdlib/array/float64' ); * -* var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 0.0, 1.0, 2.0 ], [ 0.0, 0.0, 1.0 ] ] +* var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 1.0, 2.0, 3.0, 2.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 2.0, 1.0, 2.0 ], [ 3.0, 2.0, 1.0 ] ] * var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); * * dsyr( 'upper', 3, 1.0, x, 1, 0, A, 3, 1, 0 ); -* // A => [ 2.0, 4.0, 6.0, 0.0, 5.0, 8.0, 0.0, 0.0, 10.0 ] +* // A => [ 2.0, 4.0, 6.0, 2.0, 5.0, 8.0, 3.0, 2.0, 10.0 ] */ function dsyr( uplo, N, alpha, x, strideX, offsetX, A, strideA1, strideA2, offsetA ) { // eslint-disable-line max-len if ( !isMatrixTriangle( uplo ) ) { diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c index 7484c0aff3f3..62201e333b21 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c @@ -45,7 +45,7 @@ void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT layout, const CBLAS_UPLO uplo, const return; } if ( uplo != CblasLower && uplo != CblasUpper ) { - c_xerbla( 2, "c_dsyr", "Error: invalid argument. Second argument must specify whether to reference the lower or upper triangular matrixecond argument must specify whether to reference the lower or upper triangular matrix. Value: `%d`.", uplo ); + c_xerbla( 2, "c_dsyr", "Error: invalid argument. Second argument must specify whether to reference the lower or upper triangular matrix. Value: `%d`.", uplo ); return; } if ( N < 0 ) { diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c index 065bfabedb27..828f9ec5bb5d 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c @@ -52,7 +52,7 @@ void API_SUFFIX(c_dsyr_ndarray)( const CBLAS_UPLO uplo, const CBLAS_INT N, const // Perform input argument validation... if ( uplo != CblasLower && uplo != CblasUpper ) { - c_xerbla( 1, "c_dsyr_ndarray", "Error: invalid argument. First argument must specify whether to reference the lower or upper triangular matrixecond argument must specify whether to reference the lower or upper triangular matrix. Value: `%d`.", uplo ); + c_xerbla( 1, "c_dsyr_ndarray", "Error: invalid argument. First argument must specify whether to reference the lower or upper triangular matrix. Value: `%d`.", uplo ); return; } if ( N < 0 ) { From cd4c8781af4437feb866e08b420e51a18576cea3 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Mon, 30 Jun 2025 16:27:40 +0530 Subject: [PATCH 36/48] chore: add suggestions --- 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: missing_dependencies - 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 --- --- lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c b/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c index fcc57cf9d4f4..5d18d11025a1 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c @@ -53,6 +53,6 @@ int main( void ) { // Print the result: for ( int i = 0; i < N*N; i++ ) { - printf( "A2[ %i ] = %f\n", i, A[ i ] ); + printf( "A2[ %i ] = %f\n", i, A2[ i ] ); } } From d871fbd527985f3bdc5a245d34bf8fd006f135d2 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Mon, 30 Jun 2025 16:42:28 +0530 Subject: [PATCH 37/48] chore: update jsdoc --- 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: 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 --- --- lib/node_modules/@stdlib/blas/base/dsyr/lib/base.js | 2 +- lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.js | 2 +- lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.native.js | 2 +- lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js | 2 +- lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/base.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/base.js index c449760c8c5a..3cab518d9dd5 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr/lib/base.js @@ -31,7 +31,7 @@ var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); * @private * @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced * @param {NonNegativeInteger} N - number of elements along each dimension of `A` -* @param {number} alpha - scalar +* @param {number} alpha - scalar constant * @param {Float64Array} x - input vector * @param {integer} strideX - `x` stride length * @param {NonNegativeInteger} offsetX - starting index for `x` diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.js index a2e847794afc..c8c14a02e4ff 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.js @@ -37,7 +37,7 @@ var base = require( './base.js' ); * @param {string} order - storage layout * @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced * @param {NonNegativeInteger} N - number of elements along each dimension of `A` -* @param {number} alpha - scalar +* @param {number} alpha - scalar constant * @param {Float64Array} x - input vector * @param {integer} strideX - `x` stride length * @param {Float64Array} A - input matrix diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.native.js index bf0a44fdc62a..c5fb1080101e 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.native.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.native.js @@ -37,7 +37,7 @@ var addon = require( './../src/addon.node' ); * @param {string} order - storage layout * @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced * @param {NonNegativeInteger} N - number of elements along each dimension of `A` -* @param {number} alpha - scalar +* @param {number} alpha - scalar constant * @param {Float64Array} x - input vector * @param {integer} strideX - `x` stride length * @param {Float64Array} A - input matrix diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js index 17f234ce87e5..e82b95100197 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js @@ -32,7 +32,7 @@ var base = require( './base.js' ); * * @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced * @param {NonNegativeInteger} N - number of elements along each dimension of `A` -* @param {number} alpha - scalar +* @param {number} alpha - scalar constant * @param {Float64Array} x - input vector * @param {integer} strideX - `x` stride length * @param {NonNegativeInteger} offsetX - starting index for `x` diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js index c4f3da204b09..0738834597cf 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js @@ -33,7 +33,7 @@ var addon = require( './../src/addon.node' ); * * @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced * @param {NonNegativeInteger} N - number of elements along each dimension of `A` -* @param {number} alpha - scalar +* @param {number} alpha - scalar constant * @param {Float64Array} x - input vector * @param {integer} strideX - `x` stride length * @param {NonNegativeInteger} offsetX - starting index for `x` From 9edb8f3200417aa43cd492a88db7e67ae2088e53 Mon Sep 17 00:00:00 2001 From: Athan Date: Fri, 11 Jul 2025 00:54:11 -0700 Subject: [PATCH 38/48] Apply suggestions from code review Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/base/dsyr/README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/README.md b/lib/node_modules/@stdlib/blas/base/dsyr/README.md index b5715360b142..53e4fcf0dbdb 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/README.md +++ b/lib/node_modules/@stdlib/blas/base/dsyr/README.md @@ -75,14 +75,14 @@ Note that indexing is relative to the first index. To introduce an offset, use [ var Float64Array = require( '@stdlib/array/float64' ); // Initial arrays... -var x0 = new Float64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +var x0 = new Float64Array( [ 0.0, 3.0, 2.0, 1.0 ] ); var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 1.0, 2.0, 3.0, 2.0, 1.0 ] ); // Create offset views... var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element dsyr( 'row-major', 'upper', 3, 1.0, x1, -1, A, 3 ); -// A => [ 2.0, 3.0, 4.0, 2.0, 2.0, 3.0, 3.0, 2.0, 2.0 ] +// A => [ 2.0, 4.0, 6.0, 2.0, 5.0, 8.0, 3.0, 2.0, 10.0 ] ``` #### dsyr.ndarray( uplo, N, α, x, sx, ox, A, sa1, sa2, oa ) @@ -149,10 +149,11 @@ var opts = { var N = 3; -// Define 3x3 symmetric matrices: +// Create N-by-N symmetric matrices: var A1 = ones( N*N, opts.dtype ); var A2 = ones( N*N, opts.dtype ); +// Create a random vector: var x = discreteUniform( N, -10.0, 10.0, opts ); dsyr( 'row-major', 'upper', 3, 1.0, x, 1, A1, 3 ); @@ -217,7 +218,7 @@ The function accepts the following arguments: - **LDA**: `[in] CBLAS_INT` stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`). ```c -void c_dsyr( const CBLAS_LAYOUT layout, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *x, const CBLAS_INT strideX, double *A, const CBLAS_INT LDA ) +void c_dsyr( const CBLAS_LAYOUT layout, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *A, const CBLAS_INT LDA ) ``` #### c_dsyr_ndarray( uplo, N, alpha, \*X, sx, ox, \*A, sa1, sa2, oa ) @@ -247,7 +248,7 @@ The function accepts the following arguments: - **oa**: `[in] CBLAS_INT` starting index for `A`. ```c -void c_dsyr_ndarray( const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *x, const CBLAS_INT strideX, const CBLAS_INT offsetX, double *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA ) +void c_dsyr_ndarray( const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, double *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA ) ``` @@ -301,7 +302,7 @@ int main( void ) { printf( "A1[ %i ] = %f\n", i, A1[ i ] ); } - // Perform the symmetric rank 1 operation `A = α*x*x^T + A` using alternative semantics indexing: + // Perform the symmetric rank 1 operation `A = α*x*x^T + A` using alternative indexing semantics: c_dsyr_ndarray( CblasUpper, N, 1.0, x, 1, 0, A2, N, 1, 0 ); // Print the result: From 1e76bd7e6f6a0642eaed3dbbcc960c9f7ba7dc95 Mon Sep 17 00:00:00 2001 From: Athan Date: Fri, 11 Jul 2025 01:01:11 -0700 Subject: [PATCH 39/48] docs: update comment Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c b/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c index 5d18d11025a1..037d201e5ade 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c @@ -34,7 +34,7 @@ int main( void ) { 3.0, 2.0, 1.0 }; - // Define `x` vector: + // Define a vector: const double x[ 3 ] = { 1.0, 2.0, 3.0 }; // Specify the number of elements along each dimension of `A1` and `A2`: From 2ebc225f32b5b3cc66bc0ebf39c54385e8857c58 Mon Sep 17 00:00:00 2001 From: Athan Date: Fri, 11 Jul 2025 01:01:35 -0700 Subject: [PATCH 40/48] docs: update comment Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/base/dsyr/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/README.md b/lib/node_modules/@stdlib/blas/base/dsyr/README.md index 53e4fcf0dbdb..3ccb1ef22266 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/README.md +++ b/lib/node_modules/@stdlib/blas/base/dsyr/README.md @@ -288,7 +288,7 @@ int main( void ) { 3.0, 2.0, 1.0 }; - // Define `x` vector: + // Define a vector: const double x[ 3 ] = { 1.0, 2.0, 3.0 }; // Specify the number of elements along each dimension of `A1` and `A2`: From 5a20e0f40571ae3023caed7da9d1675eabd73db2 Mon Sep 17 00:00:00 2001 From: Athan Date: Fri, 11 Jul 2025 01:02:14 -0700 Subject: [PATCH 41/48] docs: update comment Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c b/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c index 037d201e5ade..eb95bc6abcd1 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c @@ -48,7 +48,7 @@ int main( void ) { printf( "A1[ %i ] = %f\n", i, A1[ i ] ); } - // Perform the symmetric rank 1 operation `A = α*x*x^T + A` using alternative semantics indexing: + // Perform the symmetric rank 1 operation `A = α*x*x^T + A` using alternative indexing semantics: c_dsyr_ndarray( CblasUpper, N, 1.0, x, 1, 0, A2, N, 1, 0 ); // Print the result: From 520a1fbd5f70df92bb5c122e8e0ba798084b7449 Mon Sep 17 00:00:00 2001 From: Athan Date: Fri, 11 Jul 2025 01:03:09 -0700 Subject: [PATCH 42/48] docs: update comments Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/base/dsyr/examples/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/examples/index.js b/lib/node_modules/@stdlib/blas/base/dsyr/examples/index.js index 7a3f4db37470..00a247d942b1 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr/examples/index.js @@ -28,10 +28,11 @@ var opts = { var N = 3; -// Define 3x3 symmetric matrices: +// Create N-by-N symmetric matrices: var A1 = ones( N*N, opts.dtype ); var A2 = ones( N*N, opts.dtype ); +// Create a random vector: var x = discreteUniform( N, -10.0, 10.0, opts ); dsyr( 'row-major', 'upper', 3, 1.0, x, 1, A1, 3 ); From b371c634518f0389125ae2df3833beb2e34935c8 Mon Sep 17 00:00:00 2001 From: Athan Date: Fri, 11 Jul 2025 01:07:54 -0700 Subject: [PATCH 43/48] docs: update comment Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c index dd85d6f8cbb9..4fd9b4910ab0 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c @@ -52,7 +52,7 @@ static napi_value addon( napi_env env, napi_callback_info info ) { if ( layout == CblasColMajor ) { sa1 = 1; sa2 = LDA; - } else { // layout === CblasRowMajor + } else { // layout == CblasRowMajor sa1 = LDA; sa2 = 1; } From dfd89981cfd1e8fbf21e985193f22418c2a45bfa Mon Sep 17 00:00:00 2001 From: Athan Date: Fri, 11 Jul 2025 01:10:17 -0700 Subject: [PATCH 44/48] Apply suggestions from code review Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c index 62201e333b21..7a76d1b6361b 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c @@ -24,8 +24,8 @@ /** * Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. * -* @param layout storage layout -* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied +* @param layout storage layout +* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced * @param N number of elements along each dimension of `A` * @param alpha scalar constant * @param X input vector @@ -73,7 +73,7 @@ void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT layout, const CBLAS_UPLO uplo, const if ( layout == CblasColMajor ) { sa1 = 1; sa2 = LDA; - } else { // layout === CblasRowMajor + } else { // layout == CblasRowMajor sa1 = LDA; sa2 = 1; } From 6ef0e5da055ee2e8690216ca3b754d1214c0940e Mon Sep 17 00:00:00 2001 From: Athan Date: Fri, 11 Jul 2025 01:11:07 -0700 Subject: [PATCH 45/48] docs: fix alignment Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c index 55a08568fc71..24ea109eb577 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c @@ -23,7 +23,7 @@ /** * Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. * -* @param layout storage layout +* @param layout storage layout * @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied * @param N number of elements along each dimension of `A` * @param alpha scalar constant From 3a09ffe8e267617acde69201895c972f7812e654 Mon Sep 17 00:00:00 2001 From: Athan Date: Fri, 11 Jul 2025 01:11:42 -0700 Subject: [PATCH 46/48] docs: update description Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c index 24ea109eb577..b830e783deb1 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c @@ -24,7 +24,7 @@ * Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. * * @param layout storage layout -* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied +* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced * @param N number of elements along each dimension of `A` * @param alpha scalar constant * @param x input vector From c18fde2f7c0df621bce30efa00c18b2cb2293829 Mon Sep 17 00:00:00 2001 From: Athan Date: Fri, 11 Jul 2025 01:12:25 -0700 Subject: [PATCH 47/48] docs: update description Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c index 828f9ec5bb5d..dd39dd88b68c 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c @@ -24,7 +24,7 @@ /** * Performs the symmetric rank 1 operation `A = α*x*x^T + A`, using alternative indexing semantics and where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix. * -* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied +* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced * @param N number of elements along each dimension of `A` * @param alpha scalar constant * @param X input vector From 33e7723c36536d7329957cc7973e0eb8c16617bf Mon Sep 17 00:00:00 2001 From: Athan Date: Fri, 11 Jul 2025 01:14:25 -0700 Subject: [PATCH 48/48] docs: update comment Signed-off-by: Athan --- lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c index dd39dd88b68c..13d6217c14bb 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c @@ -100,7 +100,7 @@ void API_SUFFIX(c_dsyr_ndarray)( const CBLAS_UPLO uplo, const CBLAS_INT N, const } return; } - // ( isrm && uplo == CblasUpper ) || ( !isrm && uplo === CblasLower ) + // ( isrm && uplo == CblasUpper ) || ( !isrm && uplo == CblasLower ) ix1 = ox; for ( i1 = 0; i1 < N; i1++ ) { if ( X[ ix1 ] != 0.0 ) {