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

Go to the source code of this file.

Functions

lapack_int LAPACKE_dstevd (int matrix_layout, char jobz, lapack_int n, double *d, double *e, double *z, lapack_int ldz)

Function Documentation

◆ LAPACKE_dstevd()

lapack_int LAPACKE_dstevd ( int matrix_layout,
char jobz,
lapack_int n,
double * d,
double * e,
double * z,
lapack_int ldz )

Definition at line 35 of file lapacke_dstevd.c.

37{
38 lapack_int info = 0;
39 lapack_int liwork = -1;
40 lapack_int lwork = -1;
41 lapack_int* iwork = NULL;
42 double* work = NULL;
43 lapack_int iwork_query;
44 double work_query;
45 if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
46 LAPACKE_xerbla( "LAPACKE_dstevd", -1 );
47 return -1;
48 }
49#ifndef LAPACK_DISABLE_NAN_CHECK
50 if( LAPACKE_get_nancheck() ) {
51 /* Optionally check input matrices for NaNs */
52 if( LAPACKE_d_nancheck( n, d, 1 ) ) {
53 return -4;
54 }
55 if( LAPACKE_d_nancheck( n-1, e, 1 ) ) {
56 return -5;
57 }
58 }
59#endif
60 /* Query optimal working array(s) size */
61 info = LAPACKE_dstevd_work( matrix_layout, jobz, n, d, e, z, ldz,
62 &work_query, lwork, &iwork_query, liwork );
63 if( info != 0 ) {
64 goto exit_level_0;
65 }
66 liwork = iwork_query;
67 lwork = (lapack_int)work_query;
68 /* Allocate memory for work arrays */
69 iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * liwork );
70 if( iwork == NULL ) {
72 goto exit_level_0;
73 }
74 work = (double*)LAPACKE_malloc( sizeof(double) * lwork );
75 if( work == NULL ) {
77 goto exit_level_1;
78 }
79 /* Call middle-level interface */
80 info = LAPACKE_dstevd_work( matrix_layout, jobz, n, d, e, z, ldz, work,
81 lwork, iwork, liwork );
82 /* Release memory and exit */
83 LAPACKE_free( work );
84exit_level_1:
85 LAPACKE_free( iwork );
86exit_level_0:
87 if( info == LAPACK_WORK_MEMORY_ERROR ) {
88 LAPACKE_xerbla( "LAPACKE_dstevd", info );
89 }
90 return info;
91}
#define lapack_int
Definition lapack.h:83
#define LAPACK_WORK_MEMORY_ERROR
Definition lapacke.h:55
#define LAPACK_COL_MAJOR
Definition lapacke.h:53
lapack_int LAPACKE_dstevd_work(int matrix_layout, char jobz, lapack_int n, double *d, double *e, double *z, lapack_int ldz, double *work, lapack_int lwork, lapack_int *iwork, lapack_int liwork)
#define LAPACKE_free(p)
Definition lapacke.h:46
#define LAPACK_ROW_MAJOR
Definition lapacke.h:52
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_d_nancheck(lapack_int n, const double *x, lapack_int incx)
n