LAPACK  3.10.0
LAPACK: Linear Algebra PACKage

◆ LAPACKE_csytrs_aa_2stage_work()

lapack_int LAPACKE_csytrs_aa_2stage_work ( int  matrix_layout,
char  uplo,
lapack_int  n,
lapack_int  nrhs,
lapack_complex_float a,
lapack_int  lda,
lapack_complex_float tb,
lapack_int  ltb,
lapack_int ipiv,
lapack_int ipiv2,
lapack_complex_float b,
lapack_int  ldb 
)

Definition at line 35 of file lapacke_csytrs_aa_2stage_work.c.

39 {
40  lapack_int info = 0;
41  if( matrix_layout == LAPACK_COL_MAJOR ) {
42  /* Call LAPACK function and adjust info */
43  LAPACK_csytrs_aa_2stage( &uplo, &n, &nrhs, a, &lda, tb,
44  &ltb, ipiv, ipiv2, b, &ldb, &info );
45  if( info < 0 ) {
46  info = info - 1;
47  }
48  } else if( matrix_layout == LAPACK_ROW_MAJOR ) {
49  lapack_int lda_t = MAX(1,n);
50  lapack_int ldb_t = MAX(1,n);
51  lapack_complex_float* a_t = NULL;
52  lapack_complex_float* tb_t = NULL;
53  lapack_complex_float* b_t = NULL;
54  /* Check leading dimension(s) */
55  if( lda < n ) {
56  info = -6;
57  LAPACKE_xerbla( "LAPACKE_csytrs_aa_2stage_work", info );
58  return info;
59  }
60  if( ltb < 4*n ) {
61  info = -8;
62  LAPACKE_xerbla( "LAPACKE_csytrs_aa_2stage_work", info );
63  return info;
64  }
65  if( ldb < nrhs ) {
66  info = -12;
67  LAPACKE_xerbla( "LAPACKE_csytrs_aa_2stage_work", info );
68  return info;
69  }
70  /* Allocate memory for temporary array(s) */
71  a_t = (lapack_complex_float*)LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
72  if( a_t == NULL ) {
74  goto exit_level_0;
75  }
77  if( tb_t == NULL ) {
79  goto exit_level_1;
80  }
81  b_t = (lapack_complex_float*)LAPACKE_malloc( sizeof(lapack_complex_float) * ldb_t * MAX(1,nrhs) );
82  if( b_t == NULL ) {
84  goto exit_level_2;
85  }
86  /* Transpose input matrices */
87  LAPACKE_csy_trans( matrix_layout, uplo, n, a, lda, a_t, lda_t );
88  LAPACKE_cge_trans( matrix_layout, n, nrhs, b, ldb, b_t, ldb_t );
89  /* Call LAPACK function and adjust info */
90  LAPACK_csytrs_aa_2stage( &uplo, &n, &nrhs, a_t, &lda_t,
91  tb_t, &ltb, ipiv, ipiv2, b_t, &ldb_t, &info );
92  if( info < 0 ) {
93  info = info - 1;
94  }
95  /* Transpose output matrices */
96  LAPACKE_csy_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda );
97  LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, nrhs, b_t, ldb_t, b, ldb );
98  /* Release memory and exit */
99  LAPACKE_free( b_t );
100 exit_level_2:
101  LAPACKE_free( tb_t );
102 exit_level_1:
103  LAPACKE_free( a_t );
104 exit_level_0:
105  if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
106  LAPACKE_xerbla( "LAPACKE_csytrs_aa_2stage_work", info );
107  }
108  } else {
109  info = -1;
110  LAPACKE_xerbla( "LAPACKE_csytrs_aa_2stage_work", info );
111  }
112  return info;
113 }
#define LAPACK_csytrs_aa_2stage(...)
Definition: lapack.h:19414
#define lapack_int
Definition: lapack.h:83
#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)
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)
#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: