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

Go to the source code of this file.

Functions

lapack_int LAPACKE_sstein_work (int matrix_layout, lapack_int n, const float *d, const float *e, lapack_int m, const float *w, const lapack_int *iblock, const lapack_int *isplit, float *z, lapack_int ldz, float *work, lapack_int *iwork, lapack_int *ifailv)

Function Documentation

◆ LAPACKE_sstein_work()

lapack_int LAPACKE_sstein_work ( int matrix_layout,
lapack_int n,
const float * d,
const float * e,
lapack_int m,
const float * w,
const lapack_int * iblock,
const lapack_int * isplit,
float * z,
lapack_int ldz,
float * work,
lapack_int * iwork,
lapack_int * ifailv )

Definition at line 35 of file lapacke_sstein_work.c.

41{
42 lapack_int info = 0;
43 if( matrix_layout == LAPACK_COL_MAJOR ) {
44 /* Call LAPACK function and adjust info */
45 LAPACK_sstein( &n, d, e, &m, w, iblock, isplit, z, &ldz, work, iwork,
46 ifailv, &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 float* z_t = NULL;
53 /* Check leading dimension(s) */
54 if( ldz < m ) {
55 info = -10;
56 LAPACKE_xerbla( "LAPACKE_sstein_work", info );
57 return info;
58 }
59 /* Allocate memory for temporary array(s) */
60 z_t = (float*)LAPACKE_malloc( sizeof(float) * ldz_t * MAX(1,m) );
61 if( z_t == NULL ) {
63 goto exit_level_0;
64 }
65 /* Call LAPACK function and adjust info */
66 LAPACK_sstein( &n, d, e, &m, w, iblock, isplit, z_t, &ldz_t, work,
67 iwork, ifailv, &info );
68 if( info < 0 ) {
69 info = info - 1;
70 }
71 /* Transpose output matrices */
72 LAPACKE_sge_trans( LAPACK_COL_MAJOR, n, m, z_t, ldz_t, z, ldz );
73 /* Release memory and exit */
74 LAPACKE_free( z_t );
75exit_level_0:
76 if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
77 LAPACKE_xerbla( "LAPACKE_sstein_work", info );
78 }
79 } else {
80 info = -1;
81 LAPACKE_xerbla( "LAPACKE_sstein_work", info );
82 }
83 return info;
84}
#define lapack_int
Definition lapack.h:83
#define LAPACK_sstein
Definition lapack.h:16321
#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
void LAPACKE_xerbla(const char *name, lapack_int info)
void LAPACKE_sge_trans(int matrix_layout, lapack_int m, lapack_int n, const float *in, lapack_int ldin, float *out, lapack_int ldout)
#define MAX(x, y)
n