LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
lapack_int LAPACKE_cupmtr_work ( int  matrix_layout,
char  side,
char  uplo,
char  trans,
lapack_int  m,
lapack_int  n,
const lapack_complex_float ap,
const lapack_complex_float tau,
lapack_complex_float c,
lapack_int  ldc,
lapack_complex_float work 
)

Definition at line 36 of file lapacke_cupmtr_work.c.

42 {
43  lapack_int info = 0;
44  if( matrix_layout == LAPACK_COL_MAJOR ) {
45  /* Call LAPACK function and adjust info */
46  LAPACK_cupmtr( &side, &uplo, &trans, &m, &n, ap, tau, c, &ldc, work,
47  &info );
48  if( info < 0 ) {
49  info = info - 1;
50  }
51  } else if( matrix_layout == LAPACK_ROW_MAJOR ) {
52  lapack_int r = LAPACKE_lsame( side, 'l' ) ? m : n;
53  lapack_int ldc_t = MAX(1,m);
54  lapack_complex_float* c_t = NULL;
55  lapack_complex_float* ap_t = NULL;
56  /* Check leading dimension(s) */
57  if( ldc < n ) {
58  info = -10;
59  LAPACKE_xerbla( "LAPACKE_cupmtr_work", info );
60  return info;
61  }
62  /* Allocate memory for temporary array(s) */
63  c_t = (lapack_complex_float*)
64  LAPACKE_malloc( sizeof(lapack_complex_float) * ldc_t * MAX(1,n) );
65  if( c_t == NULL ) {
67  goto exit_level_0;
68  }
69  ap_t = (lapack_complex_float*)
71  ( MAX(1,r) * MAX(2,r+1) ) / 2 );
72  if( ap_t == NULL ) {
74  goto exit_level_1;
75  }
76  /* Transpose input matrices */
77  LAPACKE_cge_trans( matrix_layout, m, n, c, ldc, c_t, ldc_t );
78  LAPACKE_cpp_trans( matrix_layout, uplo, r, ap, ap_t );
79  /* Call LAPACK function and adjust info */
80  LAPACK_cupmtr( &side, &uplo, &trans, &m, &n, ap_t, tau, c_t, &ldc_t,
81  work, &info );
82  if( info < 0 ) {
83  info = info - 1;
84  }
85  /* Transpose output matrices */
86  LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, c_t, ldc_t, c, ldc );
87  /* Release memory and exit */
88  LAPACKE_free( ap_t );
89 exit_level_1:
90  LAPACKE_free( c_t );
91 exit_level_0:
92  if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
93  LAPACKE_xerbla( "LAPACKE_cupmtr_work", info );
94  }
95  } else {
96  info = -1;
97  LAPACKE_xerbla( "LAPACKE_cupmtr_work", info );
98  }
99  return info;
100 }
void LAPACKE_cpp_trans(int matrix_layout, char uplo, lapack_int n, const lapack_complex_float *in, lapack_complex_float *out)
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)
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:119
#define lapack_complex_float
Definition: lapacke.h:74
void LAPACK_cupmtr(char *side, char *uplo, char *trans, lapack_int *m, lapack_int *n, const lapack_complex_float *ap, const lapack_complex_float *tau, lapack_complex_float *c, lapack_int *ldc, lapack_complex_float *work, lapack_int *info)
#define MAX(x, y)
Definition: lapacke_utils.h:47
#define LAPACKE_free(p)
Definition: lapacke.h:113
#define LAPACKE_malloc(size)
Definition: lapacke.h:110
lapack_logical LAPACKE_lsame(char ca, char cb)
Definition: lapacke_lsame.c:36
#define LAPACK_COL_MAJOR
Definition: lapacke.h:120
void LAPACKE_xerbla(const char *name, lapack_int info)
#define lapack_int
Definition: lapacke.h:47
#define LAPACK_TRANSPOSE_MEMORY_ERROR
Definition: lapacke.h:123

Here is the call graph for this function:

Here is the caller graph for this function: