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

Go to the source code of this file.

Functions

lapack_int LAPACKE_dsyevr_2stage (int matrix_layout, char jobz, char range, char uplo, lapack_int n, double *a, lapack_int lda, double vl, double vu, lapack_int il, lapack_int iu, double abstol, lapack_int *m, double *w, double *z, lapack_int ldz, lapack_int *isuppz)

Function Documentation

◆ LAPACKE_dsyevr_2stage()

lapack_int LAPACKE_dsyevr_2stage ( int matrix_layout,
char jobz,
char range,
char uplo,
lapack_int n,
double * a,
lapack_int lda,
double vl,
double vu,
lapack_int il,
lapack_int iu,
double abstol,
lapack_int * m,
double * w,
double * z,
lapack_int ldz,
lapack_int * isuppz )

Definition at line 35 of file lapacke_dsyevr_2stage.c.

40{
41 lapack_int info = 0;
42 lapack_int liwork = -1;
43 lapack_int lwork = -1;
44 lapack_int* iwork = NULL;
45 double* work = NULL;
46 lapack_int iwork_query;
47 double work_query;
48 if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
49 LAPACKE_xerbla( "LAPACKE_dsyevr_2stage", -1 );
50 return -1;
51 }
52#ifndef LAPACK_DISABLE_NAN_CHECK
53 if( LAPACKE_get_nancheck() ) {
54 /* Optionally check input matrices for NaNs */
55 if( LAPACKE_dsy_nancheck( matrix_layout, uplo, n, a, lda ) ) {
56 return -6;
57 }
58 if( LAPACKE_d_nancheck( 1, &abstol, 1 ) ) {
59 return -12;
60 }
61 if( LAPACKE_lsame( range, 'v' ) ) {
62 if( LAPACKE_d_nancheck( 1, &vl, 1 ) ) {
63 return -8;
64 }
65 }
66 if( LAPACKE_lsame( range, 'v' ) ) {
67 if( LAPACKE_d_nancheck( 1, &vu, 1 ) ) {
68 return -9;
69 }
70 }
71 }
72#endif
73 /* Query optimal working array(s) size */
74 info = LAPACKE_dsyevr_2stage_work( matrix_layout, jobz, range, uplo, n, a, lda, vl,
75 vu, il, iu, abstol, m, w, z, ldz, isuppz,
76 &work_query, lwork, &iwork_query, liwork );
77 if( info != 0 ) {
78 goto exit_level_0;
79 }
80 liwork = iwork_query;
81 lwork = (lapack_int)work_query;
82 /* Allocate memory for work arrays */
83 iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * liwork );
84 if( iwork == NULL ) {
86 goto exit_level_0;
87 }
88 work = (double*)LAPACKE_malloc( sizeof(double) * lwork );
89 if( work == NULL ) {
91 goto exit_level_1;
92 }
93 /* Call middle-level interface */
94 info = LAPACKE_dsyevr_2stage_work( matrix_layout, jobz, range, uplo, n, a, lda, vl,
95 vu, il, iu, abstol, m, w, z, ldz, isuppz, work,
96 lwork, iwork, liwork );
97 /* Release memory and exit */
98 LAPACKE_free( work );
99exit_level_1:
100 LAPACKE_free( iwork );
101exit_level_0:
102 if( info == LAPACK_WORK_MEMORY_ERROR ) {
103 LAPACKE_xerbla( "LAPACKE_dsyevr_2stage", info );
104 }
105 return info;
106}
#define lapack_int
Definition lapack.h:83
#define LAPACK_WORK_MEMORY_ERROR
Definition lapacke.h:55
#define LAPACK_COL_MAJOR
Definition lapacke.h:53
#define LAPACKE_free(p)
Definition lapacke.h:46
#define LAPACK_ROW_MAJOR
Definition lapacke.h:52
lapack_int LAPACKE_dsyevr_2stage_work(int matrix_layout, char jobz, char range, char uplo, lapack_int n, double *a, lapack_int lda, double vl, double vu, lapack_int il, lapack_int iu, double abstol, lapack_int *m, double *w, double *z, lapack_int ldz, lapack_int *isuppz, double *work, lapack_int lwork, lapack_int *iwork, lapack_int liwork)
int LAPACKE_get_nancheck(void)
#define LAPACKE_malloc(size)
Definition lapacke.h:43
lapack_logical LAPACKE_lsame(char ca, char cb)
void LAPACKE_xerbla(const char *name, lapack_int info)
lapack_logical LAPACKE_d_nancheck(lapack_int n, const double *x, lapack_int incx)
lapack_logical LAPACKE_dsy_nancheck(int matrix_layout, char uplo, lapack_int n, const double *a, lapack_int lda)
n