LAPACK  3.5.0
LAPACK: Linear Algebra PACKage
 All Classes Files Functions Variables Typedefs Macros
lapacke_stp_nancheck.c File Reference
#include "lapacke_utils.h"
Include dependency graph for lapacke_stp_nancheck.c:

Go to the source code of this file.

Functions/Subroutines

lapack_logical LAPACKE_stp_nancheck (int matrix_order, char uplo, char diag, lapack_int n, const float *ap)

Function/Subroutine Documentation

lapack_logical LAPACKE_stp_nancheck ( int  matrix_order,
char  uplo,
char  diag,
lapack_int  n,
const float *  ap 
)

Definition at line 40 of file lapacke_stp_nancheck.c.

{
lapack_int i, len;
lapack_logical colmaj, upper, unit;
if( ap == NULL ) return (lapack_logical) 0;
colmaj = ( matrix_order == LAPACK_COL_MAJOR );
upper = LAPACKE_lsame( uplo, 'u' );
unit = LAPACKE_lsame( diag, 'u' );
if( ( !colmaj && ( matrix_order != LAPACK_ROW_MAJOR ) ) ||
( !upper && !LAPACKE_lsame( uplo, 'l' ) ) ||
( !unit && !LAPACKE_lsame( diag, 'n' ) ) ) {
/* Just exit if any of input parameters are wrong */
return (lapack_logical) 0;
}
if( unit ) {
/* Unit case, diagonal should be excluded from the check for NaN. */
/* Since col_major upper and row_major lower are equal,
* and col_major lower and row_major upper are equals too -
* using one code for equal cases. XOR( colmaj, upper )
*/
if( ( colmaj || upper ) && !( colmaj && upper ) ) {
for( i = 1; i < n; i++ )
if( LAPACKE_s_nancheck( i, &ap[ ((size_t)i+1)*i/2 ], 1 ) )
return (lapack_logical) 1;
} else {
for( i = 0; i < n-1; i++ )
if( LAPACKE_s_nancheck( n-i-1,
&ap[ (size_t)i+1 + i*((size_t)2*n-i+1)/2 ], 1 ) )
return (lapack_logical) 1;
}
return (lapack_logical) 0;
} else {
/* Non-unit case - just check whole array for NaNs. */
len = n*(n+1)/2;
return LAPACKE_s_nancheck( len, ap, 1 );
}
}

Here is the call graph for this function:

Here is the caller graph for this function: