diff --git a/lib/node_modules/@stdlib/blas/base/isamax/README.md b/lib/node_modules/@stdlib/blas/base/isamax/README.md index 7fce18ad218..9994b731bd2 100644 --- a/lib/node_modules/@stdlib/blas/base/isamax/README.md +++ b/lib/node_modules/@stdlib/blas/base/isamax/README.md @@ -143,6 +143,129 @@ console.log( idx ); + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/blas/base/isamax.h" +``` + +#### c_isamax( N, \*X, strideX ) + +Finds the index of the first element having the maximum absolute value. + +```c +const float x[] = { 4.0f, 2.0f, -3.0f, 5.0f, -1.0f }; + +int idx = c_isamax( 5, x, 1 ); +// returns 3 +``` + +The function accepts the following arguments: + +- **N**: `[in] CBLAS_INT` number of indexed elements. +- **X**: `[in] float*` first input array. +- **strideX**: `[in] CBLAS_INT` index increment for `X`. + +```c +CBLAS_INT c_isamax( const CBLAS_INT N, const double *X, const CBLAS_INT strideX ); +``` + +#### c_isamax_ndarray( N, \*X, strideX, offsetX ) + +Finds the index of the first element having the maximum absolute value using alternative indexing semantics. + +```c +const float x[] = { 4.0f, 2.0f, -3.0f, 5.0f, -1.0f }; + +int idx = c_isamax_ndarray( 5, x, 1, 0 ); +// returns 3 +``` + +The function accepts the following arguments: + +- **N**: `[in] CBLAS_INT` number of indexed elements. +- **X**: `[in] float*` first input array. +- **strideX**: `[in] CBLAS_INT` index increment for `X`. +- **offsetX**: `[in] CBLAS_INT` starting index for `X`. + +```c +CBLAS_INT c_isamax_ndarray( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/blas/base/isamax.h" +#include + +int main( void ) { + // Create strided array: + const float x[] = { 1.0f, -2.0f, 3.0f, -4.0f, 5.0f, -6.0f, 7.0f, -8.0f }; + + // Specify the number of element: + const int N = 8; + + // Specify stride: + const int strideX = 1; + + // Compute the index of the maximum absolute value: + int idx = c_isamax( N, x, strideX ); + + // Print the result: + printf( "index value: %d\n", idx ); + + // Compute the index of the maximum absolute value: + idx = c_isamax_ndarray( N, x, -strideX, N-1 ); + + // Print the result: + printf( "index value: %d\n", idx ); +} +``` + +
+ + + +
+ + +