LAPACK  3.10.0
LAPACK: Linear Algebra PACKage

◆ LAPACKE_ztpqrt_work()

lapack_int LAPACKE_ztpqrt_work ( int  matrix_layout,
lapack_int  m,
lapack_int  n,
lapack_int  l,
lapack_int  nb,
lapack_complex_double a,
lapack_int  lda,
lapack_complex_double b,
lapack_int  ldb,
lapack_complex_double t,
lapack_int  ldt,
lapack_complex_double work 
)

Definition at line 35 of file lapacke_ztpqrt_work.c.

41 {
42  lapack_int info = 0;
43  if( matrix_layout == LAPACK_COL_MAJOR ) {
44  /* Call LAPACK function and adjust info */
45  LAPACK_ztpqrt( &m, &n, &l, &nb, a, &lda, b, &ldb, t, &ldt, work,
46  &info );
47  if( info < 0 ) {
48  info = info - 1;
49  }
50  } else if( matrix_layout == LAPACK_ROW_MAJOR ) {
51  lapack_int lda_t = MAX(1,n);
52  lapack_int ldb_t = MAX(1,m);
53  lapack_int ldt_t = MAX(1,nb);
54  lapack_complex_double* a_t = NULL;
55  lapack_complex_double* b_t = NULL;
56  lapack_complex_double* t_t = NULL;
57  /* Check leading dimension(s) */
58  if( lda < n ) {
59  info = -7;
60  LAPACKE_xerbla( "LAPACKE_ztpqrt_work", info );
61  return info;
62  }
63  if( ldb < n ) {
64  info = -9;
65  LAPACKE_xerbla( "LAPACKE_ztpqrt_work", info );
66  return info;
67  }
68  if( ldt < n ) {
69  info = -11;
70  LAPACKE_xerbla( "LAPACKE_ztpqrt_work", info );
71  return info;
72  }
73  /* Allocate memory for temporary array(s) */
74  a_t = (lapack_complex_double*)
75  LAPACKE_malloc( sizeof(lapack_complex_double) * lda_t * MAX(1,n) );
76  if( a_t == NULL ) {
78  goto exit_level_0;
79  }
80  b_t = (lapack_complex_double*)
81  LAPACKE_malloc( sizeof(lapack_complex_double) * ldb_t * MAX(1,n) );
82  if( b_t == NULL ) {
84  goto exit_level_1;
85  }
86  t_t = (lapack_complex_double*)
87  LAPACKE_malloc( sizeof(lapack_complex_double) * ldt_t * MAX(1,n) );
88  if( t_t == NULL ) {
90  goto exit_level_2;
91  }
92  /* Transpose input matrices */
93  LAPACKE_zge_trans( matrix_layout, n, n, a, lda, a_t, lda_t );
94  LAPACKE_zge_trans( matrix_layout, m, n, b, ldb, b_t, ldb_t );
95  /* Call LAPACK function and adjust info */
96  LAPACK_ztpqrt( &m, &n, &l, &nb, a_t, &lda_t, b_t, &ldb_t, t_t, &ldt_t,
97  work, &info );
98  if( info < 0 ) {
99  info = info - 1;
100  }
101  /* Transpose output matrices */
102  LAPACKE_zge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
103  LAPACKE_zge_trans( LAPACK_COL_MAJOR, m, n, b_t, ldb_t, b, ldb );
104  LAPACKE_zge_trans( LAPACK_COL_MAJOR, nb, n, t_t, ldt_t, t, ldt );
105  /* Release memory and exit */
106  LAPACKE_free( t_t );
107 exit_level_2:
108  LAPACKE_free( b_t );
109 exit_level_1:
110  LAPACKE_free( a_t );
111 exit_level_0:
112  if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
113  LAPACKE_xerbla( "LAPACKE_ztpqrt_work", info );
114  }
115  } else {
116  info = -1;
117  LAPACKE_xerbla( "LAPACKE_ztpqrt_work", info );
118  }
119  return info;
120 }
#define lapack_int
Definition: lapack.h:83
#define lapack_complex_double
Definition: lapack.h:63
void LAPACK_ztpqrt(lapack_int const *m, lapack_int const *n, lapack_int const *l, lapack_int const *nb, lapack_complex_double *A, lapack_int const *lda, lapack_complex_double *B, lapack_int const *ldb, lapack_complex_double *T, lapack_int const *ldt, lapack_complex_double *work, lapack_int *info)
#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: