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

Definition at line 36 of file lapacke_sopmtr_work.c.

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

Here is the call graph for this function:

Here is the caller graph for this function: