LAPACK  3.10.1
LAPACK: Linear Algebra PACKage

◆ LAPACKE_clascl()

lapack_int LAPACKE_clascl ( int  matrix_layout,
char  type,
lapack_int  kl,
lapack_int  ku,
float  cfrom,
float  cto,
lapack_int  m,
lapack_int  n,
lapack_complex_float a,
lapack_int  lda 
)

Definition at line 35 of file lapacke_clascl.c.

39 {
40  if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
41  LAPACKE_xerbla( "LAPACKE_clascl", -1 );
42  return -1;
43  }
44 #ifndef LAPACK_DISABLE_NAN_CHECK
45  if( LAPACKE_get_nancheck() ) {
46  /* Optionally check input matrices for NaNs */
47  switch (type) {
48  case 'G':
49  if( LAPACKE_cge_nancheck( matrix_layout, m, n, a, lda ) ) {
50  return -9;
51  }
52  break;
53  case 'L':
54  // TYPE = 'L' - lower triangle of general matrix
55  if( matrix_layout == LAPACK_COL_MAJOR &&
56  LAPACKE_cgb_nancheck( matrix_layout, m, n, m-1, 0, a, lda+1 ) ) {
57  return -9;
58  }
59  if( matrix_layout == LAPACK_ROW_MAJOR &&
60  LAPACKE_cgb_nancheck( LAPACK_COL_MAJOR, n, m, 0, m-1, a-m+1, lda+1 ) ) {
61  return -9;
62  }
63  break;
64  case 'U':
65  // TYPE = 'U' - upper triangle of general matrix
66  if( matrix_layout == LAPACK_COL_MAJOR &&
67  LAPACKE_cgb_nancheck( matrix_layout, m, n, 0, n-1, a-n+1, lda+1 ) ) {
68  return -9;
69  }
70  if( matrix_layout == LAPACK_ROW_MAJOR &&
71  LAPACKE_cgb_nancheck( LAPACK_COL_MAJOR, n, m, n-1, 0, a, lda+1 ) ) {
72  return -9;
73  }
74  break;
75  case 'H':
76  // TYPE = 'H' - part of upper Hessenberg matrix in general matrix
77  if( matrix_layout == LAPACK_COL_MAJOR &&
78  LAPACKE_cgb_nancheck( matrix_layout, m, n, 1, n-1, a-n+1, lda+1 ) ) {
79  return -9;
80  }
81  if( matrix_layout == LAPACK_ROW_MAJOR &&
82  LAPACKE_cgb_nancheck( LAPACK_COL_MAJOR, n, m, n-1, 1, a-1, lda+1 ) ) {
83  return -9;
84  }
85  break;
86  case 'B':
87  // TYPE = 'B' - lower part of symmetric band matrix (assume m==n)
88  if( LAPACKE_chb_nancheck( matrix_layout, 'L', n, kl, a, lda ) ) {
89  return -9;
90  }
91  break;
92  case 'Q':
93  // TYPE = 'Q' - upper part of symmetric band matrix (assume m==n)
94  if( LAPACKE_chb_nancheck( matrix_layout, 'U', n, ku, a, lda ) ) {
95  return -9;
96  }
97  break;
98  case 'Z':
99  // TYPE = 'Z' - band matrix laid out for ?GBTRF
100  if( matrix_layout == LAPACK_COL_MAJOR &&
101  LAPACKE_cgb_nancheck( matrix_layout, m, n, kl, ku, a+kl, lda ) ) {
102  return -9;
103  }
104  if( matrix_layout == LAPACK_ROW_MAJOR &&
105  LAPACKE_cgb_nancheck( matrix_layout, m, n, kl, ku, a+lda*kl, lda ) ) {
106  return -9;
107  }
108  break;
109  }
110  }
111 #endif
112  return LAPACKE_clascl_work( matrix_layout, type, kl, ku, cfrom, cto, m, n, a, lda );
113 }
#define LAPACK_COL_MAJOR
Definition: lapacke.h:53
lapack_int LAPACKE_clascl_work(int matrix_layout, char type, lapack_int kl, lapack_int ku, float cfrom, float cto, lapack_int m, lapack_int n, lapack_complex_float *a, lapack_int lda)
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:52
int LAPACKE_get_nancheck(void)
void LAPACKE_xerbla(const char *name, lapack_int info)
lapack_logical LAPACKE_cgb_nancheck(int matrix_layout, lapack_int m, lapack_int n, lapack_int kl, lapack_int ku, const lapack_complex_float *ab, lapack_int ldab)
lapack_logical LAPACKE_chb_nancheck(int matrix_layout, char uplo, lapack_int n, lapack_int kd, const lapack_complex_float *ab, lapack_int ldab)
lapack_logical LAPACKE_cge_nancheck(int matrix_layout, lapack_int m, lapack_int n, const lapack_complex_float *a, lapack_int lda)
Here is the call graph for this function: