LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ LAPACKE_slascl()

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

Definition at line 36 of file lapacke_slascl.c.

40 {
41  if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
42  LAPACKE_xerbla( "LAPACKE_slascl", -1 );
43  return -1;
44  }
45 #ifndef LAPACK_DISABLE_NAN_CHECK
46  if( LAPACKE_get_nancheck() ) {
47  /* Optionally check input matrices for NaNs */
48  switch (type) {
49  case 'G':
50  if( LAPACKE_sge_nancheck( matrix_layout, m, n, a, lda ) ) {
51  return -9;
52  }
53  break;
54  case 'L':
55  // TYPE = 'L' - lower triangle of general matrix
56  if( matrix_layout == LAPACK_COL_MAJOR &&
57  LAPACKE_sgb_nancheck( matrix_layout, m, n, m-1, 0, a, lda+1 ) ) {
58  return -9;
59  }
60  if( matrix_layout == LAPACK_ROW_MAJOR &&
61  LAPACKE_sgb_nancheck( LAPACK_COL_MAJOR, n, m, 0, m-1, a-m+1, lda+1 ) ) {
62  return -9;
63  }
64  break;
65  case 'U':
66  // TYPE = 'U' - upper triangle of general matrix
67  if( matrix_layout == LAPACK_COL_MAJOR &&
68  LAPACKE_sgb_nancheck( matrix_layout, m, n, 0, n-1, a-n+1, lda+1 ) ) {
69  return -9;
70  }
71  if( matrix_layout == LAPACK_ROW_MAJOR &&
72  LAPACKE_sgb_nancheck( LAPACK_COL_MAJOR, n, m, n-1, 0, a, lda+1 ) ) {
73  return -9;
74  }
75  break;
76  case 'H':
77  // TYPE = 'H' - part of upper Hessenberg matrix in general matrix
78  if( matrix_layout == LAPACK_COL_MAJOR &&
79  LAPACKE_sgb_nancheck( matrix_layout, m, n, 1, n-1, a-n+1, lda+1 ) ) {
80  return -9;
81  }
82  if( matrix_layout == LAPACK_ROW_MAJOR &&
83  LAPACKE_sgb_nancheck( LAPACK_COL_MAJOR, n, m, n-1, 1, a-1, lda+1 ) ) {
84  return -9;
85  }
86  case 'B':
87  // TYPE = 'B' - lower part of symmetric band matrix (assume m==n)
88  if( LAPACKE_ssb_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_ssb_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_sgb_nancheck( matrix_layout, m, n, kl, ku, a+kl, lda ) ) {
102  return -9;
103  }
104  if( matrix_layout == LAPACK_ROW_MAJOR &&
105  LAPACKE_sgb_nancheck( matrix_layout, m, n, kl, ku, a+lda*kl, lda ) ) {
106  return -9;
107  }
108  break;
109  }
110  }
111 #endif
112  return LAPACKE_slascl_work( matrix_layout, type, kl, ku, cfrom, cto, m, n, a, lda );
113 }
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:119
lapack_logical LAPACKE_sge_nancheck(int matrix_layout, lapack_int m, lapack_int n, const float *a, lapack_int lda)
lapack_logical LAPACKE_ssb_nancheck(int matrix_layout, char uplo, lapack_int n, lapack_int kd, const float *ab, lapack_int ldab)
lapack_int LAPACKE_slascl_work(int matrix_layout, char type, lapack_int kl, lapack_int ku, float cfrom, float cto, lapack_int m, lapack_int n, float *a, lapack_int lda)
#define LAPACK_COL_MAJOR
Definition: lapacke.h:120
void LAPACKE_xerbla(const char *name, lapack_int info)
lapack_logical LAPACKE_sgb_nancheck(int matrix_layout, lapack_int m, lapack_int n, lapack_int kl, lapack_int ku, const float *ab, lapack_int ldab)
int LAPACKE_get_nancheck()
Here is the call graph for this function: