LAPACK  3.10.0
LAPACK: Linear Algebra PACKage

◆ LAPACKE_claset_work()

lapack_int LAPACKE_claset_work ( int  matrix_layout,
char  uplo,
lapack_int  m,
lapack_int  n,
lapack_complex_float  alpha,
lapack_complex_float  beta,
lapack_complex_float a,
lapack_int  lda 
)

Definition at line 35 of file lapacke_claset_work.c.

39 {
40  lapack_int info = 0;
41  if( matrix_layout == LAPACK_COL_MAJOR ) {
42  /* Call LAPACK function and adjust info */
43  LAPACK_claset( &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_float* a_t = NULL;
47  /* Check leading dimension(s) */
48  if( lda < n ) {
49  info = -8;
50  LAPACKE_xerbla( "LAPACKE_claset_work", info );
51  return info;
52  }
53  /* Allocate memory for temporary array(s) */
54  a_t = (lapack_complex_float*)
55  LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
56  if( a_t == NULL ) {
58  goto exit_level_0;
59  }
60  /* Transpose input matrices */
61  LAPACKE_cge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
62  /* Call LAPACK function and adjust info */
63  LAPACK_claset( &uplo, &m, &n, &alpha, &beta, a_t, &lda_t );
64  info = 0; /* LAPACK call is ok! */
65  /* Transpose output matrices */
66  LAPACKE_cge_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_claset_work", info );
72  }
73  } else {
74  info = -1;
75  LAPACKE_xerbla( "LAPACKE_claset_work", info );
76  }
77  return info;
78 }
#define lapack_int
Definition: lapack.h:83
#define LAPACK_claset(...)
Definition: lapack.h:10812
#define lapack_complex_float
Definition: lapack.h:45
#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)
#define MAX(x, y)
Definition: lapacke_utils.h:46
void LAPACKE_cge_trans(int matrix_layout, lapack_int m, lapack_int n, const lapack_complex_float *in, lapack_int ldin, lapack_complex_float *out, lapack_int ldout)
Here is the call graph for this function:
Here is the caller graph for this function: