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

Go to the source code of this file.

Functions

lapack_int LAPACKE_chpevx_work (int matrix_layout, char jobz, char range, char uplo, lapack_int n, lapack_complex_float *ap, float vl, float vu, lapack_int il, lapack_int iu, float abstol, lapack_int *m, float *w, lapack_complex_float *z, lapack_int ldz, lapack_complex_float *work, float *rwork, lapack_int *iwork, lapack_int *ifail)

Function Documentation

◆ LAPACKE_chpevx_work()

lapack_int LAPACKE_chpevx_work ( int matrix_layout,
char jobz,
char range,
char uplo,
lapack_int n,
lapack_complex_float * ap,
float vl,
float vu,
lapack_int il,
lapack_int iu,
float abstol,
lapack_int * m,
float * w,
lapack_complex_float * z,
lapack_int ldz,
lapack_complex_float * work,
float * rwork,
lapack_int * iwork,
lapack_int * ifail )

Definition at line 35 of file lapacke_chpevx_work.c.

43{
44 lapack_int info = 0;
45 if( matrix_layout == LAPACK_COL_MAJOR ) {
46 /* Call LAPACK function and adjust info */
47 LAPACK_chpevx( &jobz, &range, &uplo, &n, ap, &vl, &vu, &il, &iu,
48 &abstol, m, w, z, &ldz, work, rwork, iwork, ifail,
49 &info );
50 if( info < 0 ) {
51 info = info - 1;
52 }
53 } else if( matrix_layout == LAPACK_ROW_MAJOR ) {
54 lapack_int ncols_z = ( LAPACKE_lsame( range, 'a' ) ||
55 LAPACKE_lsame( range, 'v' ) ) ? n :
56 ( LAPACKE_lsame( range, 'i' ) ? (iu-il+1) : 1);
57 lapack_int ldz_t = MAX(1,n);
58 lapack_complex_float* z_t = NULL;
59 lapack_complex_float* ap_t = NULL;
60 /* Check leading dimension(s) */
61 if( ldz < ncols_z ) {
62 info = -15;
63 LAPACKE_xerbla( "LAPACKE_chpevx_work", info );
64 return info;
65 }
66 /* Allocate memory for temporary array(s) */
67 if( LAPACKE_lsame( jobz, 'v' ) ) {
70 ldz_t * MAX(1,ncols_z) );
71 if( z_t == NULL ) {
73 goto exit_level_0;
74 }
75 }
76 ap_t = (lapack_complex_float*)
78 ( MAX(1,n) * MAX(2,n+1) ) / 2 );
79 if( ap_t == NULL ) {
81 goto exit_level_1;
82 }
83 /* Transpose input matrices */
84 LAPACKE_chp_trans( matrix_layout, uplo, n, ap, ap_t );
85 /* Call LAPACK function and adjust info */
86 LAPACK_chpevx( &jobz, &range, &uplo, &n, ap_t, &vl, &vu, &il, &iu,
87 &abstol, m, w, z_t, &ldz_t, work, rwork, iwork, ifail,
88 &info );
89 if( info < 0 ) {
90 info = info - 1;
91 }
92 /* Transpose output matrices */
93 if( LAPACKE_lsame( jobz, 'v' ) ) {
94 LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, ncols_z, z_t, ldz_t, z,
95 ldz );
96 }
97 LAPACKE_chp_trans( LAPACK_COL_MAJOR, uplo, n, ap_t, ap );
98 /* Release memory and exit */
99 LAPACKE_free( ap_t );
100exit_level_1:
101 if( LAPACKE_lsame( jobz, 'v' ) ) {
102 LAPACKE_free( z_t );
103 }
104exit_level_0:
105 if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
106 LAPACKE_xerbla( "LAPACKE_chpevx_work", info );
107 }
108 } else {
109 info = -1;
110 LAPACKE_xerbla( "LAPACKE_chpevx_work", info );
111 }
112 return info;
113}
#define lapack_int
Definition lapack.h:83
#define LAPACK_chpevx(...)
Definition lapack.h:8567
#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
lapack_logical LAPACKE_lsame(char ca, char cb)
void LAPACKE_xerbla(const char *name, lapack_int info)
#define MAX(x, y)
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)
void LAPACKE_chp_trans(int matrix_layout, char uplo, lapack_int n, const lapack_complex_float *in, lapack_complex_float *out)
n