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

Go to the source code of this file.

Functions

lapack_int LAPACKE_zsytrs_aa_2stage_work (int matrix_layout, char uplo, lapack_int n, lapack_int nrhs, lapack_complex_double *a, lapack_int lda, lapack_complex_double *tb, lapack_int ltb, lapack_int *ipiv, lapack_int *ipiv2, lapack_complex_double *b, lapack_int ldb)

Function Documentation

◆ LAPACKE_zsytrs_aa_2stage_work()

lapack_int LAPACKE_zsytrs_aa_2stage_work ( int matrix_layout,
char uplo,
lapack_int n,
lapack_int nrhs,
lapack_complex_double * a,
lapack_int lda,
lapack_complex_double * tb,
lapack_int ltb,
lapack_int * ipiv,
lapack_int * ipiv2,
lapack_complex_double * b,
lapack_int ldb )

Definition at line 35 of file lapacke_zsytrs_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_zsytrs_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_double* a_t = NULL;
52 lapack_complex_double* tb_t = NULL;
53 lapack_complex_double* b_t = NULL;
54 /* Check leading dimension(s) */
55 if( lda < n ) {
56 info = -6;
57 LAPACKE_xerbla( "LAPACKE_zsytrs_aa_2stage_work", info );
58 return info;
59 }
60 if( ltb < 4*n ) {
61 info = -8;
62 LAPACKE_xerbla( "LAPACKE_zsytrs_aa_2stage_work", info );
63 return info;
64 }
65 if( ldb < nrhs ) {
66 info = -12;
67 LAPACKE_xerbla( "LAPACKE_zsytrs_aa_2stage_work", info );
68 return info;
69 }
70 /* Allocate memory for temporary array(s) */
71 a_t = (lapack_complex_double*)LAPACKE_malloc( sizeof(lapack_complex_double) * 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_double*)LAPACKE_malloc( sizeof(lapack_complex_double) * ldb_t * MAX(1,nrhs) );
82 if( b_t == NULL ) {
84 goto exit_level_2;
85 }
86 /* Transpose input matrices */
87 LAPACKE_zsy_trans( matrix_layout, uplo, n, a, lda, a_t, lda_t );
88 LAPACKE_zge_trans( matrix_layout, n, nrhs, b, ldb, b_t, ldb_t );
89 /* Call LAPACK function and adjust info */
90 LAPACK_zsytrs_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_zsy_trans( LAPACK_COL_MAJOR, uplo, n, a_t, lda_t, a, lda );
97 LAPACKE_zge_trans( LAPACK_COL_MAJOR, n, nrhs, b_t, ldb_t, b, ldb );
98 /* Release memory and exit */
99 LAPACKE_free( b_t );
100exit_level_2:
101 LAPACKE_free( tb_t );
102exit_level_1:
103 LAPACKE_free( a_t );
104exit_level_0:
105 if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
106 LAPACKE_xerbla( "LAPACKE_zsytrs_aa_2stage_work", info );
107 }
108 } else {
109 info = -1;
110 LAPACKE_xerbla( "LAPACKE_zsytrs_aa_2stage_work", info );
111 }
112 return info;
113}
#define lapack_int
Definition lapack.h:83
#define LAPACK_zsytrs_aa_2stage(...)
Definition lapack.h:19468
#define lapack_complex_double
Definition lapack.h:63
#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_zge_trans(int matrix_layout, lapack_int m, lapack_int n, const lapack_complex_double *in, lapack_int ldin, lapack_complex_double *out, lapack_int ldout)
#define MAX(x, y)
void LAPACKE_zsy_trans(int matrix_layout, char uplo, lapack_int n, const lapack_complex_double *in, lapack_int ldin, lapack_complex_double *out, lapack_int ldout)
n