LAPACK  3.10.0
LAPACK: Linear Algebra PACKage

◆ LAPACKE_slascl_work()

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 
)

Definition at line 35 of file lapacke_slascl_work.c.

39 {
40  lapack_int info = 0;
41  if( matrix_layout == LAPACK_COL_MAJOR ) {
42  /* Call LAPACK function and adjust info */
43  LAPACK_slascl( &type, &kl, &ku, &cfrom, &cto, &m, &n, a, &lda, &info);
44  if( info < 0 ) {
45  info = info - 1;
46  }
47  } else if( matrix_layout == LAPACK_ROW_MAJOR ) {
48  lapack_int nrows_a = LAPACKE_lsame(type, 'b') ? kl + 1 :
49  LAPACKE_lsame(type, 'q') ? ku + 1 :
50  LAPACKE_lsame(type, 'z') ? 2 * kl + ku + 1 : m;
51  lapack_int lda_t = MAX(1,nrows_a);
52  float* a_t = NULL;
53  /* Check leading dimension(s) */
54  if( lda < n ) {
55  info = -9;
56  LAPACKE_xerbla( "LAPACKE_slascl_work", info );
57  return info;
58  }
59  /* Allocate memory for temporary array(s) */
60  a_t = (float*)LAPACKE_malloc( sizeof(float) * lda_t * MAX(1,n) );
61  if( a_t == NULL ) {
63  goto exit_level_0;
64  }
65  /* Transpose input matrices */
66  LAPACKE_sge_trans( matrix_layout, nrows_a, n, a, lda, a_t, lda_t );
67  /* Call LAPACK function and adjust info */
68  LAPACK_slascl( &type, &kl, &ku, &cfrom, &cto, &m, &n, a_t, &lda_t, &info);
69  if( info < 0 ) {
70  info = info - 1;
71  }
72  /* Transpose output matrices */
73  LAPACKE_sge_trans( LAPACK_COL_MAJOR, nrows_a, n, a_t, lda_t, a, lda );
74  /* Release memory and exit */
75  LAPACKE_free( a_t );
76 exit_level_0:
77  if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
78  LAPACKE_xerbla( "LAPACKE_slascl_work", info );
79  }
80  } else {
81  info = -1;
82  LAPACKE_xerbla( "LAPACKE_slascl_work", info );
83  }
84  return info;
85 }
#define LAPACK_slascl(...)
Definition: lapack.h:10777
#define lapack_int
Definition: lapack.h:83
#define LAPACK_COL_MAJOR
Definition: lapacke.h:53
#define LAPACKE_free(p)
Definition: lapacke.h:46
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:52
#define LAPACKE_malloc(size)
Definition: lapacke.h:43
#define LAPACK_TRANSPOSE_MEMORY_ERROR
Definition: lapacke.h:56
lapack_logical LAPACKE_lsame(char ca, char cb)
Definition: lapacke_lsame.c:35
void LAPACKE_xerbla(const char *name, lapack_int info)
void LAPACKE_sge_trans(int matrix_layout, lapack_int m, lapack_int n, const float *in, lapack_int ldin, float *out, lapack_int ldout)
#define MAX(x, y)
Definition: lapacke_utils.h:46
Here is the call graph for this function:
Here is the caller graph for this function: