diff --git a/lib/node_modules/@stdlib/blas/base/drotg/README.md b/lib/node_modules/@stdlib/blas/base/drotg/README.md index decede2c4f99..38e28d5846be 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) 2026 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 ] ); + } +} +``` + +
+ + + +
+ + +