LAPACK  3.9.0
LAPACK: Linear Algebra PACKage

◆ LAPACKE_sopmtr_work()

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 35 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;
Here is the call graph for this function:
Here is the caller graph for this function:
LAPACKE_free
#define LAPACKE_free(p)
Definition: lapacke.h:47
LAPACKE_sge_trans
void LAPACKE_sge_trans(int matrix_layout, lapack_int m, lapack_int n, const float *in, lapack_int ldin, float *out, lapack_int ldout)
Definition: lapacke_sge_trans.c:39
lapack_int
#define lapack_int
Definition: lapack.h:21
LAPACKE_ssp_trans
void LAPACKE_ssp_trans(int matrix_layout, char uplo, lapack_int n, const float *in, float *out)
Definition: lapacke_ssp_trans.c:39
LAPACKE_xerbla
void LAPACKE_xerbla(const char *name, lapack_int info)
Definition: lapacke_xerbla.c:36
MAX
#define MAX(x, y)
Definition: lapacke_utils.h:47
LAPACK_TRANSPOSE_MEMORY_ERROR
#define LAPACK_TRANSPOSE_MEMORY_ERROR
Definition: lapacke.h:57
LAPACK_sopmtr
void LAPACK_sopmtr(char const *side, char const *uplo, char const *trans, lapack_int const *m, lapack_int const *n, float const *AP, float const *tau, float *C, lapack_int const *ldc, float *work, lapack_int *info)
LAPACKE_malloc
#define LAPACKE_malloc(size)
Definition: lapacke.h:44
LAPACKE_lsame
lapack_logical LAPACKE_lsame(char ca, char cb)
Definition: lapacke_lsame.c:35
LAPACK_ROW_MAJOR
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:53
LAPACK_COL_MAJOR
#define LAPACK_COL_MAJOR
Definition: lapacke.h:54