LAPACK  3.6.1 LAPACK: Linear Algebra PACKage
 lapack_logical LAPACKE_dtp_nancheck ( int matrix_layout, char uplo, char diag, lapack_int n, const double * ap )

Definition at line 40 of file lapacke_dtp_nancheck.c.

43 {
44  lapack_int i, len;
45  lapack_logical colmaj, upper, unit;
46
47  if( ap == NULL ) return (lapack_logical) 0;
48
49  colmaj = ( matrix_layout == LAPACK_COL_MAJOR );
50  upper = LAPACKE_lsame( uplo, 'u' );
51  unit = LAPACKE_lsame( diag, 'u' );
52
53  if( ( !colmaj && ( matrix_layout != LAPACK_ROW_MAJOR ) ) ||
54  ( !upper && !LAPACKE_lsame( uplo, 'l' ) ) ||
55  ( !unit && !LAPACKE_lsame( diag, 'n' ) ) ) {
56  /* Just exit if any of input parameters are wrong */
57  return (lapack_logical) 0;
58  }
59
60  if( unit ) {
61  /* Unit case, diagonal should be excluded from the check for NaN. */
62
63  /* Since col_major upper and row_major lower are equal,
64  * and col_major lower and row_major upper are equals too -
65  * using one code for equal cases. XOR( colmaj, upper )
66  */
67  if( ( colmaj || upper ) && !( colmaj && upper ) ) {
68  for( i = 1; i < n; i++ )
69  if( LAPACKE_d_nancheck( i, &ap[ ((size_t)i+1)*i/2 ], 1 ) )
70  return (lapack_logical) 1;
71  } else {
72  for( i = 0; i < n-1; i++ )
73  if( LAPACKE_d_nancheck( n-i-1,
74  &ap[ (size_t)i+1 + i*((size_t)2*n-i+1)/2 ], 1 ) )
75  return (lapack_logical) 1;
76  }
77  return (lapack_logical) 0;
78  } else {
79  /* Non-unit case - just check whole array for NaNs. */
80  len = n*(n+1)/2;
81  return LAPACKE_d_nancheck( len, ap, 1 );
82  }
83 }
#define lapack_logical
Definition: lapacke.h:51
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:119
lapack_logical LAPACKE_d_nancheck(lapack_int n, const double *x, lapack_int incx)
lapack_logical LAPACKE_lsame(char ca, char cb)
Definition: lapacke_lsame.c:36
#define LAPACK_COL_MAJOR
Definition: lapacke.h:120
#define lapack_int
Definition: lapacke.h:47

Here is the call graph for this function:

Here is the caller graph for this function: