From 2d3d6c690b65448a9bf60e464567220d0dd328ee Mon Sep 17 00:00:00 2001 From: DhruvArvindSingh Date: Tue, 6 Jan 2026 22:44:54 +0530 Subject: [PATCH 1/4] feat: add C and Fortran implementation of blas/base/drotg --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: passed - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: missing_dependencies - task: lint_c_examples status: missing_dependencies - task: lint_c_benchmarks status: missing_dependencies - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/blas/base/drotg/README.md | 133 ++++- .../base/drotg/benchmark/benchmark.assign.js | 108 ++++ .../benchmark/benchmark.assign.native.js | 113 +++++ .../blas/base/drotg/benchmark/benchmark.js | 106 ++-- .../base/drotg/benchmark/benchmark.native.js | 109 ++++ .../blas/base/drotg/benchmark/c/Makefile | 146 ++++++ .../base/drotg/benchmark/c/benchmark.length.c | 193 +++++++ .../base/drotg/benchmark/fortran/Makefile | 141 ++++++ .../benchmark/fortran/benchmark.length.f | 213 ++++++++ .../@stdlib/blas/base/drotg/binding.gyp | 265 ++++++++++ .../blas/base/drotg/examples/c/Makefile | 146 ++++++ .../blas/base/drotg/examples/c/example.c | 49 ++ .../@stdlib/blas/base/drotg/include.gypi | 70 +++ .../drotg/include/stdlib/blas/base/drotg.h | 48 ++ .../include/stdlib/blas/base/drotg_cblas.h | 43 ++ .../include/stdlib/blas/base/drotg_fortran.h | 41 ++ .../blas/base/drotg/lib/assign.native.js | 52 ++ .../@stdlib/blas/base/drotg/lib/drotg.js | 48 ++ .../blas/base/drotg/lib/drotg.native.js | 51 ++ .../@stdlib/blas/base/drotg/lib/index.js | 17 +- .../@stdlib/blas/base/drotg/lib/main.js | 23 +- .../@stdlib/blas/base/drotg/lib/native.js | 35 ++ .../@stdlib/blas/base/drotg/manifest.json | 472 ++++++++++++++++++ .../@stdlib/blas/base/drotg/package.json | 4 + .../@stdlib/blas/base/drotg/src/Makefile | 70 +++ .../@stdlib/blas/base/drotg/src/addon.c | 63 +++ .../@stdlib/blas/base/drotg/src/drotg.c | 35 ++ .../@stdlib/blas/base/drotg/src/drotg.f | 105 ++++ .../blas/base/drotg/src/drotg_assign.c | 89 ++++ .../@stdlib/blas/base/drotg/src/drotg_cblas.c | 48 ++ .../@stdlib/blas/base/drotg/src/drotg_f.c | 77 +++ .../base/drotg/test/test.assign.native.js | 220 ++++++++ .../test/{test.main.js => test.drotg.js} | 2 +- .../blas/base/drotg/test/test.drotg.native.js | 119 +++++ .../@stdlib/blas/base/drotg/test/test.js | 44 ++ 35 files changed, 3428 insertions(+), 70 deletions(-) create mode 100644 lib/node_modules/@stdlib/blas/base/drotg/benchmark/benchmark.assign.js create mode 100644 lib/node_modules/@stdlib/blas/base/drotg/benchmark/benchmark.assign.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/drotg/benchmark/benchmark.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/drotg/benchmark/c/Makefile create mode 100644 lib/node_modules/@stdlib/blas/base/drotg/benchmark/c/benchmark.length.c create mode 100644 lib/node_modules/@stdlib/blas/base/drotg/benchmark/fortran/Makefile create mode 100644 lib/node_modules/@stdlib/blas/base/drotg/benchmark/fortran/benchmark.length.f create mode 100644 lib/node_modules/@stdlib/blas/base/drotg/binding.gyp create mode 100644 lib/node_modules/@stdlib/blas/base/drotg/examples/c/Makefile create mode 100644 lib/node_modules/@stdlib/blas/base/drotg/examples/c/example.c create mode 100644 lib/node_modules/@stdlib/blas/base/drotg/include.gypi create mode 100644 lib/node_modules/@stdlib/blas/base/drotg/include/stdlib/blas/base/drotg.h create mode 100644 lib/node_modules/@stdlib/blas/base/drotg/include/stdlib/blas/base/drotg_cblas.h create mode 100644 lib/node_modules/@stdlib/blas/base/drotg/include/stdlib/blas/base/drotg_fortran.h create mode 100644 lib/node_modules/@stdlib/blas/base/drotg/lib/assign.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/drotg/lib/drotg.js create mode 100644 lib/node_modules/@stdlib/blas/base/drotg/lib/drotg.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/drotg/lib/native.js create mode 100644 lib/node_modules/@stdlib/blas/base/drotg/manifest.json create mode 100644 lib/node_modules/@stdlib/blas/base/drotg/src/Makefile create mode 100644 lib/node_modules/@stdlib/blas/base/drotg/src/addon.c create mode 100644 lib/node_modules/@stdlib/blas/base/drotg/src/drotg.c create mode 100644 lib/node_modules/@stdlib/blas/base/drotg/src/drotg.f create mode 100644 lib/node_modules/@stdlib/blas/base/drotg/src/drotg_assign.c create mode 100644 lib/node_modules/@stdlib/blas/base/drotg/src/drotg_cblas.c create mode 100644 lib/node_modules/@stdlib/blas/base/drotg/src/drotg_f.c create mode 100644 lib/node_modules/@stdlib/blas/base/drotg/test/test.assign.native.js rename lib/node_modules/@stdlib/blas/base/drotg/test/{test.main.js => test.drotg.js} (98%) create mode 100644 lib/node_modules/@stdlib/blas/base/drotg/test/test.drotg.native.js diff --git a/lib/node_modules/@stdlib/blas/base/drotg/README.md b/lib/node_modules/@stdlib/blas/base/drotg/README.md index decede2c4f99..8c204f88d4c5 100644 --- a/lib/node_modules/@stdlib/blas/base/drotg/README.md +++ b/lib/node_modules/@stdlib/blas/base/drotg/README.md @@ -2,7 +2,7 @@ @license Apache-2.0 -Copyright (c) 2023 The Stdlib Authors. +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. @@ -76,6 +76,8 @@ var bool = ( y === out );
+## Examples + ```javascript var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ); var drotg = require( '@stdlib/blas/base/drotg' ); @@ -93,6 +95,135 @@ for ( i = 0; i < 100; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/blas/base/drotg.h" +``` + +#### c_drotg( a, b, \*Out, strideOut ) + +Constructs a Givens plane rotation provided two double-precision floating-point values `a` and `b`. + +```c +double Out[ 4 ]; +c_drotg( 0.0, 2.0, Out, 1 ); +// Out => [ 2.0, 1.0, 0.0, 1.0 ] +``` + +The function accepts the following arguments: + +- **a**: `[in] double` rotational elimination parameter. +- **b**: `[in] double` rotational elimination parameter. +- **Out**: `[out] double*` output array. +- **strideOut**: `[in] CBLAS_INT` stride length for `Out`. + +```c +void c_drotg( const double a, const double b, double *Out, const CBLAS_INT strideOut ); +``` + +#### c_drotg_assign( a, b, \*Out, strideOut, offsetOut ) + +Constructs a Givens plane rotation provided two double-precision floating-point values `a` and `b` using alternative indexing semantics. + +```c +double Out[ 4 ]; +c_drotg_assign( 0.0, 2.0, Out, 1, 0 ); +// Out => [ 2.0, 1.0, 0.0, 1.0 ] +``` + +The function accepts the following arguments: + +- **a**: `[in] double` rotational elimination parameter. +- **b**: `[in] double` rotational elimination parameter. +- **Out**: `[out] double*` output array. +- **strideOut**: `[in] CBLAS_INT` stride length for `Out`. +- **offsetOut**: `[in] CBLAS_INT` starting index for `Out`. + +```c +void c_drotg_assign( const double a, const double b, double *Out, const CBLAS_INT strideOut, const CBLAS_INT offsetOut ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/blas/base/drotg.h" +#include + +int main( void ) { + // Specify rotational elimination parameters: + const double a = 0.0; + const double b = 2.0; + int i; + + // Create strided arrays: + double Out[ 4 ]; + + // Specify stride lengths: + const int strideOut = 1; + + // Apply plane rotation: + c_drotg( a, b, Out, strideOut ); + + // Print the result: + for ( i = 0; i < 4; i++ ) { + printf( "Out[%d] = %lf\n", i, Out[ i ] ); + } + + // Apply plane rotation using alternative indexing semantics: + c_drotg_assign( a, b, Out, strideOut, 0 ); + + // Print the result: + for ( i = 0; i < 4; i++ ) { + printf( "Out[%d] = %lf\n", i, Out[ i ] ); + } +} +``` + +
+ + + +
+ + +