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

Go to the source code of this file.

Functions/Subroutines

lapack_logical LAPACKE_ctf_nancheck (int matrix_order, char transr, char uplo, char diag, lapack_int n, const lapack_complex_float *a)

Function/Subroutine Documentation

lapack_logical LAPACKE_ctf_nancheck ( int  matrix_order,
char  transr,
char  uplo,
char  diag,
lapack_int  n,
const lapack_complex_float a 
)

Definition at line 37 of file lapacke_ctf_nancheck.c.

{
lapack_logical rowmaj, ntr, lower, unit;
lapack_int n1, n2, k;
if( a == NULL ) return (lapack_logical) 0;
rowmaj = (matrix_order == LAPACK_ROW_MAJOR);
ntr = LAPACKE_lsame( transr, 'n' );
lower = LAPACKE_lsame( uplo, 'l' );
unit = LAPACKE_lsame( diag, 'u' );
if( ( !rowmaj && ( matrix_order != LAPACK_COL_MAJOR ) ) ||
( !ntr && !LAPACKE_lsame( transr, 't' )
&& !LAPACKE_lsame( transr, 'c' ) ) ||
( !lower && !LAPACKE_lsame( uplo, 'u' ) ) ||
( !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.
* Decoding RFP and checking both triangulars and rectangular
* for NaNs.
*/
if( lower ) {
n2 = n / 2;
n1 = n - n2;
} else {
n1 = n / 2;
n2 = n - n1;
}
if( n % 2 == 1 ) {
/* N is odd */
if( ( rowmaj || ntr ) && !( rowmaj && ntr ) ) {
/* N is odd and ( TRANSR = 'N' .XOR. ROWMAJOR) */
if( lower ) {
n1, &a[0], n )
&a[n1], n )
n2, &a[n], n );
} else {
n1, &a[n2], n )
&a[0], n )
n2, &a[n1], n );
}
} else {
/* N is odd and
( ( TRANSR = 'C' || TRANSR = 'T' ) .XOR. COLMAJOR ) */
if( lower ) {
n1, &a[0], n1 )
&a[1], n1 )
n2, &a[1], n1 );
} else {
n1, &a[(size_t)n2*n2], n2 )
&a[0], n2 )
n2, &a[(size_t)n1*n2], n2 );
}
}
} else {
/* N is even */
k = n / 2;
if( ( rowmaj || ntr ) && !( rowmaj && ntr ) ) {
/* N is even and ( TRANSR = 'N' .XOR. ROWMAJOR) */
if( lower ) {
k, &a[1], n+1 )
&a[k+1], n+1 )
k, &a[0], n+1 );
} else {
k, &a[k+1], n+1 )
&a[0], n+1 )
k, &a[k], n+1 );
}
} else {
/* N is even and
( ( TRANSR = 'C' || TRANSR = 'T' ) .XOR. COLMAJOR ) */
if( lower ) {
k, &a[k], k )
&a[(size_t)k*(k+1)], k )
k, &a[0], k );
} else {
k, &a[(size_t)k*(k+1)], k )
&a[0], k )
k, &a[(size_t)k*k], k );
}
}
}
} else {
/* Non-unit case - just check whole array for NaNs. */
len = n*(n+1)/2;
return LAPACKE_cge_nancheck( LAPACK_COL_MAJOR, len, 1, a, len );
}
}

Here is the call graph for this function:

Here is the caller graph for this function: