LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
lapack_int LAPACKE_dlascl ( int  matrix_layout,
char  type,
lapack_int  kl,
lapack_int  ku,
double  cfrom,
double  cto,
lapack_int  m,
lapack_int  n,
double *  a,
lapack_int  lda 
)

Definition at line 36 of file lapacke_dlascl.c.

40 {
41  if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
42  LAPACKE_xerbla( "LAPACKE_dlascl", -1 );
43  return -1;
44  }
45 #ifndef LAPACK_DISABLE_NAN_CHECK
46  /* Optionally check input matrices for NaNs */
47  switch (type) {
48  case 'G':
49  if( LAPACKE_dge_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_dgb_nancheck( matrix_layout, m, n, m-1, 0, a, lda+1 ) ) {
57  return -9;
58  }
59  if( matrix_layout == LAPACK_ROW_MAJOR &&
60  LAPACKE_dgb_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_dgb_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_dgb_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_dgb_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_dgb_nancheck( LAPACK_COL_MAJOR, n, m, n-1, 1, a-1, lda+1 ) ) {
83  return -9;
84  }
85  case 'B':
86  // TYPE = 'B' - lower part of symmetric band matrix (assume m==n)
87  if( LAPACKE_dsb_nancheck( matrix_layout, 'L', n, kl, a, lda ) ) {
88  return -9;
89  }
90  break;
91  case 'Q':
92  // TYPE = 'Q' - upper part of symmetric band matrix (assume m==n)
93  if( LAPACKE_dsb_nancheck( matrix_layout, 'U', n, ku, a, lda ) ) {
94  return -9;
95  }
96  break;
97  case 'Z':
98  // TYPE = 'Z' - band matrix laid out for ?GBTRF
99  if( matrix_layout == LAPACK_COL_MAJOR &&
100  LAPACKE_dgb_nancheck( matrix_layout, m, n, kl, ku, a+kl, lda ) ) {
101  return -9;
102  }
103  if( matrix_layout == LAPACK_ROW_MAJOR &&
104  LAPACKE_dgb_nancheck( matrix_layout, m, n, kl, ku, a+lda*kl, lda ) ) {
105  return -9;
106  }
107  break;
108  }
109 #endif
110  return LAPACKE_dlascl_work( matrix_layout, type, kl, ku, cfrom, cto, m, n, a, lda );
111 }
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:119
lapack_logical LAPACKE_dge_nancheck(int matrix_layout, lapack_int m, lapack_int n, const double *a, lapack_int lda)
lapack_logical LAPACKE_dgb_nancheck(int matrix_layout, lapack_int m, lapack_int n, lapack_int kl, lapack_int ku, const double *ab, lapack_int ldab)
lapack_int LAPACKE_dlascl_work(int matrix_layout, char type, lapack_int kl, lapack_int ku, double cfrom, double cto, lapack_int m, lapack_int n, double *a, lapack_int lda)
#define LAPACK_COL_MAJOR
Definition: lapacke.h:120
void LAPACKE_xerbla(const char *name, lapack_int info)
lapack_logical LAPACKE_dsb_nancheck(int matrix_layout, char uplo, lapack_int n, lapack_int kd, const double *ab, lapack_int ldab)

Here is the call graph for this function: