LAPACK  3.10.0
LAPACK: Linear Algebra PACKage

◆ LAPACKE_zlaset_work()

lapack_int LAPACKE_zlaset_work ( int  matrix_layout,
char  uplo,
lapack_int  m,
lapack_int  n,
lapack_complex_double  alpha,
lapack_complex_double  beta,
lapack_complex_double a,
lapack_int  lda 
)

Definition at line 35 of file lapacke_zlaset_work.c.

39 {
40  lapack_int info = 0;
41  if( matrix_layout == LAPACK_COL_MAJOR ) {
42  /* Call LAPACK function and adjust info */
43  LAPACK_zlaset( &uplo, &m, &n, &alpha, &beta, a, &lda );
44  } else if( matrix_layout == LAPACK_ROW_MAJOR ) {
45  lapack_int lda_t = MAX(1,m);
46  lapack_complex_double* a_t = NULL;
47  /* Check leading dimension(s) */
48  if( lda < n ) {
49  info = -8;
50  LAPACKE_xerbla( "LAPACKE_zlaset_work", info );
51  return info;
52  }
53  /* Allocate memory for temporary array(s) */
54  a_t = (lapack_complex_double*)
55  LAPACKE_malloc( sizeof(lapack_complex_double) * lda_t * MAX(1,n) );
56  if( a_t == NULL ) {
58  goto exit_level_0;
59  }
60  /* Transpose input matrices */
61  LAPACKE_zge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
62  /* Call LAPACK function and adjust info */
63  LAPACK_zlaset( &uplo, &m, &n, &alpha, &beta, a_t, &lda_t );
64  info = 0; /* LAPACK call is ok! */
65  /* Transpose output matrices */
66  LAPACKE_zge_trans( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
67  /* Release memory and exit */
68  LAPACKE_free( a_t );
69 exit_level_0:
70  if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
71  LAPACKE_xerbla( "LAPACKE_zlaset_work", info );
72  }
73  } else {
74  info = -1;
75  LAPACKE_xerbla( "LAPACKE_zlaset_work", info );
76  }
77  return info;
78 }
#define lapack_int
Definition: lapack.h:83
#define lapack_complex_double
Definition: lapack.h:63
#define LAPACK_zlaset(...)
Definition: lapack.h:10863
#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
void LAPACKE_xerbla(const char *name, lapack_int info)
void LAPACKE_zge_trans(int matrix_layout, lapack_int m, lapack_int n, const lapack_complex_double *in, lapack_int ldin, lapack_complex_double *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: