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

Go to the source code of this file.

Functions

lapack_int LAPACKE_strsen (int matrix_layout, char job, char compq, const lapack_logical *select, lapack_int n, float *t, lapack_int ldt, float *q, lapack_int ldq, float *wr, float *wi, lapack_int *m, float *s, float *sep)

Function Documentation

◆ LAPACKE_strsen()

lapack_int LAPACKE_strsen ( int matrix_layout,
char job,
char compq,
const lapack_logical * select,
lapack_int n,
float * t,
lapack_int ldt,
float * q,
lapack_int ldq,
float * wr,
float * wi,
lapack_int * m,
float * s,
float * sep )

Definition at line 35 of file lapacke_strsen.c.

39{
40 lapack_int info = 0;
41 lapack_int liwork = -1;
42 lapack_int lwork = -1;
43 lapack_int* iwork = NULL;
44 float* work = NULL;
45 lapack_int iwork_query;
46 float work_query;
47 if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
48 LAPACKE_xerbla( "LAPACKE_strsen", -1 );
49 return -1;
50 }
51#ifndef LAPACK_DISABLE_NAN_CHECK
52 if( LAPACKE_get_nancheck() ) {
53 /* Optionally check input matrices for NaNs */
54 if( LAPACKE_lsame( compq, 'v' ) ) {
55 if( LAPACKE_sge_nancheck( matrix_layout, n, n, q, ldq ) ) {
56 return -8;
57 }
58 }
59 if( LAPACKE_sge_nancheck( matrix_layout, n, n, t, ldt ) ) {
60 return -6;
61 }
62 }
63#endif
64 /* Query optimal working array(s) size */
65 info = LAPACKE_strsen_work( matrix_layout, job, compq, select, n, t, ldt, q,
66 ldq, wr, wi, m, s, sep, &work_query, lwork,
67 &iwork_query, liwork );
68 if( info != 0 ) {
69 goto exit_level_0;
70 }
71 liwork = iwork_query;
72 lwork = (lapack_int)work_query;
73 /* Allocate memory for work arrays */
74 if( LAPACKE_lsame( job, 'b' ) || LAPACKE_lsame( job, 'v' ) ) {
75 iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * liwork );
76 if( iwork == NULL ) {
78 goto exit_level_0;
79 }
80 }
81 work = (float*)LAPACKE_malloc( sizeof(float) * lwork );
82 if( work == NULL ) {
84 goto exit_level_1;
85 }
86 /* Call middle-level interface */
87 info = LAPACKE_strsen_work( matrix_layout, job, compq, select, n, t, ldt, q,
88 ldq, wr, wi, m, s, sep, work, lwork, iwork,
89 liwork );
90 /* Release memory and exit */
91 LAPACKE_free( work );
92exit_level_1:
93 if( LAPACKE_lsame( job, 'b' ) || LAPACKE_lsame( job, 'v' ) ) {
94 LAPACKE_free( iwork );
95 }
96exit_level_0:
97 if( info == LAPACK_WORK_MEMORY_ERROR ) {
98 LAPACKE_xerbla( "LAPACKE_strsen", info );
99 }
100 return info;
101}
#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_strsen_work(int matrix_layout, char job, char compq, const lapack_logical *select, lapack_int n, float *t, lapack_int ldt, float *q, lapack_int ldq, float *wr, float *wi, lapack_int *m, float *s, float *sep, float *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
lapack_logical LAPACKE_lsame(char ca, char cb)
void LAPACKE_xerbla(const char *name, lapack_int info)
lapack_logical LAPACKE_sge_nancheck(int matrix_layout, lapack_int m, lapack_int n, const float *a, lapack_int lda)
n