OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
lapacke_csytrf_aa_2stage_work.c File Reference
#include "lapacke_utils.h"

Go to the source code of this file.

Functions

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)

Function Documentation

◆ 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.

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