LAPACK  3.9.1
LAPACK: Linear Algebra PACKage

◆ LAPACKE_zupmtr_work()

lapack_int LAPACKE_zupmtr_work ( int  matrix_layout,
char  side,
char  uplo,
char  trans,
lapack_int  m,
lapack_int  n,
const lapack_complex_double ap,
const lapack_complex_double tau,
lapack_complex_double c,
lapack_int  ldc,
lapack_complex_double work 
)

Definition at line 35 of file lapacke_zupmtr_work.c.

41 {
42  lapack_int info = 0;
43  if( matrix_layout == LAPACK_COL_MAJOR ) {
44  /* Call LAPACK function and adjust info */
45  LAPACK_zupmtr( &side, &uplo, &trans, &m, &n, ap, tau, c, &ldc, work,
46  &info );
47  if( info < 0 ) {
48  info = info - 1;
49  }
50  } else if( matrix_layout == LAPACK_ROW_MAJOR ) {
51  lapack_int r = LAPACKE_lsame( side, 'l' ) ? m : n;
52  lapack_int ldc_t = MAX(1,m);
53  lapack_complex_double* c_t = NULL;
54  lapack_complex_double* ap_t = NULL;
55  /* Check leading dimension(s) */
56  if( ldc < n ) {
57  info = -10;
58  LAPACKE_xerbla( "LAPACKE_zupmtr_work", info );
59  return info;
60  }
61  /* Allocate memory for temporary array(s) */
62  c_t = (lapack_complex_double*)
63  LAPACKE_malloc( sizeof(lapack_complex_double) * ldc_t * MAX(1,n) );
64  if( c_t == NULL ) {
66  goto exit_level_0;
67  }
68  ap_t = (lapack_complex_double*)
70  ( MAX(1,r) * MAX(2,r+1) ) / 2 );
71  if( ap_t == NULL ) {
73  goto exit_level_1;
74  }
75  /* Transpose input matrices */
76  LAPACKE_zge_trans( matrix_layout, m, n, c, ldc, c_t, ldc_t );
77  LAPACKE_zpp_trans( matrix_layout, uplo, r, ap, ap_t );
78  /* Call LAPACK function and adjust info */
79  LAPACK_zupmtr( &side, &uplo, &trans, &m, &n, ap_t, tau, c_t, &ldc_t,
80  work, &info );
81  if( info < 0 ) {
82  info = info - 1;
83  }
84  /* Transpose output matrices */
85  LAPACKE_zge_trans( LAPACK_COL_MAJOR, m, n, c_t, ldc_t, c, ldc );
86  /* Release memory and exit */
87  LAPACKE_free( ap_t );
88 exit_level_1:
89  LAPACKE_free( c_t );
90 exit_level_0:
91  if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
92  LAPACKE_xerbla( "LAPACKE_zupmtr_work", info );
93  }
94  } else {
95  info = -1;
96  LAPACKE_xerbla( "LAPACKE_zupmtr_work", info );
97  }
98  return info;
99 }
void LAPACK_zupmtr(char const *side, char const *uplo, char const *trans, lapack_int const *m, lapack_int const *n, lapack_complex_double const *AP, lapack_complex_double const *tau, lapack_complex_double *C, lapack_int const *ldc, lapack_complex_double *work, lapack_int *info)
#define lapack_int
Definition: lapack.h:83
#define lapack_complex_double
Definition: lapack.h:63
#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_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)
void LAPACKE_zpp_trans(int matrix_layout, char uplo, lapack_int n, const lapack_complex_double *in, lapack_complex_double *out)
#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: