diff --git a/lib/node_modules/@stdlib/blas/base/srotg/README.md b/lib/node_modules/@stdlib/blas/base/srotg/README.md index 7fa9b5bc1174..604b75f0eece 100644 --- a/lib/node_modules/@stdlib/blas/base/srotg/README.md +++ b/lib/node_modules/@stdlib/blas/base/srotg/README.md @@ -92,6 +92,137 @@ for ( i = 0; i < 100; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/blas/base/srotg.h" +``` + +#### c_srotg( a, b, \*Out, strideOut ) + +Constructs a Givens plane rotation provided two single-precision floating-point values `a` and `b`. + +```c +float Out[4]; +c_srotg( 0.0, 2.0, Out, 1 ); +// Out => [ 2.0, 1.0, 0.0, 1.0 ] +``` + +The function accepts the following arguments: + +- **a**: `[in] float` rotational elimination parameter. +- **b**: `[in] float` rotational elimination parameter. +- **Out**: `[inout] float*` output array. +- **strideOut**: `[in] CBLAS_INT` stride length for `Out`. + +```c +void c_srotg_assign( float a, float b, float* Out, const CBLAS_INT strideOut, const CBLAS_INT offsetOut ); +``` + +#### c_srotg_assign(a, b, \*Out, strideOut, offsetOut ) + +Constructs a Givens plane rotation provided two single-precision floating-point values `a` and `b` and assigns results to an output array. + +```c +float Out[4]; +c_srotg_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] float` rotational elimination parameter. +- **b**: `[in] float` rotational elimination parameter. +- **Out**: `[inout] float*` output array. +- **strideOut**: `[in] CBLAS_INT` stride length for `Out`. +- **offsetOut**: `[in] CBLAS_INT` starting index for `Out`. + +Givens transformation. + +```c +void c_srotg_assign( float a, float b, float* Out, const CBLAS_INT strideOut, const CBLAS_INT offsetOut ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/blas/base/srotg.h" +#include + +int main( void ) { + // Specify rotational elimination parameter: + const float a = 0.0; + const float b = 2.0; + int i; + + // Create strided arrays: + float Out[4]; + + // Specify stride lengths: + const int strideOut = 1; + + // Apply plane rotation: + c_srotg( a, b, Out, strideOut ); + + // Print the result: + for ( i = 0; i < 4; i++ ) { + printf( "Out[%d] = %f\n", i, Out[i] ); + } + + // Apply plane rotation + c_srotg_assign( a, b, Out, strideOut, 0 ); + + // Print the result: + for ( i = 0; i < 4; i++ ) { + printf( "Out[%d] = %f\n", i, Out[i] ); + } +} +``` + +
+ + + +
+ + +