LAPACK  3.10.1
LAPACK: Linear Algebra PACKage

◆ LAPACKE_cgemqrt_work()

lapack_int LAPACKE_cgemqrt_work ( int  matrix_layout,
char  side,
char  trans,
lapack_int  m,
lapack_int  n,
lapack_int  k,
lapack_int  nb,
const lapack_complex_float v,
lapack_int  ldv,
const lapack_complex_float t,
lapack_int  ldt,
lapack_complex_float c,
lapack_int  ldc,
lapack_complex_float work 
)

Definition at line 35 of file lapacke_cgemqrt_work.c.

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