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

Go to the source code of this file.

Functions

lapack_int LAPACKE_sstemr (int matrix_layout, char jobz, char range, lapack_int n, float *d, float *e, float vl, float vu, lapack_int il, lapack_int iu, lapack_int *m, float *w, float *z, lapack_int ldz, lapack_int nzc, lapack_int *isuppz, lapack_logical *tryrac)

Function Documentation

◆ LAPACKE_sstemr()

lapack_int LAPACKE_sstemr ( int matrix_layout,
char jobz,
char range,
lapack_int n,
float * d,
float * e,
float vl,
float vu,
lapack_int il,
lapack_int iu,
lapack_int * m,
float * w,
float * z,
lapack_int ldz,
lapack_int nzc,
lapack_int * isuppz,
lapack_logical * tryrac )

Definition at line 35 of file lapacke_sstemr.c.

40{
41 lapack_int info = 0;
42 lapack_int liwork = -1;
43 lapack_int lwork = -1;
44 lapack_int* iwork = NULL;
45 float* work = NULL;
46 lapack_int iwork_query;
47 float work_query;
48 if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
49 LAPACKE_xerbla( "LAPACKE_sstemr", -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_s_nancheck( n, d, 1 ) ) {
56 return -5;
57 }
58 if( LAPACKE_s_nancheck( n-1, e, 1 ) ) {
59 return -6;
60 }
61 if( LAPACKE_s_nancheck( 1, &vl, 1 ) ) {
62 return -7;
63 }
64 if( LAPACKE_s_nancheck( 1, &vu, 1 ) ) {
65 return -8;
66 }
67 }
68#endif
69 /* Query optimal working array(s) size */
70 info = LAPACKE_sstemr_work( matrix_layout, jobz, range, n, d, e, vl, vu, il,
71 iu, m, w, z, ldz, nzc, isuppz, tryrac,
72 &work_query, lwork, &iwork_query, liwork );
73 if( info != 0 ) {
74 goto exit_level_0;
75 }
76 liwork = iwork_query;
77 lwork = (lapack_int)work_query;
78 /* Allocate memory for work arrays */
79 iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * liwork );
80 if( iwork == NULL ) {
82 goto exit_level_0;
83 }
84 work = (float*)LAPACKE_malloc( sizeof(float) * lwork );
85 if( work == NULL ) {
87 goto exit_level_1;
88 }
89 /* Call middle-level interface */
90 info = LAPACKE_sstemr_work( matrix_layout, jobz, range, n, d, e, vl, vu, il,
91 iu, m, w, z, ldz, nzc, isuppz, tryrac, work,
92 lwork, iwork, liwork );
93 /* Release memory and exit */
94 LAPACKE_free( work );
95exit_level_1:
96 LAPACKE_free( iwork );
97exit_level_0:
98 if( info == LAPACK_WORK_MEMORY_ERROR ) {
99 LAPACKE_xerbla( "LAPACKE_sstemr", info );
100 }
101 return info;
102}
#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_sstemr_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, lapack_int *m, float *w, float *z, lapack_int ldz, lapack_int nzc, lapack_int *isuppz, lapack_logical *tryrac, float *work, lapack_int lwork, lapack_int *iwork, lapack_int liwork)
int LAPACKE_get_nancheck(void)
#define LAPACKE_malloc(size)
Definition lapacke.h:43
void LAPACKE_xerbla(const char *name, lapack_int info)
lapack_logical LAPACKE_s_nancheck(lapack_int n, const float *x, lapack_int incx)
n