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

Go to the source code of this file.

Functions

lapack_int LAPACKE_cstegr_work (int matrix_layout, char jobz, char range, lapack_int n, float *d, float *e, 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_int *isuppz, float *work, lapack_int lwork, lapack_int *iwork, lapack_int liwork)

Function Documentation

◆ LAPACKE_cstegr_work()

lapack_int LAPACKE_cstegr_work ( int matrix_layout,
char jobz,
char range,
lapack_int n,
float * d,
float * e,
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_int * isuppz,
float * work,
lapack_int lwork,
lapack_int * iwork,
lapack_int liwork )

Definition at line 35 of file lapacke_cstegr_work.c.

43{
44 lapack_int info = 0;
45 if( matrix_layout == LAPACK_COL_MAJOR ) {
46 /* Call LAPACK function and adjust info */
47 LAPACK_cstegr( &jobz, &range, &n, d, e, &vl, &vu, &il, &iu, &abstol, m,
48 w, z, &ldz, isuppz, work, &lwork, iwork, &liwork,
49 &info );
50 if( info < 0 ) {
51 info = info - 1;
52 }
53 } else if( matrix_layout == LAPACK_ROW_MAJOR ) {
54 lapack_int ldz_t = MAX(1,n);
55 lapack_complex_float* z_t = NULL;
56 /* Check leading dimension(s) */
57 if( ( LAPACKE_lsame( jobz, 'v' ) && ( ldz < ldz_t ) ) || ( ldz < 1 ) ) {
58 info = -15;
59 LAPACKE_xerbla( "LAPACKE_cstegr_work", info );
60 return info;
61 }
62 /* Query optimal working array(s) size if requested */
63 if( liwork == -1 || lwork == -1 ) {
64 LAPACK_cstegr( &jobz, &range, &n, d, e, &vl, &vu, &il, &iu, &abstol,
65 m, w, z, &ldz_t, isuppz, work, &lwork, iwork,
66 &liwork, &info );
67 return (info < 0) ? (info - 1) : info;
68 }
69 /* Allocate memory for temporary array(s) */
70 if( LAPACKE_lsame( jobz, 'v' ) ) {
71 /* Let be always 'n' instead of 'm' */
74 ldz_t * MAX(1,n) );
75 if( z_t == NULL ) {
77 goto exit_level_0;
78 }
79 }
80 /* Call LAPACK function and adjust info */
81 LAPACK_cstegr( &jobz, &range, &n, d, e, &vl, &vu, &il, &iu, &abstol, m,
82 w, z_t, &ldz_t, isuppz, work, &lwork, iwork, &liwork,
83 &info );
84 if( info < 0 ) {
85 info = info - 1;
86 }
87 /* Transpose output matrices */
88 if( LAPACKE_lsame( jobz, 'v' ) ) {
89 LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, *m, z_t, ldz_t, z, ldz );
90 }
91 /* Release memory and exit */
92 if( LAPACKE_lsame( jobz, 'v' ) ) {
93 LAPACKE_free( z_t );
94 }
95exit_level_0:
96 if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
97 LAPACKE_xerbla( "LAPACKE_cstegr_work", info );
98 }
99 } else {
100 info = -1;
101 LAPACKE_xerbla( "LAPACKE_cstegr_work", info );
102 }
103 return info;
104}
#define LAPACK_cstegr(...)
Definition lapack.h:16222
#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
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)
n