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

Go to the source code of this file.

Functions

lapack_int LAPACKE_dbdsvdx (int matrix_layout, char uplo, char jobz, char range, lapack_int n, double *d, double *e, double vl, double vu, lapack_int il, lapack_int iu, lapack_int *ns, double *s, double *z, lapack_int ldz, lapack_int *superb)

Function Documentation

◆ LAPACKE_dbdsvdx()

lapack_int LAPACKE_dbdsvdx ( int matrix_layout,
char uplo,
char jobz,
char range,
lapack_int n,
double * d,
double * e,
double vl,
double vu,
lapack_int il,
lapack_int iu,
lapack_int * ns,
double * s,
double * z,
lapack_int ldz,
lapack_int * superb )

Definition at line 35 of file lapacke_dbdsvdx.c.

41{
42 lapack_int info = 0;
43 lapack_int lwork = MAX(14*n,1);
44 double* work = NULL;
45 lapack_int* iwork = NULL;
46 lapack_int i;
47 if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
48 LAPACKE_xerbla( "LAPACKE_dbdsvdx", -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_d_nancheck( n, d, 1 ) ) {
55 return -6;
56 }
57 if( LAPACKE_d_nancheck( n - 1, e, 1 ) ) {
58 return -7;
59 }
60 }
61#endif
62 /* Allocate memory for work arrays */
63 work = (double*)LAPACKE_malloc( sizeof(double) * lwork );
64 if( work == NULL ) {
66 goto exit_level_0;
67 }
68 iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * MAX(12*n,1) );
69 if( iwork == NULL ) {
71 goto exit_level_1;
72 }
73 /* Call middle-level interface */
74 info = LAPACKE_dbdsvdx_work( matrix_layout, uplo, jobz, range,
75 n, d, e, vl, vu, il, iu, ns, s, z,
76 ldz, work, iwork);
77 /* Backup significant data from working array(s) */
78 for( i=0; i<12*n-1; i++ ) {
79 superb[i] = iwork[i+1];
80 }
81 /* Release memory and exit */
82 LAPACKE_free( iwork );
83exit_level_1:
84 LAPACKE_free( work );
85exit_level_0:
86 if( info == LAPACK_WORK_MEMORY_ERROR ) {
87 LAPACKE_xerbla( "LAPACKE_dbdsvdx", info );
88 }
89 return info;
90}
#define lapack_int
Definition lapack.h:83
#define LAPACK_WORK_MEMORY_ERROR
Definition lapacke.h:55
lapack_int LAPACKE_dbdsvdx_work(int matrix_layout, char uplo, char jobz, char range, lapack_int n, double *d, double *e, double vl, double vu, lapack_int il, lapack_int iu, lapack_int *ns, double *s, double *z, lapack_int ldz, double *work, lapack_int *iwork)
#define LAPACK_COL_MAJOR
Definition lapacke.h:53
#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)
#define MAX(x, y)
n