LAPACK  3.9.0
LAPACK: Linear Algebra PACKage

◆ LAPACKE_csytrf_aa_2stage_work()

lapack_int LAPACKE_csytrf_aa_2stage_work ( int  matrix_layout,
char  uplo,
lapack_int  n,
lapack_complex_float a,
lapack_int  lda,
lapack_complex_float tb,
lapack_int  ltb,
lapack_int ipiv,
lapack_int ipiv2,
lapack_complex_float work,
lapack_int  lwork 
)

Definition at line 35 of file lapacke_csytrf_aa_2stage_work.c.

41 {
42  lapack_int info = 0;
43  if( matrix_layout == LAPACK_COL_MAJOR ) {
44  /* Call LAPACK function and adjust info */
45  LAPACK_csytrf_aa_2stage( &uplo, &n, a, &lda, tb,
46  &ltb, ipiv, ipiv2, work, &lwork,
47  &info );
48  if( info < 0 ) {
49  info = info - 1;
50  }
51  } else if( matrix_layout == LAPACK_ROW_MAJOR ) {
52  lapack_int lda_t = MAX(1,n);
53  lapack_complex_float* a_t = NULL;
54  lapack_complex_float* tb_t = NULL;
55  /* Check leading dimension(s) */
56  if( lda < n ) {
57  info = -6;
58  LAPACKE_xerbla( "LAPACKE_csytrf_aa_2stage_work", info );
59  return info;
60  }
61  if( ltb < 4*n ) {
62  info = -8;
63  LAPACKE_xerbla( "LAPACKE_csytrf_aa_2stage_work", info );
64  return info;
65  }
66 
67  /* Query optimal working array(s) size if requested */
68  if( lwork == -1 ) {
69  LAPACK_csytrf_aa_2stage( &uplo, &n, a, &lda_t,
70  tb, &ltb, ipiv, ipiv2, work,
71  &lwork, &info );
72  return (info < 0) ? (info - 1) : info;
73  }
74  /* Allocate memory for temporary array(s) */
75  a_t = (lapack_complex_float*)LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
76  if( a_t == NULL ) {
78  goto exit_level_0;
79  }
81  if( tb_t == NULL ) {
83  goto exit_level_1;
84  }
85  /* Transpose input matrices */
86  LAPACKE_csy_trans( matrix_layout, uplo, n, a, lda, a_t, lda_t );
87  /* Call LAPACK function and adjust info */
88  LAPACK_csytrf_aa_2stage( &uplo, &n, a_t, &lda_t,
89  tb_t, &ltb, ipiv, ipiv2, work,
90  &lwork, &info );
91  if( info < 0 ) {
92  info = info - 1;
93  }
94  /* Transpose output matrices */
95  LAPACKE_csy_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda );
96  /* Release memory and exit */
97  LAPACKE_free( tb_t );
98 exit_level_1:
99  LAPACKE_free( a_t );
100 exit_level_0:
101  if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
102  LAPACKE_xerbla( "LAPACKE_csytrf_aa_2stage_work", info );
103  }
104  } else {
105  info = -1;
106  LAPACKE_xerbla( "LAPACKE_csytrf_aa_2stage_work", info );
107  }
108  return info;
Here is the call graph for this function:
Here is the caller graph for this function:
LAPACK_csytrf_aa_2stage
void LAPACK_csytrf_aa_2stage(char const *uplo, lapack_int const *n, lapack_complex_float *A, lapack_int const *lda, lapack_complex_float *TB, lapack_int const *ltb, lapack_int *ipiv, lapack_int *ipiv2, lapack_complex_float *work, lapack_int const *lwork, lapack_int *info)
LAPACKE_free
#define LAPACKE_free(p)
Definition: lapacke.h:47
lapack_int
#define lapack_int
Definition: lapack.h:21
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_complex_float
#define lapack_complex_float
Definition: lapack.h:56
LAPACK_TRANSPOSE_MEMORY_ERROR
#define LAPACK_TRANSPOSE_MEMORY_ERROR
Definition: lapacke.h:57
LAPACKE_malloc
#define LAPACKE_malloc(size)
Definition: lapacke.h:44
LAPACKE_csy_trans
void LAPACKE_csy_trans(int matrix_layout, char uplo, lapack_int n, const lapack_complex_float *in, lapack_int ldin, lapack_complex_float *out, lapack_int ldout)
Definition: lapacke_csy_trans.c:39
LAPACK_ROW_MAJOR
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:53
LAPACK_COL_MAJOR
#define LAPACK_COL_MAJOR
Definition: lapacke.h:54