LAPACK 3.11.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ LAPACKE_ctz_nancheck()

lapack_logical LAPACKE_ctz_nancheck ( int  matrix_layout,
char  direct,
char  uplo,
char  diag,
lapack_int  m,
lapack_int  n,
const lapack_complex_float a,
lapack_int  lda 
)

Definition at line 83 of file lapacke_ctz_nancheck.c.

87{
88 lapack_logical colmaj, front, lower, unit;
89
90 if( a == NULL ) return (lapack_logical) 0;
91
92 colmaj = ( matrix_layout == LAPACK_COL_MAJOR );
93 front = LAPACKE_lsame( direct, 'f' );
94 lower = LAPACKE_lsame( uplo, 'l' );
95 unit = LAPACKE_lsame( diag, 'u' );
96
97 if( ( !colmaj && ( matrix_layout != LAPACK_ROW_MAJOR ) ) ||
98 ( !front && !LAPACKE_lsame( direct, 'b' ) ) ||
99 ( !lower && !LAPACKE_lsame( uplo, 'u' ) ) ||
100 ( !unit && !LAPACKE_lsame( diag, 'n' ) ) ) {
101 /* Just exit if any of input parameters are wrong */
102 return (lapack_logical) 0;
103 }
104
105 /* Initial offsets and sizes of triangular and rectangular parts */
106 lapack_int tri_offset = 0;
107 lapack_int tri_n = MIN(m,n);
108 lapack_int rect_offset = -1;
109 lapack_int rect_m = ( m > n ) ? m - n : m;
110 lapack_int rect_n = ( n > m ) ? n - m : n;
111
112 /* Fix offsets depending on the shape of the matrix */
113 if( front ) {
114 if( lower && m > n ) {
115 rect_offset = tri_n * ( !colmaj ? lda : 1 );
116 } else if( !lower && n > m ) {
117 rect_offset = tri_n * ( colmaj ? lda : 1 );
118 }
119 } else {
120 if( m > n ) {
121 tri_offset = rect_m * ( !colmaj ? lda : 1 );
122 if( !lower ) {
123 rect_offset = 0;
124 }
125 } else if( n > m ) {
126 tri_offset = rect_n * ( colmaj ? lda : 1 );
127 if( lower ) {
128 rect_offset = 0;
129 }
130 }
131 }
132
133 /* Check rectangular part */
134 if( rect_offset >= 0 ) {
135 if( LAPACKE_cge_nancheck( matrix_layout, rect_m, rect_n,
136 &a[rect_offset], lda) ) {
137 return (lapack_logical) 1;
138 }
139 }
140
141 /* Check triangular part */
142 return LAPACKE_ctr_nancheck( matrix_layout, uplo, diag, tri_n,
143 &a[tri_offset], lda );
144}
#define lapack_int
Definition: lapack.h:87
#define lapack_logical
Definition: lapack.h:103
#define LAPACK_COL_MAJOR
Definition: lapacke.h:53
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:52
lapack_logical LAPACKE_lsame(char ca, char cb)
Definition: lapacke_lsame.c:35
#define MIN(x, y)
Definition: lapacke_utils.h:49
lapack_logical LAPACKE_cge_nancheck(int matrix_layout, lapack_int m, lapack_int n, const lapack_complex_float *a, lapack_int lda)
lapack_logical LAPACKE_ctr_nancheck(int matrix_layout, char uplo, char diag, lapack_int n, const lapack_complex_float *a, lapack_int lda)
Here is the call graph for this function:
Here is the caller graph for this function: