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

Go to the source code of this file.

Functions

lapack_int LAPACKE_cstedc_work (int matrix_layout, char compz, lapack_int n, float *d, float *e, lapack_complex_float *z, lapack_int ldz, lapack_complex_float *work, lapack_int lwork, float *rwork, lapack_int lrwork, lapack_int *iwork, lapack_int liwork)

Function Documentation

◆ LAPACKE_cstedc_work()

lapack_int LAPACKE_cstedc_work ( int matrix_layout,
char compz,
lapack_int n,
float * d,
float * e,
lapack_complex_float * z,
lapack_int ldz,
lapack_complex_float * work,
lapack_int lwork,
float * rwork,
lapack_int lrwork,
lapack_int * iwork,
lapack_int liwork )

Definition at line 35 of file lapacke_cstedc_work.c.

41{
42 lapack_int info = 0;
43 if( matrix_layout == LAPACK_COL_MAJOR ) {
44 /* Call LAPACK function and adjust info */
45 LAPACK_cstedc( &compz, &n, d, e, z, &ldz, work, &lwork, rwork, &lrwork,
46 iwork, &liwork, &info );
47 if( info < 0 ) {
48 info = info - 1;
49 }
50 } else if( matrix_layout == LAPACK_ROW_MAJOR ) {
51 lapack_int ldz_t = MAX(1,n);
52 lapack_complex_float* z_t = NULL;
53 /* Check leading dimension(s) */
54 if( ldz < n ) {
55 info = -7;
56 LAPACKE_xerbla( "LAPACKE_cstedc_work", info );
57 return info;
58 }
59 /* Query optimal working array(s) size if requested */
60 if( liwork == -1 || lrwork == -1 || lwork == -1 ) {
61 LAPACK_cstedc( &compz, &n, d, e, z, &ldz_t, work, &lwork, rwork,
62 &lrwork, iwork, &liwork, &info );
63 return (info < 0) ? (info - 1) : info;
64 }
65 /* Allocate memory for temporary array(s) */
66 if( LAPACKE_lsame( compz, 'i' ) || LAPACKE_lsame( compz, 'v' ) ) {
69 ldz_t * MAX(1,n) );
70 if( z_t == NULL ) {
72 goto exit_level_0;
73 }
74 }
75 /* Transpose input matrices */
76 if( LAPACKE_lsame( compz, 'v' ) ) {
77 LAPACKE_cge_trans( matrix_layout, n, n, z, ldz, z_t, ldz_t );
78 }
79 /* Call LAPACK function and adjust info */
80 LAPACK_cstedc( &compz, &n, d, e, z_t, &ldz_t, work, &lwork, rwork,
81 &lrwork, iwork, &liwork, &info );
82 if( info < 0 ) {
83 info = info - 1;
84 }
85 /* Transpose output matrices */
86 if( LAPACKE_lsame( compz, 'i' ) || LAPACKE_lsame( compz, 'v' ) ) {
87 LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, z_t, ldz_t, z, ldz );
88 }
89 /* Release memory and exit */
90 if( LAPACKE_lsame( compz, 'i' ) || LAPACKE_lsame( compz, 'v' ) ) {
91 LAPACKE_free( z_t );
92 }
93exit_level_0:
94 if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
95 LAPACKE_xerbla( "LAPACKE_cstedc_work", info );
96 }
97 } else {
98 info = -1;
99 LAPACKE_xerbla( "LAPACKE_cstedc_work", info );
100 }
101 return info;
102}
#define lapack_int
Definition lapack.h:83
#define LAPACK_cstedc(...)
Definition lapack.h:16137
#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