From 339ec95b6e0904898de09549959d9c601a4c5dac Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Sat, 5 Apr 2025 19:24:03 +0530 Subject: [PATCH 1/3] 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 --- --- .../@stdlib/blas/base/dsyr/README.md | 85 ++- .../blas/base/dsyr/benchmark/benchmark.js | 0 .../base/dsyr/benchmark/benchmark.native.js | 109 ++++ .../base/dsyr/benchmark/benchmark.ndarray.js | 0 .../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 +++++++++ .../@stdlib/blas/base/dsyr/docs/repl.txt | 0 .../blas/base/dsyr/docs/types/index.d.ts | 0 .../@stdlib/blas/base/dsyr/docs/types/test.ts | 0 .../blas/base/dsyr/examples/c/Makefile | 146 +++++ .../blas/base/dsyr/examples/c/example.c | 46 ++ .../@stdlib/blas/base/dsyr/examples/index.js | 0 .../@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/base.js | 0 .../@stdlib/blas/base/dsyr/lib/dsyr.js | 0 .../@stdlib/blas/base/dsyr/lib/dsyr.native.js | 60 ++ .../@stdlib/blas/base/dsyr/lib/index.js | 0 .../@stdlib/blas/base/dsyr/lib/main.js | 0 .../@stdlib/blas/base/dsyr/lib/native.js | 35 ++ .../@stdlib/blas/base/dsyr/lib/ndarray.js | 0 .../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 ++ .../column_major_complex_access_pattern.json | 0 .../dsyr/test/fixtures/column_major_l.json | 0 .../dsyr/test/fixtures/column_major_oa.json | 0 .../test/fixtures/column_major_sa1_sa2.json | 0 .../test/fixtures/column_major_sa1_sa2n.json | 0 .../test/fixtures/column_major_sa1n_sa2.json | 0 .../test/fixtures/column_major_sa1n_sa2n.json | 0 .../dsyr/test/fixtures/column_major_u.json | 0 .../dsyr/test/fixtures/column_major_xn.json | 0 .../dsyr/test/fixtures/column_major_xp.json | 0 .../row_major_complex_access_pattern.json | 0 .../base/dsyr/test/fixtures/row_major_l.json | 0 .../base/dsyr/test/fixtures/row_major_oa.json | 0 .../dsyr/test/fixtures/row_major_sa1_sa2.json | 0 .../test/fixtures/row_major_sa1_sa2n.json | 0 .../test/fixtures/row_major_sa1n_sa2.json | 0 .../test/fixtures/row_major_sa1n_sa2n.json | 0 .../base/dsyr/test/fixtures/row_major_u.json | 0 .../base/dsyr/test/fixtures/row_major_xn.json | 0 .../base/dsyr/test/fixtures/row_major_xp.json | 0 .../@stdlib/blas/base/dsyr/test/test.dsyr.js | 0 .../blas/base/dsyr/test/test.dsyr.native.js | 300 ++++++++++ .../@stdlib/blas/base/dsyr/test/test.js | 0 .../blas/base/dsyr/test/test.ndarray.js | 0 .../base/dsyr/test/test.ndarray.native.js | 563 ++++++++++++++++++ 56 files changed, 2904 insertions(+), 7 deletions(-) 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 create mode 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 create mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.ndarray.native.js create mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/Makefile create mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c create mode 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 create mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/examples/c/Makefile create mode 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 create mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/include.gypi create mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr.h create mode 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 create mode 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 create mode 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 create mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js create mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/manifest.json mode change 100644 => 100755 lib/node_modules/@stdlib/blas/base/dsyr/package.json create mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/src/Makefile create mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c create mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c create mode 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 create mode 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 create mode 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 index 62b1b6179a5d..cbc4f682ef0e --- 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.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 new file mode 100755 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.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 new file mode 100755 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 100755 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 100755 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 100755 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/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 new file mode 100755 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 100755 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/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 new file mode 100755 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/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 new file mode 100755 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.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 new file mode 100755 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 100755 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 old mode 100644 new mode 100755 index 9c3c693ea93c..ab37bcb25b13 --- 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 100755 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 100755 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 100755 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 100755 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/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 new file mode 100755 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.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 new file mode 100755 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 ecd04387a2aa59adfc4f428ca2d2dc63046bbb7b Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Sat, 5 Apr 2025 20:40:04 +0530 Subject: [PATCH 2/3] test: increase code coverage in blas/base/zaxpy --- 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: 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 --- --- .../@stdlib/blas/base/zaxpy/lib/ndarray.js | 5 +- .../blas/base/zaxpy/test/test.ndarray.js | 119 +++++++++++------- .../blas/base/zaxpy/test/test.zaxpy.js | 95 ++++++++------ 3 files changed, 131 insertions(+), 88 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/zaxpy/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/zaxpy/lib/ndarray.js index cd7ac3d72994..5fc2a235521a 100644 --- a/lib/node_modules/@stdlib/blas/base/zaxpy/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/zaxpy/lib/ndarray.js @@ -64,10 +64,7 @@ function zaxpy( N, za, zx, strideX, offsetX, zy, strideY, offsetY ) { var im; var i; - if ( N <= 0 ) { - return zy; - } - if ( dcabs1( za ) === 0.0 ) { + if ( N <= 0 || dcabs1( za ) === 0.0 ) { return zy; } re = real( za ); diff --git a/lib/node_modules/@stdlib/blas/base/zaxpy/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/zaxpy/test/test.ndarray.js index 176fc88a890d..0e9e16535946 100644 --- a/lib/node_modules/@stdlib/blas/base/zaxpy/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/zaxpy/test/test.ndarray.js @@ -78,7 +78,7 @@ tape( 'the function scales elements from `zx` by `za` and adds the result to `zy var zx; var zy; - zx = new Complex128Array( [ + zx = new Complex128Array([ 0.7, // 1 -0.8, // 1 -0.4, // 2 @@ -93,8 +93,8 @@ tape( 'the function scales elements from `zx` by `za` and adds the result to `zy 0.4, -0.6, 0.6 - ] ); - zy = new Complex128Array( [ + ]); + zy = new Complex128Array([ 0.6, // 1 -0.6, // 1 -0.9, // 2 @@ -109,13 +109,13 @@ tape( 'the function scales elements from `zx` by `za` and adds the result to `zy -0.3, 0.8, -0.7 - ] ); + ]); za = new Complex128( 0.4, -0.7 ); zaxpy( 4, za, zx, 1, 0, zy, 1, 0 ); viewY = new Float64Array( zy.buffer ); - expected = new Float64Array( [ + expected = new Float64Array([ 0.32, // 1 -1.41, // 1 -1.55, // 2 @@ -130,7 +130,7 @@ tape( 'the function scales elements from `zx` by `za` and adds the result to `zy -0.3, 0.8, -0.7 - ] ); + ]); isApprox( t, viewY, expected, 14.0 ); t.end(); }); @@ -142,7 +142,7 @@ tape( 'the function supports a `zx` stride', function test( t ) { var zx; var zy; - zx = new Complex128Array( [ + zx = new Complex128Array([ 0.7, // 1 -0.8, // 1 -0.4, @@ -157,8 +157,8 @@ tape( 'the function supports a `zx` stride', function test( t ) { 0.4, -0.6, // 4 0.6 // 4 - ] ); - zy = new Complex128Array( [ + ]); + zy = new Complex128Array([ 0.6, // 1 -0.6, // 1 -0.9, // 2 @@ -173,13 +173,13 @@ tape( 'the function supports a `zx` stride', function test( t ) { -0.3, 0.8, -0.7 - ] ); + ]); za = new Complex128( 0.4, -0.7 ); zaxpy( 4, za, zx, 2, 0, zy, 1, 0 ); viewY = new Float64Array( zy.buffer ); - expected = new Float64Array( [ + expected = new Float64Array([ 0.32, // 1 -1.41, // 1 -1.57, // 2 @@ -194,7 +194,7 @@ tape( 'the function supports a `zx` stride', function test( t ) { -0.3, 0.8, -0.7 - ] ); + ]); isApprox( t, viewY, expected, 14.0 ); t.end(); }); @@ -206,7 +206,7 @@ tape( 'the function supports a `zx` offset', function test( t ) { var zx; var zy; - zx = new Complex128Array( [ + zx = new Complex128Array([ 0.7, -0.8, -0.4, // 1 @@ -221,8 +221,8 @@ tape( 'the function supports a `zx` offset', function test( t ) { 0.4, // 3 -0.6, 0.6 - ] ); - zy = new Complex128Array( [ + ]); + zy = new Complex128Array([ 0.6, // 1 -0.6, // 1 -0.9, // 2 @@ -237,13 +237,13 @@ tape( 'the function supports a `zx` offset', function test( t ) { -0.3, 0.8, -0.7 - ] ); + ]); za = new Complex128( 0.4, -0.7 ); zaxpy( 3, za, zx, 2, 1, zy, 1, 0 ); viewY = new Float64Array( zy.buffer ); - expected = new Float64Array( [ + expected = new Float64Array([ -0.05, // 1 -0.6, // 1 -1.38, // 2 @@ -258,7 +258,7 @@ tape( 'the function supports a `zx` offset', function test( t ) { -0.3, 0.8, -0.7 - ] ); + ]); isApprox( t, viewY, expected, 14.0 ); t.end(); }); @@ -270,7 +270,7 @@ tape( 'the function supports a `zy` stride', function test( t ) { var zx; var zy; - zx = new Complex128Array( [ + zx = new Complex128Array([ 0.7, // 1 -0.8, // 1 -0.4, // 2 @@ -285,8 +285,8 @@ tape( 'the function supports a `zy` stride', function test( t ) { 0.4, -0.6, 0.6 - ] ); - zy = new Complex128Array( [ + ]); + zy = new Complex128Array([ 0.6, // 1 -0.6, // 1 -0.9, @@ -301,13 +301,13 @@ tape( 'the function supports a `zy` stride', function test( t ) { -0.3, 0.8, // 4 -0.7 // 4 - ] ); + ]); za = new Complex128( 0.4, -0.7 ); zaxpy( 4, za, zx, 1, 0, zy, 2, 0 ); viewY = new Float64Array( zy.buffer ); - expected = new Float64Array( [ + expected = new Float64Array([ 0.32, // 1 -1.41, // 1 -0.9, @@ -322,7 +322,7 @@ tape( 'the function supports a `zy` stride', function test( t ) { -0.3, 0.32, // 4 -1.16 // 4 - ] ); + ]); isApprox( t, viewY, expected, 14.0 ); t.end(); }); @@ -334,7 +334,7 @@ tape( 'the function supports a `zy` offset', function test( t ) { var zx; var zy; - zx = new Complex128Array( [ + zx = new Complex128Array([ 0.7, // 1 -0.8, // 1 -0.4, // 2 @@ -349,8 +349,8 @@ tape( 'the function supports a `zy` offset', function test( t ) { 0.4, -0.6, 0.6 - ] ); - zy = new Complex128Array( [ + ]); + zy = new Complex128Array([ 0.6, -0.6, -0.9, // 1 @@ -365,13 +365,13 @@ tape( 'the function supports a `zy` offset', function test( t ) { -0.3, // 3 0.8, -0.7 - ] ); + ]); za = new Complex128( 0.4, -0.7 ); zaxpy( 3, za, zx, 1, 0, zy, 2, 1 ); viewY = new Float64Array( zy.buffer ); - expected = new Float64Array( [ + expected = new Float64Array([ 0.6, -0.6, -1.18, // 1 @@ -386,7 +386,7 @@ tape( 'the function supports a `zy` offset', function test( t ) { -0.59, // 3 0.8, -0.7 - ] ); + ]); isApprox( t, viewY, expected, 14.0 ); t.end(); }); @@ -407,6 +407,29 @@ tape( 'the function returns a reference to the output array', function test( t ) t.end(); }); +tape( 'if provided `za` parameter equal to `0`, the function returns the second input array unchanged', function test( t ) { + var expected; + var viewY; + var za; + var zx; + var zy; + + zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); + zy = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); + za = new Complex128( 0.0, 0.0 ); + + viewY = new Float64Array( zy.buffer ); + expected = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); + + zaxpy( -1, za, zx, 1, 0, zy, 1, 0 ); + t.deepEqual( viewY, expected, 'returns expected value' ); + + zaxpy( 0, za, zx, 1, 0, zy, 1, 0 ); + t.deepEqual( viewY, expected, 'returns expected value' ); + + t.end(); +}); + tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the second input array unchanged', function test( t ) { var expected; var viewY; @@ -437,7 +460,7 @@ tape( 'the function supports a negative `zx` stride', function test( t ) { var zx; var zy; - zx = new Complex128Array( [ + zx = new Complex128Array([ 0.7, // 4 -0.8, // 4 -0.4, @@ -452,8 +475,8 @@ tape( 'the function supports a negative `zx` stride', function test( t ) { 0.4, -0.6, // 1 0.6 // 1 - ] ); - zy = new Complex128Array( [ + ]); + zy = new Complex128Array([ 0.6, // 1 -0.6, // 1 -0.9, // 2 @@ -468,13 +491,13 @@ tape( 'the function supports a negative `zx` stride', function test( t ) { -0.3, 0.8, -0.7 - ] ); + ]); za = new Complex128( 0.4, -0.7 ); zaxpy( 4, za, zx, -2, 6, zy, 1, 0 ); viewY = new Float64Array( zy.buffer ); - expected = new Float64Array( [ + expected = new Float64Array([ 0.78, // 1 0.06, // 1 -1.54, // 2 @@ -489,7 +512,7 @@ tape( 'the function supports a negative `zx` stride', function test( t ) { -0.3, 0.8, -0.7 - ] ); + ]); isApprox( t, viewY, expected, 14.0 ); t.end(); }); @@ -501,7 +524,7 @@ tape( 'the function supports a negative `zy` stride', function test( t ) { var zx; var zy; - zx = new Complex128Array( [ + zx = new Complex128Array([ 0.7, // 1 -0.8, // 1 -0.4, @@ -516,8 +539,8 @@ tape( 'the function supports a negative `zy` stride', function test( t ) { 0.4, -0.6, // 4 0.6 // 4 - ] ); - zy = new Complex128Array( [ + ]); + zy = new Complex128Array([ 0.6, // 4 -0.6, // 4 -0.9, @@ -532,13 +555,13 @@ tape( 'the function supports a negative `zy` stride', function test( t ) { -0.3, 0.8, // 1 -0.7 // 1 - ] ); + ]); za = new Complex128( 0.4, -0.7 ); zaxpy( 4, za, zx, 2, 0, zy, -2, 6 ); viewY = new Float64Array( zy.buffer ); - expected = new Float64Array( [ + expected = new Float64Array([ 0.78, // 4 0.06, // 4 -0.9, @@ -553,7 +576,7 @@ tape( 'the function supports a negative `zy` stride', function test( t ) { -0.3, 0.52, // 1 -1.51 // 1 - ] ); + ]); isApprox( t, viewY, expected, 14.0 ); t.end(); }); @@ -565,7 +588,7 @@ tape( 'the function supports complex access patterns', function test( t ) { var zx; var zy; - zx = new Complex128Array( [ + zx = new Complex128Array([ 0.7, // 4 -0.8, // 4 -0.4, // 3 @@ -580,8 +603,8 @@ tape( 'the function supports complex access patterns', function test( t ) { 0.4, -0.6, 0.6 - ] ); - zy = new Complex128Array( [ + ]); + zy = new Complex128Array([ 0.6, // 4 -0.6, // 4 -0.9, @@ -596,13 +619,13 @@ tape( 'the function supports complex access patterns', function test( t ) { -0.3, 0.8, // 1 -0.7 // 1 - ] ); + ]); za = new Complex128( 0.4, -0.7 ); zaxpy( 4, za, zx, -1, 3, zy, -2, 6 ); viewY = new Float64Array( zy.buffer ); - expected = new Float64Array( [ + expected = new Float64Array([ 0.32, // 4 -1.41, // 4 -0.9, @@ -617,7 +640,7 @@ tape( 'the function supports complex access patterns', function test( t ) { -0.3, 0.32, // 1 -1.16 // 1 - ] ); + ]); isApprox( t, viewY, expected, 14.0 ); t.end(); }); diff --git a/lib/node_modules/@stdlib/blas/base/zaxpy/test/test.zaxpy.js b/lib/node_modules/@stdlib/blas/base/zaxpy/test/test.zaxpy.js index 9152693cd2fc..272eeebd5a5c 100644 --- a/lib/node_modules/@stdlib/blas/base/zaxpy/test/test.zaxpy.js +++ b/lib/node_modules/@stdlib/blas/base/zaxpy/test/test.zaxpy.js @@ -78,7 +78,7 @@ tape( 'the function scales elements from `zx` by `za` and adds the result to `zy var zx; var zy; - zx = new Complex128Array( [ + zx = new Complex128Array([ 0.7, // 1 -0.8, // 1 -0.4, // 2 @@ -93,8 +93,8 @@ tape( 'the function scales elements from `zx` by `za` and adds the result to `zy 0.4, -0.6, 0.6 - ] ); - zy = new Complex128Array( [ + ]); + zy = new Complex128Array([ 0.6, // 1 -0.6, // 1 -0.9, // 2 @@ -109,13 +109,13 @@ tape( 'the function scales elements from `zx` by `za` and adds the result to `zy -0.3, 0.8, -0.7 - ] ); + ]); za = new Complex128( 0.4, -0.7 ); zaxpy( 4, za, zx, 1, zy, 1 ); viewY = new Float64Array( zy.buffer ); - expected = new Float64Array( [ + expected = new Float64Array([ 0.32, // 1 -1.41, // 1 -1.55, // 2 @@ -130,7 +130,7 @@ tape( 'the function scales elements from `zx` by `za` and adds the result to `zy -0.3, 0.8, -0.7 - ] ); + ]); isApprox( t, viewY, expected, 14.0 ); t.end(); }); @@ -142,7 +142,7 @@ tape( 'the function supports a `zx` stride', function test( t ) { var zx; var zy; - zx = new Complex128Array( [ + zx = new Complex128Array([ 0.7, // 1 -0.8, // 1 -0.4, @@ -157,8 +157,8 @@ tape( 'the function supports a `zx` stride', function test( t ) { 0.4, -0.6, // 4 0.6 // 4 - ] ); - zy = new Complex128Array( [ + ]); + zy = new Complex128Array([ 0.6, // 1 -0.6, // 1 -0.9, // 2 @@ -173,13 +173,13 @@ tape( 'the function supports a `zx` stride', function test( t ) { -0.3, 0.8, -0.7 - ] ); + ]); za = new Complex128( 0.4, -0.7 ); zaxpy( 4, za, zx, 2, zy, 1 ); viewY = new Float64Array( zy.buffer ); - expected = new Float64Array( [ + expected = new Float64Array([ 0.32, // 1 -1.41, // 1 -1.57, // 2 @@ -194,7 +194,7 @@ tape( 'the function supports a `zx` stride', function test( t ) { -0.3, 0.8, -0.7 - ] ); + ]); isApprox( t, viewY, expected, 14.0 ); t.end(); }); @@ -206,7 +206,7 @@ tape( 'the function supports a `zy` stride', function test( t ) { var zx; var zy; - zx = new Complex128Array( [ + zx = new Complex128Array([ 0.7, // 1 -0.8, // 1 -0.4, // 2 @@ -221,8 +221,8 @@ tape( 'the function supports a `zy` stride', function test( t ) { 0.4, -0.6, 0.6 - ] ); - zy = new Complex128Array( [ + ]); + zy = new Complex128Array([ 0.6, // 1 -0.6, // 1 -0.9, @@ -237,13 +237,13 @@ tape( 'the function supports a `zy` stride', function test( t ) { -0.3, 0.8, // 4 -0.7 // 4 - ] ); + ]); za = new Complex128( 0.4, -0.7 ); zaxpy( 4, za, zx, 1, zy, 2 ); viewY = new Float64Array( zy.buffer ); - expected = new Float64Array( [ + expected = new Float64Array([ 0.32, // 1 -1.41, // 1 -0.9, @@ -258,7 +258,7 @@ tape( 'the function supports a `zy` stride', function test( t ) { -0.3, 0.32, // 4 -1.16 // 4 - ] ); + ]); isApprox( t, viewY, expected, 14.0 ); t.end(); }); @@ -279,6 +279,29 @@ tape( 'the function returns a reference to the output array', function test( t ) t.end(); }); +tape( 'if provided `za` parameter equal to `0`, the function returns the second input array unchanged', function test( t ) { + var expected; + var viewY; + var za; + var zx; + var zy; + + zx = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); + zy = new Complex128Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); + za = new Complex128( 0.0, 0.0 ); + + viewY = new Float64Array( zy.buffer ); + expected = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] ); + + zaxpy( -1, za, zx, 1, 0, zy, 1, 0 ); + t.deepEqual( viewY, expected, 'returns expected value' ); + + zaxpy( 0, za, zx, 1, 0, zy, 1, 0 ); + t.deepEqual( viewY, expected, 'returns expected value' ); + + t.end(); +}); + tape( 'if provided an `N` parameter less than or equal to `0`, the function returns the second input array unchanged', function test( t ) { var expected; var viewY; @@ -309,7 +332,7 @@ tape( 'the function supports negative `zx` strides', function test( t ) { var zx; var zy; - zx = new Complex128Array( [ + zx = new Complex128Array([ 0.7, // 4 -0.8, // 4 -0.4, @@ -324,8 +347,8 @@ tape( 'the function supports negative `zx` strides', function test( t ) { 0.4, -0.6, // 1 0.6 // 1 - ] ); - zy = new Complex128Array( [ + ]); + zy = new Complex128Array([ 0.6, // 1 -0.6, // 1 -0.9, // 2 @@ -340,13 +363,13 @@ tape( 'the function supports negative `zx` strides', function test( t ) { -0.3, 0.8, -0.7 - ] ); + ]); za = new Complex128( 0.4, -0.7 ); zaxpy( 4, za, zx, -2, zy, 1 ); viewY = new Float64Array( zy.buffer ); - expected = new Float64Array( [ + expected = new Float64Array([ 0.78, // 1 0.06, // 1 -1.54, // 2 @@ -361,7 +384,7 @@ tape( 'the function supports negative `zx` strides', function test( t ) { -0.3, 0.8, -0.7 - ] ); + ]); isApprox( t, viewY, expected, 14.0 ); t.end(); }); @@ -373,7 +396,7 @@ tape( 'the function supports negative `zy` strides', function test( t ) { var zx; var zy; - zx = new Complex128Array( [ + zx = new Complex128Array([ 0.7, // 1 -0.8, // 1 -0.4, @@ -388,8 +411,8 @@ tape( 'the function supports negative `zy` strides', function test( t ) { 0.4, -0.6, // 4 0.6 // 4 - ] ); - zy = new Complex128Array( [ + ]); + zy = new Complex128Array([ 0.6, // 4 -0.6, // 4 -0.9, @@ -404,13 +427,13 @@ tape( 'the function supports negative `zy` strides', function test( t ) { -0.3, 0.8, // 1 -0.7 // 1 - ] ); + ]); za = new Complex128( 0.4, -0.7 ); zaxpy( 4, za, zx, 2, zy, -2 ); viewY = new Float64Array( zy.buffer ); - expected = new Float64Array( [ + expected = new Float64Array([ 0.78, // 4 0.06, // 4 -0.9, @@ -425,7 +448,7 @@ tape( 'the function supports negative `zy` strides', function test( t ) { -0.3, 0.52, // 1 -1.51 // 1 - ] ); + ]); isApprox( t, viewY, expected, 14.0 ); t.end(); }); @@ -437,7 +460,7 @@ tape( 'the function supports complex access patterns', function test( t ) { var zx; var zy; - zx = new Complex128Array( [ + zx = new Complex128Array([ 0.7, // 4 -0.8, // 4 -0.4, // 3 @@ -452,8 +475,8 @@ tape( 'the function supports complex access patterns', function test( t ) { 0.4, -0.6, 0.6 - ] ); - zy = new Complex128Array( [ + ]); + zy = new Complex128Array([ 0.6, // 4 -0.6, // 4 -0.9, @@ -468,13 +491,13 @@ tape( 'the function supports complex access patterns', function test( t ) { -0.3, 0.8, // 1 -0.7 // 1 - ] ); + ]); za = new Complex128( 0.4, -0.7 ); zaxpy( 4, za, zx, -1, zy, -2 ); viewY = new Float64Array( zy.buffer ); - expected = new Float64Array( [ + expected = new Float64Array([ 0.32, // 4 -1.41, // 4 -0.9, @@ -489,7 +512,7 @@ tape( 'the function supports complex access patterns', function test( t ) { -0.3, 0.32, // 1 -1.16 // 1 - ] ); + ]); isApprox( t, viewY, expected, 14.0 ); t.end(); }); From 5550a163af3d17af6ce75b23fbe9dc4eccd7f640 Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Sat, 5 Apr 2025 20:47:23 +0530 Subject: [PATCH 3/3] fix: remove unnecessary files --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/dsyr/README.md | 326 --------- .../blas/base/dsyr/benchmark/benchmark.js | 104 --- .../base/dsyr/benchmark/benchmark.native.js | 109 --- .../base/dsyr/benchmark/benchmark.ndarray.js | 104 --- .../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 -------- .../@stdlib/blas/base/dsyr/docs/repl.txt | 110 --- .../blas/base/dsyr/docs/types/index.d.ts | 116 ---- .../@stdlib/blas/base/dsyr/docs/types/test.ts | 342 ---------- .../blas/base/dsyr/examples/c/Makefile | 146 ---- .../blas/base/dsyr/examples/c/example.c | 46 -- .../@stdlib/blas/base/dsyr/examples/index.js | 35 - .../@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/base.js | 115 ---- .../@stdlib/blas/base/dsyr/lib/dsyr.js | 97 --- .../@stdlib/blas/base/dsyr/lib/dsyr.native.js | 60 -- .../@stdlib/blas/base/dsyr/lib/index.js | 70 -- .../@stdlib/blas/base/dsyr/lib/main.js | 35 - .../@stdlib/blas/base/dsyr/lib/native.js | 35 - .../@stdlib/blas/base/dsyr/lib/ndarray.js | 76 --- .../blas/base/dsyr/lib/ndarray.native.js | 61 -- .../@stdlib/blas/base/dsyr/manifest.json | 319 --------- .../@stdlib/blas/base/dsyr/package.json | 71 -- .../@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 -- .../column_major_complex_access_pattern.json | 13 - .../dsyr/test/fixtures/column_major_l.json | 15 - .../dsyr/test/fixtures/column_major_oa.json | 13 - .../test/fixtures/column_major_sa1_sa2.json | 13 - .../test/fixtures/column_major_sa1_sa2n.json | 13 - .../test/fixtures/column_major_sa1n_sa2.json | 13 - .../test/fixtures/column_major_sa1n_sa2n.json | 13 - .../dsyr/test/fixtures/column_major_u.json | 15 - .../dsyr/test/fixtures/column_major_xn.json | 15 - .../dsyr/test/fixtures/column_major_xp.json | 15 - .../row_major_complex_access_pattern.json | 13 - .../base/dsyr/test/fixtures/row_major_l.json | 15 - .../base/dsyr/test/fixtures/row_major_oa.json | 13 - .../dsyr/test/fixtures/row_major_sa1_sa2.json | 13 - .../test/fixtures/row_major_sa1_sa2n.json | 13 - .../test/fixtures/row_major_sa1n_sa2.json | 13 - .../test/fixtures/row_major_sa1n_sa2n.json | 13 - .../base/dsyr/test/fixtures/row_major_u.json | 15 - .../base/dsyr/test/fixtures/row_major_xn.json | 15 - .../base/dsyr/test/fixtures/row_major_xp.json | 15 - .../@stdlib/blas/base/dsyr/test/test.dsyr.js | 417 ------------ .../blas/base/dsyr/test/test.dsyr.native.js | 300 --------- .../@stdlib/blas/base/dsyr/test/test.js | 82 --- .../blas/base/dsyr/test/test.ndarray.js | 627 ------------------ .../base/dsyr/test/test.ndarray.native.js | 563 ---------------- 56 files changed, 5826 deletions(-) delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/README.md delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.js delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.native.js delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.ndarray.js delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.ndarray.native.js delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/Makefile delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/binding.gyp delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/docs/repl.txt delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/docs/types/index.d.ts delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/docs/types/test.ts delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/examples/c/Makefile delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/examples/index.js delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/include.gypi delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr.h delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/include/stdlib/blas/base/dsyr_cblas.h delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/lib/base.js delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.js delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.native.js delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/lib/index.js delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/lib/main.js delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/lib/native.js delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/manifest.json delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/package.json delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/src/Makefile delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_complex_access_pattern.json delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_l.json delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_oa.json delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1_sa2.json delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1_sa2n.json delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1n_sa2.json delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1n_sa2n.json delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_u.json delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_xn.json delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_xp.json delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_complex_access_pattern.json delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_l.json delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_oa.json delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1_sa2.json delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1_sa2n.json delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1n_sa2.json delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1n_sa2n.json delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_u.json delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_xn.json delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_xp.json delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.js delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.native.js delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/test.js delete mode 100755 lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.js delete mode 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 deleted file mode 100755 index cbc4f682ef0e..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/README.md +++ /dev/null @@ -1,326 +0,0 @@ - - -# dsyr - -> Perform the symmetric rank 1 operation `A = α*x*x^T + A`. - -
- -## Usage - -```javascript -var dsyr = require( '@stdlib/blas/base/dsyr' ); -``` - -#### dsyr( order, uplo, N, α, 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. - -```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 ] ); - -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 ] -``` - -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. -- **N**: number of elements along each dimension of `A`. -- **α**: scalar constant. -- **x**: input [`Float64Array`][mdn-float64array]. -- **sx**: index increment 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`). - -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, - -```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 ] ); - -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 ] -``` - -Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. - - - -```javascript -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 ] ); - -// 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 ] -``` - -#### dsyr.ndarray( uplo, N, α, 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. - -```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 ] ); - -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 ] -``` - -The function has the following additional parameters: - -- **ox**: starting index for `x`. -- **sa1**: stride of the first dimension of `A`. -- **sa2**: stride of the second dimension of `A`. -- **oa**: starting index for `A`. - -While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, - -```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 ] ); - -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 ] -``` - -
- - - -
- -## Notes - -- `dsyr()` corresponds to the [BLAS][blas] level 2 function [`dsyr`][blas-dsyr]. - -
- - - -
- -## Examples - - - -```javascript -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var ones = require( '@stdlib/array/ones' ); -var dsyr = require( '@stdlib/blas/base/dsyr' ); - -var opts = { - 'dtype': 'float64' -}; - -var N = 3; - -var A = 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 ); -``` - -
- - - - - -* * * - -
- -## C APIs - - - -
- -
- - - - - -
- -### Usage - -```c -#include "stdlib/blas/base/dsyr.h" -``` - -#### c_dsyr( order, uplo, N, alpha, \*X, strideX, \*A, LDA ) - -Performs the symmetric rank 1 operation `A = α*x*x^T + A`. - -```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 }; -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 ) -``` - -#### 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 -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 ) -``` - -
- - - - - -
- -
- - - - - -
- -### Examples - -```c -#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.js b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.js deleted file mode 100755 index d8b526ca4682..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.js +++ /dev/null @@ -1,104 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var 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 pkg = require( './../package.json' ).name; -var dsyr = require( './../lib/dsyr.js' ); - - -// VARIABLES // - -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+':size='+(N*N), f ); - } -} - -main(); 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 deleted file mode 100755 index ec7bf95c8b72..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.native.js +++ /dev/null @@ -1,109 +0,0 @@ -/** -* @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.js b/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.ndarray.js deleted file mode 100755 index 7d1a7e3c9ad1..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.ndarray.js +++ /dev/null @@ -1,104 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var 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 pkg = require( './../package.json' ).name; -var dsyr = require( './../lib/ndarray.js' ); - - -// VARIABLES // - -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+':ndarray:size='+(N*N), 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 deleted file mode 100755 index d9c133e73870..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.ndarray.native.js +++ /dev/null @@ -1,109 +0,0 @@ -/** -* @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 deleted file mode 100755 index a4bd7b38fd74..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @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 deleted file mode 100755 index 80bdea3c21f0..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/benchmark/c/benchmark.c +++ /dev/null @@ -1,179 +0,0 @@ -/** -* @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 deleted file mode 100755 index 08de71a2020e..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/binding.gyp +++ /dev/null @@ -1,265 +0,0 @@ -# @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/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/dsyr/docs/repl.txt deleted file mode 100755 index b417cd9e60c5..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/docs/repl.txt +++ /dev/null @@ -1,110 +0,0 @@ - -{{alias}}( order, uplo, N, α, 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. - - Indexing is relative to the first index. To introduce an offset, use typed - array views. - - If `N` is equal to `0` or `α` is equal to `0`, the function returns `A` - unchanged. - - Parameters - ---------- - order: string - Row-major (C-style) or column-major (Fortran-style) order. Must be - either 'row-major' or 'column-major'. - - uplo: string - Specifies whether to reference the upper or lower triangular part of - `A`. Must be either 'upper' or 'lower'. - - N: integer - Number of elements along each dimension of `A`. - - α: number - Scalar constant. - - x: Float64Array - Input vector. - - sx: integer - Index increment for `x`. - - A: Float64Array - Input matrix. - - lda: integer - Stride of the first dimension of `A` (a.k.a., leading dimension of the - matrix `A`). - - Returns - ------- - A: Float64Array - Input matrix. - - 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 ] ); - > {{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 - indexing semantics and where `α` is a scalar, `x` is an `N` element vector, - and `A` is an `N` by `N` symmetric matrix. - - While typed array views mandate a view offset based on the underlying - buffer, the offset parameters support indexing semantics based on starting - indices. - - Parameters - ---------- - uplo: string - Specifies whether to reference the upper or lower triangular part of - `A`. Must be either 'upper' or 'lower'. - - N: integer - Number of elements along each dimension of `A`. - - α: number - Scalar constant. - - x: Float64Array - Input vector. - - sx: integer - Index increment for `x`. - - ox: integer - Starting index for `x`. - - A: Float64Array - Input matrix. - - sa1: integer - Stride of the first dimension of `A`. - - sa2: integer - Stride of the second dimension of `A`. - - oa: integer - Starting index for `A`. - - Returns - ------- - A: Float64Array - Input matrix. - - 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 ] ); - > {{alias}}.ndarray( 'upper', 2, 1.0, x, 1, 0, A, 2, 1, 0 ) - [ 2.0, 3.0, 0.0, 3.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 deleted file mode 100755 index 945ee06c50e2..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/docs/types/index.d.ts +++ /dev/null @@ -1,116 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Layout, MatrixTriangle } from '@stdlib/types/blas'; - -/** -* Interface describing `dsyr`. -*/ -interface Routine { - /** - * 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 N - number of elements along each dimension in the matrix `A` - * @param alpha - scalar constant - * @param x - input vector - * @param strideX - `x` stride length - * @param A - matrix - * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) - * @returns `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( '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 ] - */ - ( order: Layout, uplo: MatrixTriangle, N: number, alpha: number, x: Float64Array, strideX: number, A: Float64Array, LDA: number ): Float64Array; - - /** - * Performs the matrix-vector operation `y = alpha*A*x + beta*y` using alternative indexing semantics and where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, 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 N - number of elements along each dimension in the matrix `A` - * @param alpha - scalar constant - * @param x - input vector - * @param strideX - `x` stride length - * @param offsetX - starting index for `x` - * @param A - 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` - * @returns `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.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 ] - */ - ndarray( uplo: MatrixTriangle, N: number, alpha: number, x: Float64Array, strideX: number, offsetX: number, A: Float64Array, strideA1: number, strideA2: number, offsetA: number ): Float64Array; -} - -/** -* 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 N - number of elements along each dimension in the matrix `A` -* @param alpha - scalar constant -* @param x - input vector -* @param strideX - `x` stride length -* @param A - matrix -* @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) -* @returns `A` -* -* @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 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 ] -* -* @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 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 ] -*/ -declare var dsyr: Routine; - - -// EXPORTS // - -export = dsyr; 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 deleted file mode 100755 index 0b0284106774..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/docs/types/test.ts +++ /dev/null @@ -1,342 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import dsyr = require( './index' ); - - -// TESTS // - -// The function returns a Float64Array... -{ - const x = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsyr( 'row-major', 'upper', 10, 1.0, x, 1, A, 10 ); // $ExpectType Float64Array -} - -// The compiler throws an error if the function is provided a first argument which is not a string... -{ - const x = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsyr( 10, 'upper', 10, 1.0, x, 1, A, 10 ); // $ExpectError - dsyr( true, 'upper', 10, 1.0, x, 1, A, 10 ); // $ExpectError - dsyr( false, 'upper', 10, 1.0, x, 1, A, 10 ); // $ExpectError - dsyr( null, 'upper', 10, 1.0, x, 1, A, 10 ); // $ExpectError - dsyr( undefined, 'upper', 10, 1.0, x, 1, A, 10 ); // $ExpectError - dsyr( [], 'upper', 10, 1.0, x, 1, A, 10 ); // $ExpectError - dsyr( {}, 'upper', 10, 1.0, x, 1, A, 10 ); // $ExpectError - dsyr( ( x: number ): number => x, 'upper', 10, 1.0, x, 1, A, 10 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument which is not a string... -{ - const x = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsyr( 'row-major', 10, 10, 1.0, x, 1, A, 10 ); // $ExpectError - dsyr( 'row-major', true, 10, 1.0, x, 1, A, 10 ); // $ExpectError - dsyr( 'row-major', false, 10, 1.0, x, 1, A, 10 ); // $ExpectError - dsyr( 'row-major', null, 10, 1.0, x, 1, A, 10 ); // $ExpectError - dsyr( 'row-major', undefined, 10, 1.0, x, 1, A, 10 ); // $ExpectError - dsyr( 'row-major', [ '1' ], 10, 1.0, x, 1, A, 10 ); // $ExpectError - dsyr( 'row-major', {}, 10, 1.0, x, 1, A, 10 ); // $ExpectError - dsyr( 'row-major', ( x: number ): number => x, 10, 1.0, x, 1, A, 10 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a third argument which is not a number... -{ - const x = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsyr( 'row-major', 'upper', '10', 1.0, x, 1, A, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', true, 1.0, x, 1, A, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', false, 1.0, x, 1, A, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', null, 1.0, x, 1, A, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', undefined, 1.0, x, 1, A, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', [], 1.0, x, 1, A, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', {}, 1.0, x, 1, A, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', ( x: number ): number => x, 1.0, x, 1, A, 10 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a fourth argument which is not a number... -{ - const x = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsyr( 'row-major', 'upper', 10, '10', x, 1, A, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, true, x, 1, A, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, false, x, 1, A, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, null, x, 1, A, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, undefined, x, 1, A, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, [], x, 1, A, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, {}, x, 1, A, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, ( x: number ): number => x, x, 1, A, 10 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a fifth argument which is not a Float64Array... -{ - const A = new Float64Array( 20 ); - - dsyr( 'row-major', 'upper', 10, 1.0, 10, 1, A, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, '10', 1, A, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, true, 1, A, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, false, 1, A, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, null, 1, A, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, undefined, 1, A, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, [ '1' ], 1, A, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, {}, 1, A, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, ( x: number ): number => x, 1, A, 10 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a sixth argument which is not a number... -{ - const x = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsyr( 'row-major', 'upper', 10, 1.0, x, '10', A, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, x, true, A, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, x, false, A, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, x, null, A, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, x, undefined, A, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, x, [], A, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, x, {}, A, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, x, ( x: number ): number => x, A, 10 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a seventh argument which is not a Float64Array... -{ - const x = new Float64Array( 10 ); - - dsyr( 'row-major', 'upper', 10, 1.0, x, 1, 10, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, x, 1, '10', 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, x, 1, true, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, x, 1, false, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, x, 1, null, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, x, 1, undefined, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, x, 1, [ '1' ], 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, x, 1, {}, 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, x, 1, ( x: number ): number => x, 10 ); // $ExpectError -} - -// The compiler throws an error if the function is provided an eighth argument which is not a number... -{ - const x = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsyr( 'row-major', 'upper', 10, 1.0, x, 1, A, '10' ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, x, 1, A, true ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, x, 1, A, false ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, x, 1, A, null ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, x, 1, A, undefined ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, x, 1, A, [] ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, x, 1, A, {} ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, x, 1, A, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const x = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsyr(); // $ExpectError - dsyr( 'row-major' ); // $ExpectError - dsyr( 'row-major', 'upper' ); // $ExpectError - dsyr( 'row-major', 'upper', 10 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, x ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, x, 1 ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, x, 1, A ); // $ExpectError - dsyr( 'row-major', 'upper', 10, 1.0, x, 1, A, 10, 1 ); // $ExpectError -} - -// Attached to main export is an `ndarray` method which returns a Float64Array... -{ - const x = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, A, 10, 1, 0 ); // $ExpectType Float64Array -} - -// The compiler throws an error if the function is provided a first argument which is not a string... -{ - const x = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsyr.ndarray( 10, 10, 1.0, x, 1, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( true, 10, 1.0, x, 1, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( false, 10, 1.0, x, 1, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( null, 10, 1.0, x, 1, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( undefined, 10, 1.0, x, 1, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( [ '1' ], 10, 1.0, x, 1, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( {}, 10, 1.0, x, 1, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( ( x: number ): number => x, 10, 1.0, x, 1, 0, A, 10, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument which is not a number... -{ - const x = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsyr.ndarray( 'upper', '10', 1.0, x, 1, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', true, 1.0, x, 1, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', false, 1.0, x, 1, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', null, 1.0, x, 1, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', undefined, 1.0, x, 1, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', [], 1.0, x, 1, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', {}, 1.0, x, 1, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', ( x: number ): number => x, 1.0, x, 1, 0, A, 10, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a third argument which is not a number... -{ - const x = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsyr.ndarray( 'upper', 10, '10', x, 1, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, true, x, 1, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, false, x, 1, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, null, x, 1, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, undefined, x, 1, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, [], x, 1, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, {}, x, 1, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, ( x: number ): number => x, x, 1, 0, A, 10, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a fourth argument which is not a Float64Array... -{ - const A = new Float64Array( 20 ); - - dsyr.ndarray( 'upper', 10, 1.0, 10, 1, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, '10', 1, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, true, 1, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, false, 1, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, null, 1, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, undefined, 1, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, [ '1' ], 1, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, {}, 1, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, ( x: number ): number => x, 1, 0, A, 10, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a fifth argument which is not a number... -{ - const x = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsyr.ndarray( 'upper', 10, 1.0, x, '10', 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, true, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, false, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, null, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, undefined, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, [], 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, {}, 0, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, ( x: number ): number => x, 0, A, 10, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a sixth argument which is not a number... -{ - const x = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsyr.ndarray( 'upper', 10, 1.0, x, 1, '10', A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, true, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, false, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, null, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, undefined, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, [], A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, {}, A, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, ( x: number ): number => x, A, 10, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a seventh argument which is not a Float64Array... -{ - const x = new Float64Array( 10 ); - - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, 10, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, '10', 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, true, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, false, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, null, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, undefined, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, [ '1' ], 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, {}, 10, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, ( x: number ): number => x, 10, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the function is provided an eighth argument which is not a number... -{ - const x = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, A, '10', 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, A, true, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, A, false, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, A, null, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, A, undefined, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, A, [], 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, A, {}, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, A, ( x: number ): number => x, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a ninth argument which is not a number... -{ - const x = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, A, 10, '10', 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, A, 10, true, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, A, 10, false, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, A, 10, null, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, A, 10, undefined, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, A, 10, [], 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, A, 10, {}, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, A, 10, ( x: number ): number => x, 0 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a tenth argument which is not a number... -{ - const x = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, A, 10, 1, '10' ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, A, 10, 1, true ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, A, 10, 1, false ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, A, 10, 1, null ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, A, 10, 1, undefined ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, A, 10, 1, [] ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, A, 10, 1, {} ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, A, 10, 1, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments... -{ - const x = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsyr.ndarray(); // $ExpectError - dsyr.ndarray( 'upper' ); // $ExpectError - dsyr.ndarray( 'upper', 10 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, A ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, A, 10 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, A, 10, 1 ); // $ExpectError - dsyr.ndarray( 'upper', 10, 1.0, x, 1, 0, A, 10, 1, 0, 10 ); // $ExpectError -} diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/Makefile b/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/Makefile deleted file mode 100755 index 25ced822f96a..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#/ -# @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 deleted file mode 100755 index 7205643b0a60..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/examples/c/example.c +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @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/examples/index.js b/lib/node_modules/@stdlib/blas/base/dsyr/examples/index.js deleted file mode 100755 index 198ebb4ad194..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/examples/index.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); -var ones = require( '@stdlib/array/ones' ); -var dsyr = require( './../lib' ); - -var opts = { - 'dtype': 'float64' -}; - -var N = 3; - -var A = 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 ); diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/include.gypi b/lib/node_modules/@stdlib/blas/base/dsyr/include.gypi deleted file mode 100755 index 4217944b5d20..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/include.gypi +++ /dev/null @@ -1,70 +0,0 @@ -# @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( '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 - var isrm; - var tmp; - var ix0; - var ix1; - var sa0; - var sa1; - var i0; - var i1; - var oa; - var ox; - - isrm = isRowMajor( [ strideA1, strideA2 ] ); - 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 === 'upper' ) || - ( isrm && uplo === 'lower' ) - ) { - 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 A; - } - // ( isrm && uplo === 'upper' ) || ( !isrm && uplo === 'lower' ) - 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 A; -} - - -// EXPORTS // - -module.exports = dsyr; diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.js deleted file mode 100755 index 2f6f395661aa..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.js +++ /dev/null @@ -1,97 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 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 max = require( '@stdlib/math/base/special/fast/max' ); -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 format = require( '@stdlib/string/format' ); -var base = require( './base.js' ); - - -// MAIN // - -/** -* 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 {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 {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 greater than or equal to max(1,N) -* @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( '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 ) { - var sa1; - var sa2; - var ox; - - 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 ) ); - } - if ( N === 0 || alpha === 0.0 ) { - return A; - } - if ( order === 'column-major' ) { - sa1 = 1; - sa2 = LDA; - } else { // order === 'row-major' - sa1 = LDA; - sa2 = 1; - } - ox = stride2offset( N, strideX ); - return base( uplo, N, alpha, x, strideX, ox, A, sa1, sa2, 0 ); -} - - -// EXPORTS // - -module.exports = dsyr; 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 deleted file mode 100755 index 47d2292e7306..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.native.js +++ /dev/null @@ -1,60 +0,0 @@ -/** -* @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 resolveOrder = require( '@stdlib/blas/base/layout-resolve-enum' ); -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} 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 {Float64Array} x - input vector -* @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`) -* @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( '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/index.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/index.js deleted file mode 100755 index 3275f78309cb..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/lib/index.js +++ /dev/null @@ -1,70 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 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'; - -/** -* BLAS level 2 routine to perform 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. -* -* @module @stdlib/blas/base/dsyr -* -* @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 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 ] -* -* @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 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 ] -*/ - -// MODULES // - -var join = require( 'path' ).join; -var tryRequire = require( '@stdlib/utils/try-require' ); -var isError = require( '@stdlib/assert/is-error' ); -var main = require( './main.js' ); - - -// MAIN // - -var dsyr; -var tmp = tryRequire( join( __dirname, './native.js' ) ); -if ( isError( tmp ) ) { - dsyr = main; -} else { - dsyr = tmp; -} - - -// EXPORTS // - -module.exports = dsyr; - -// exports: { "ndarray": "dsyr.ndarray" } diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/main.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/main.js deleted file mode 100755 index 2e9caa4691c0..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/lib/main.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 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.js' ); -var ndarray = require( './ndarray.js' ); - - -// MAIN // - -setReadOnly( dsyr, 'ndarray', ndarray ); - - -// 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 deleted file mode 100755 index 4c4d0bb3579d..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/lib/native.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @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.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js deleted file mode 100755 index 490056e2b0e9..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js +++ /dev/null @@ -1,76 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 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 isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); -var format = require( '@stdlib/string/format' ); -var base = require( './base.js' ); - - -// MAIN // - -/** -* 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 {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` -* @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 -* 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 - 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 ) ); - } - if ( N === 0 || alpha === 0.0 ) { - return A; - } - return base( uplo, N, alpha, x, strideX, offsetX, A, strideA1, strideA2, offsetA ); // eslint-disable-line max-len -} - - -// 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 deleted file mode 100755 index 72bd9717561e..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.native.js +++ /dev/null @@ -1,61 +0,0 @@ -/** -* @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 deleted file mode 100755 index 05fa40f5a71c..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/manifest.json +++ /dev/null @@ -1,319 +0,0 @@ -{ - "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 deleted file mode 100755 index ab37bcb25b13..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "@stdlib/blas/base/dsyr", - "version": "0.0.0", - "description": "Perform the symmetric rank 1 operation `A = α*x*x^T + A`.", - "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "gypfile": true, - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "include": "./include", - "lib": "./lib", - "src": "./src", - "test": "./test" - }, - "types": "./docs/types", - "scripts": {}, - "homepage": "https://github.com/stdlib-js/stdlib", - "repository": { - "type": "git", - "url": "git://github.com/stdlib-js/stdlib.git" - }, - "bugs": { - "url": "https://github.com/stdlib-js/stdlib/issues" - }, - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "keywords": [ - "stdlib", - "stdmath", - "mathematics", - "math", - "blas", - "level 2", - "dsyr", - "linear", - "algebra", - "subroutines", - "array", - "ndarray", - "float64", - "double", - "float64array" - ] -} diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/src/Makefile b/lib/node_modules/@stdlib/blas/base/dsyr/src/Makefile deleted file mode 100755 index 7733b6180cb4..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -#/ -# @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 deleted file mode 100755 index fe6089114973..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/addon.c +++ /dev/null @@ -1,86 +0,0 @@ -/** -* @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 deleted file mode 100755 index c1ce804e3f1d..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr.c +++ /dev/null @@ -1,131 +0,0 @@ -/** -* @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 deleted file mode 100755 index 83e431fb07a9..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_cblas.c +++ /dev/null @@ -1,37 +0,0 @@ -/** -* @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/fixtures/column_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_complex_access_pattern.json deleted file mode 100755 index 981b891e4c3a..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_complex_access_pattern.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "uplo": "upper", - "N": 3, - "alpha": 1.0, - "x": [ 1.0, 2.0, 3.0 ], - "strideX": -1, - "offsetX": 2, - "A": [ 999.0, 999.0, 999.0, 999.0, 999.0, 1.0, 999.0, 2.0, 999.0, 3.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 999.0, 1.0, 999.0, 2.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 999.0, 0.0, 999.0, 1.0 ], - "strideA1": -2, - "strideA2": -10, - "offsetA": 29, - "A_out": [ 999.0, 999.0, 999.0, 999.0, 999.0, 2.0, 999.0, 4.0, 999.0, 6.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 999.0, 5.0, 999.0, 8.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 999.0, 0.0, 999.0, 10.0 ] -} 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 deleted file mode 100755 index 389657f34aeb..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_l.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "order": "column-major", - "uplo": "lower", - "N": 3, - "alpha": 2.0, - "x": [ 1.0, 2.0, 3.0 ], - "strideX": 1, - "offsetX": 0, - "A": [ 1.0, 1.0, 1.0, 0.0, 2.0, 2.0, 0.0, 0.0, 3.0 ], - "lda": 3, - "strideA1": 1, - "strideA2": 3, - "offsetA": 0, - "A_out": [ 3.0, 5.0, 7.0, 0.0, 10.0, 14.0, 0.0, 0.0, 21.0 ] -} 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 deleted file mode 100755 index 3ba11130094e..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_oa.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "uplo": "lower", - "N": 3, - "alpha": 2.0, - "x": [ 1.0, 2.0, 3.0 ], - "strideX": 1, - "offsetX": 0, - "A": [ 999.0, 1.0, 1.0, 1.0, 999.0, 999.0, 0.0, 2.0, 2.0, 999.0, 999.0, 0.0, 0.0, 3.0, 999.0 ], - "strideA1": 1, - "strideA2": 5, - "offsetA": 1, - "A_out": [ 999.0, 3.0, 5.0, 7.0, 999.0, 999.0, 0.0, 10.0, 14.0, 999.0, 999.0, 0.0, 0.0, 21.0, 999.0 ] -} 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 deleted file mode 100755 index c5ab8a57e72e..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1_sa2.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "uplo": "upper", - "N": 3, - "alpha": 1.0, - "x": [ 1.0, 2.0, 3.0 ], - "strideX": 1, - "offsetX": 0, - "A": [ 999.0, 999.0, 999.0, 999.0, 999.0, 1.0, 999.0, 0.0, 999.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 2.0, 999.0, 1.0, 999.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 3.0, 999.0, 2.0, 999.0, 1.0 ], - "strideA1": 2, - "strideA2": 10, - "offsetA": 5, - "A_out": [ 999.0, 999.0, 999.0, 999.0, 999.0, 2.0, 999.0, 0.0, 999.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 4.0, 999.0, 5.0, 999.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 6.0, 999.0, 8.0, 999.0, 10.0 ] -} 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 deleted file mode 100755 index 9f5de6272408..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1_sa2n.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "uplo": "upper", - "N": 3, - "alpha": 1.0, - "x": [ 1.0, 2.0, 3.0 ], - "strideX": 1, - "offsetX": 0, - "A": [ 999.0, 999.0, 999.0, 999.0, 999.0, 3.0, 999.0, 2.0, 999.0, 1.0, 999.0, 999.0, 999.0, 999.0, 999.0, 2.0, 999.0, 1.0, 999.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 1.0, 999.0, 0.0, 999.0, 0.0 ], - "strideA1": 2, - "strideA2": -10, - "offsetA": 25, - "A_out": [ 999.0, 999.0, 999.0, 999.0, 999.0, 6.0, 999.0, 8.0, 999.0, 10.0, 999.0, 999.0, 999.0, 999.0, 999.0, 4.0, 999.0, 5.0, 999.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 2.0, 999.0, 0.0, 999.0, 0.0 ] -} 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 deleted file mode 100755 index ed222434544b..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1n_sa2.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "uplo": "upper", - "N": 3, - "alpha": 1.0, - "x": [ 1.0, 2.0, 3.0 ], - "strideX": 1, - "offsetX": 0, - "A": [ 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 999.0, 0.0, 999.0, 1.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 999.0, 1.0, 999.0, 2.0, 999.0, 999.0, 999.0, 999.0, 999.0, 1.0, 999.0, 2.0, 999.0, 3.0 ], - "strideA1": -2, - "strideA2": 10, - "offsetA": 9, - "A_out": [ 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 999.0, 0.0, 999.0, 2.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 999.0, 5.0, 999.0, 4.0, 999.0, 999.0, 999.0, 999.0, 999.0, 10.0, 999.0, 8.0, 999.0, 6.0 ] -} 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 deleted file mode 100755 index 651cfb6ad850..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_sa1n_sa2n.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "uplo": "upper", - "N": 3, - "alpha": 1.0, - "x": [ 1.0, 2.0, 3.0 ], - "strideX": 1, - "offsetX": 0, - "A": [ 999.0, 999.0, 999.0, 999.0, 999.0, 1.0, 999.0, 2.0, 999.0, 3.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 999.0, 1.0, 999.0, 2.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 999.0, 0.0, 999.0, 1.0 ], - "strideA1": -2, - "strideA2": -10, - "offsetA": 29, - "A_out": [ 999.0, 999.0, 999.0, 999.0, 999.0, 10.0, 999.0, 8.0, 999.0, 6.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 999.0, 5.0, 999.0, 4.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 999.0, 0.0, 999.0, 2.0 ] -} 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 deleted file mode 100755 index 58f2411c7bea..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_u.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "order": "column-major", - "uplo": "upper", - "N": 3, - "alpha": 1.0, - "x": [ 1.0, 2.0, 3.0 ], - "strideX": 1, - "offsetX": 0, - "A": [ 1.0, 0.0, 0.0, 2.0, 1.0, 0.0, 3.0, 2.0, 1.0 ], - "lda": 3, - "strideA1": 1, - "strideA2": 3, - "offsetA": 0, - "A_out": [ 2.0, 0.0, 0.0, 4.0, 5.0, 0.0, 6.0, 8.0, 10.0 ] -} 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 deleted file mode 100755 index 7f2bcd4c3de5..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_xn.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "order": "column-major", - "uplo": "upper", - "N": 3, - "alpha": 1.0, - "x": [ 1.0, 2.0, 3.0, 4.0, 5.0 ], - "strideX": -2, - "offsetX": 4, - "A": [ 1.0, 0.0, 0.0, 2.0, 1.0, 0.0, 3.0, 2.0, 1.0 ], - "lda": 3, - "strideA1": 1, - "strideA2": 3, - "offsetA": 0, - "A_out": [ 26.0, 0.0, 0.0, 17.0, 10.0, 0.0, 8.0, 5.0, 2.0 ] -} 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 deleted file mode 100755 index 92c088792560..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/column_major_xp.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "order": "column-major", - "uplo": "upper", - "N": 3, - "alpha": 1.0, - "x": [ 1.0, 2.0, 3.0, 4.0, 5.0 ], - "strideX": 2, - "offsetX": 0, - "A": [ 1.0, 0.0, 0.0, 2.0, 1.0, 0.0, 3.0, 2.0, 1.0 ], - "lda": 3, - "strideA1": 1, - "strideA2": 3, - "offsetA": 0, - "A_out": [ 2.0, 0.0, 0.0, 5.0, 10.0, 0.0, 8.0, 17.0, 26.0 ] -} 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 deleted file mode 100755 index 68d3224c6845..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_complex_access_pattern.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "uplo": "upper", - "N": 3, - "alpha": 1.0, - "x": [ 1.0, 2.0, 3.0 ], - "strideX": -1, - "offsetX": 2, - "A": [ 999.0, 1.0, 999.0, 0.0, 999.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 2.0, 999.0, 1.0, 999.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 3.0, 999.0, 2.0, 999.0, 1.0, 999.0 ], - "strideA1": -14, - "strideA2": -2, - "offsetA": 33, - "A_out": [ 999.0, 2.0, 999.0, 0.0, 999.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 4.0, 999.0, 5.0, 999.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 6.0, 999.0, 8.0, 999.0, 10.0, 999.0 ] -} 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 deleted file mode 100755 index 97b9c6b12266..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_l.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "order": "row-major", - "uplo": "lower", - "N": 3, - "alpha": 2.0, - "x": [ 1.0, 2.0, 3.0 ], - "strideX": 1, - "offsetX": 0, - "A": [ 1.0, 0.0, 0.0, 1.0, 2.0, 0.0, 1.0, 2.0, 3.0 ], - "lda": 3, - "strideA1": 3, - "strideA2": 1, - "offsetA": 0, - "A_out": [ 3.0, 0.0, 0.0, 5.0, 10.0, 0.0, 7.0, 14.0, 21.0 ] -} 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 deleted file mode 100755 index 6f31e049fb31..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_oa.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "uplo": "lower", - "N": 3, - "alpha": 2.0, - "x": [ 1.0, 2.0, 3.0 ], - "strideX": 1, - "offsetX": 0, - "A": [ 999.0, 999.0, 999.0, 1.0, 0.0, 0.0, 1.0, 2.0, 0.0, 1.0, 2.0, 3.0, 999.0, 999.0, 999.0 ], - "strideA1": 3, - "strideA2": 1, - "offsetA": 3, - "A_out": [ 999.0, 999.0, 999.0, 3.0, 0.0, 0.0, 5.0, 10.0, 0.0, 7.0, 14.0, 21.0, 999.0, 999.0, 999.0 ] -} 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 deleted file mode 100755 index 02b637c5d589..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1_sa2.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "uplo": "upper", - "N": 3, - "alpha": 1.0, - "x": [ 1.0, 2.0, 3.0 ], - "strideX": 1, - "offsetX": 0, - "A": [ 999.0, 1.0, 999.0, 2.0, 999.0, 3.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 999.0, 1.0, 999.0, 2.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 999.0, 0.0, 999.0, 1.0, 999.0 ], - "strideA1": 14, - "strideA2": 2, - "offsetA": 1, - "A_out": [ 999.0, 2.0, 999.0, 4.0, 999.0, 6.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 999.0, 5.0, 999.0, 8.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 999.0, 0.0, 999.0, 10.0, 999.0 ] -} 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 deleted file mode 100755 index 4c53cadd7f06..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1_sa2n.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "uplo": "upper", - "N": 3, - "alpha": 1.0, - "x": [ 1.0, 2.0, 3.0 ], - "strideX": 1, - "offsetX": 0, - "A": [ 999.0, 3.0, 999.0, 2.0, 999.0, 1.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 2.0, 999.0, 1.0, 999.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 1.0, 999.0, 0.0, 999.0, 0.0, 999.0 ], - "strideA1": 14, - "strideA2": -2, - "offsetA": 5, - "A_out": [ 999.0, 6.0, 999.0, 4.0, 999.0, 2.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 8.0, 999.0, 5.0, 999.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 10.0, 999.0, 0.0, 999.0, 0.0, 999.0 ] -} 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 deleted file mode 100755 index c942623c9821..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1n_sa2.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "uplo": "upper", - "N": 3, - "alpha": 1.0, - "x": [ 1.0, 2.0, 3.0 ], - "strideX": 1, - "offsetX": 0, - "A": [ 999.0, 0.0, 999.0, 0.0, 999.0, 1.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 999.0, 1.0, 999.0, 2.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 1.0, 999.0, 2.0, 999.0, 3.0, 999.0 ], - "strideA1": -14, - "strideA2": 2, - "offsetA": 29, - "A_out": [ 999.0, 0.0, 999.0, 0.0, 999.0, 10.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 0.0, 999.0, 5.0, 999.0, 8.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 2.0, 999.0, 4.0, 999.0, 6.0, 999.0 ] -} 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 deleted file mode 100755 index 0f0160506cf8..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_sa1n_sa2n.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "uplo": "upper", - "N": 3, - "alpha": 1.0, - "x": [ 1.0, 2.0, 3.0 ], - "strideX": 1, - "offsetX": 0, - "A": [ 999.0, 1.0, 999.0, 0.0, 999.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 2.0, 999.0, 1.0, 999.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 3.0, 999.0, 2.0, 999.0, 1.0, 999.0 ], - "strideA1": -14, - "strideA2": -2, - "offsetA": 33, - "A_out": [ 999.0, 10.0, 999.0, 0.0, 999.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 8.0, 999.0, 5.0, 999.0, 0.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 6.0, 999.0, 4.0, 999.0, 2.0, 999.0 ] -} 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 deleted file mode 100755 index fd23d63a4fbc..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_u.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "order": "row-major", - "uplo": "upper", - "N": 3, - "alpha": 1.0, - "x": [ 1.0, 2.0, 3.0 ], - "strideX": 1, - "offsetX": 0, - "A": [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ], - "lda": 3, - "strideA1": 3, - "strideA2": 1, - "offsetA": 0, - "A_out": [ 2.0, 4.0, 6.0, 0.0, 5.0, 8.0, 0.0, 0.0, 10.0 ] -} 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 deleted file mode 100755 index 9bb9da9839b5..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_xn.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "order": "row-major", - "uplo": "upper", - "N": 3, - "alpha": 1.0, - "x": [ 1.0, 2.0, 3.0, 4.0, 5.0 ], - "strideX": -2, - "offsetX": 4, - "A": [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ], - "lda": 3, - "strideA1": 3, - "strideA2": 1, - "offsetA": 0, - "A_out": [ 26.0, 17.0, 8.0, 0.0, 10.0, 5.0, 0.0, 0.0, 2.0 ] -} 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 deleted file mode 100755 index 2967b1af66c0..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/fixtures/row_major_xp.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "order": "row-major", - "uplo": "upper", - "N": 3, - "alpha": 1.0, - "x": [ 1.0, 2.0, 3.0, 4.0, 5.0 ], - "strideX": 2, - "offsetX": 0, - "A": [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ], - "lda": 3, - "strideA1": 3, - "strideA2": 1, - "offsetA": 0, - "A_out": [ 2.0, 5.0, 8.0, 0.0, 10.0, 17.0, 0.0, 0.0, 26.0 ] -} 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 deleted file mode 100755 index 537ce4812ecf..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.js +++ /dev/null @@ -1,417 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 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 tape = require( 'tape' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dsyr = require( './../lib/dsyr.js' ); - - -// 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' ); - - -// TESTS // - -tape( 'main export is a function', 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', function test( t ) { - t.strictEqual( dsyr.length, 8, 'returns expected value' ); - t.end(); -}); - -tape( 'the function throws an error if provided an invalid first argument', 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', 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', 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', 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', 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)', 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( 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' ); - - t.end(); -}); - -tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` (column-major, upper)', 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( 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' ); - - t.end(); -}); - -tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` (row-major, lower)', 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( 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' ); - - t.end(); -}); - -tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` (column-major, lower)', 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( 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' ); - - t.end(); -}); - -tape( 'the function returns a reference to the input matrix `A`', 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( data.order, 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)', 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( 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( 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' ); - - t.end(); -}); - -tape( 'if `N` is zero or the scalar constant is zero, the function returns the input matrix `A` unchanged (column-major)', 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( 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( 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' ); - - t.end(); -}); - -tape( 'the function supports specifying an `x` stride (row-major)', 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( 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' ); - - t.end(); -}); - -tape( 'the function supports specifying an `x` stride (column-major)', 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( 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' ); - - t.end(); -}); - -tape( 'the function supports specifying a negative `x` stride (row-major)', 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( 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' ); - - t.end(); -}); - -tape( 'the function supports specifying a negative `x` stride (column-major)', 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( 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' ); - - t.end(); -}); 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 deleted file mode 100755 index 75d3591652c0..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/test.dsyr.native.js +++ /dev/null @@ -1,300 +0,0 @@ -/** -* @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.js b/lib/node_modules/@stdlib/blas/base/dsyr/test/test.js deleted file mode 100755 index 62f344c6d4f2..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/test.js +++ /dev/null @@ -1,82 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var proxyquire = require( 'proxyquire' ); -var IS_BROWSER = require( '@stdlib/assert/is-browser' ); -var dsyr = require( './../lib' ); - - -// VARIABLES // - -var opts = { - 'skip': IS_BROWSER -}; - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof dsyr, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'attached to the main export is a method providing an ndarray interface', function test( t ) { - t.strictEqual( typeof dsyr.ndarray, 'function', 'method is a function' ); - t.end(); -}); - -tape( 'if a native implementation is available, the main export is the native implementation', opts, function test( t ) { - var dsyr = proxyquire( './../lib', { - '@stdlib/utils/try-require': tryRequire - }); - - t.strictEqual( dsyr, mock, 'returns expected value' ); - t.end(); - - function tryRequire() { - return mock; - } - - function mock() { - // Mock... - } -}); - -tape( 'if a native implementation is not available, the main export is a JavaScript implementation', opts, function test( t ) { - var dsyr; - var main; - - main = require( './../lib/dsyr.js' ); - - dsyr = proxyquire( './../lib', { - '@stdlib/utils/try-require': tryRequire - }); - - t.strictEqual( dsyr, main, 'returns expected value' ); - t.end(); - - function tryRequire() { - return new Error( 'Cannot find module' ); - } -}); 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 deleted file mode 100755 index 81213d71812b..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.js +++ /dev/null @@ -1,627 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 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 tape = require( 'tape' ); -var Float64Array = require( '@stdlib/array/float64' ); -var dsyr = require( './../lib/ndarray.js' ); - - -// 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' ); - - -// TESTS // - -tape( 'main export is a function', 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', function test( t ) { - t.strictEqual( dsyr.length, 10, 'returns expected value' ); - t.end(); -}); - -tape( 'the function throws an error if provided an invalid first argument', 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', 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', 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)', 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( 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)', 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( 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)', 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( 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)', 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( 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`', 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( 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)', 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( 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( 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)', 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( 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( 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)', 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( 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)', 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( 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)', 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( 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)', 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( 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)', 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( 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)', 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( 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)', 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( 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)', 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( 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)', 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( 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)', 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( 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)', 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( 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)', 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( 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)', 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( 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)', 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( 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)', 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( 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)', 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( 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(); -}); 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 deleted file mode 100755 index a2b341fe4498..000000000000 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.native.js +++ /dev/null @@ -1,563 +0,0 @@ -/** -* @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(); -});