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

Go to the source code of this file.

Functions

lapack_int LAPACKE_cggsvd3 (int matrix_layout, char jobu, char jobv, char jobq, lapack_int m, lapack_int n, lapack_int p, lapack_int *k, lapack_int *l, lapack_complex_float *a, lapack_int lda, lapack_complex_float *b, lapack_int ldb, float *alpha, float *beta, lapack_complex_float *u, lapack_int ldu, lapack_complex_float *v, lapack_int ldv, lapack_complex_float *q, lapack_int ldq, lapack_int *iwork)

Function Documentation

◆ LAPACKE_cggsvd3()

lapack_int LAPACKE_cggsvd3 ( int matrix_layout,
char jobu,
char jobv,
char jobq,
lapack_int m,
lapack_int n,
lapack_int p,
lapack_int * k,
lapack_int * l,
lapack_complex_float * a,
lapack_int lda,
lapack_complex_float * b,
lapack_int ldb,
float * alpha,
float * beta,
lapack_complex_float * u,
lapack_int ldu,
lapack_complex_float * v,
lapack_int ldv,
lapack_complex_float * q,
lapack_int ldq,
lapack_int * iwork )

Definition at line 35 of file lapacke_cggsvd3.c.

44{
45 lapack_int info = 0;
46 float* rwork = NULL;
47 lapack_int lwork = -1;
48 lapack_complex_float* work = NULL;
49 lapack_complex_float work_query;
50 if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
51 LAPACKE_xerbla( "LAPACKE_cggsvd3", -1 );
52 return -1;
53 }
54#ifndef LAPACK_DISABLE_NAN_CHECK
55 if( LAPACKE_get_nancheck() ) {
56 /* Optionally check input matrices for NaNs */
57 if( LAPACKE_cge_nancheck( matrix_layout, m, n, a, lda ) ) {
58 return -10;
59 }
60 if( LAPACKE_cge_nancheck( matrix_layout, p, n, b, ldb ) ) {
61 return -12;
62 }
63 }
64#endif
65 /* Query optimal size for working array */
66 info = LAPACKE_cggsvd3_work( matrix_layout, jobu, jobv, jobq, m, n, p, k, l,
67 a, lda, b, ldb, alpha, beta, u, ldu, v, ldv, q,
68 ldq, &work_query, lwork, rwork, iwork );
69 if( info != 0 )
70 goto exit_level_0;
71 lwork = LAPACK_C2INT( work_query );
72 /* Allocate memory for working array(s) */
73 rwork = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,2*n) );
74 if( rwork == NULL ) {
76 goto exit_level_0;
77 }
78 work = (lapack_complex_float*)
79 LAPACKE_malloc( sizeof(lapack_complex_float) * lwork );
80 if( work == NULL ) {
82 goto exit_level_1;
83 }
84 /* Call middle-level interface */
85 info = LAPACKE_cggsvd3_work( matrix_layout, jobu, jobv, jobq, m, n, p, k, l,
86 a, lda, b, ldb, alpha, beta, u, ldu, v, ldv, q,
87 ldq, work, lwork, rwork, iwork );
88 /* Release memory and exit */
89 LAPACKE_free( work );
90exit_level_1:
91 LAPACKE_free( rwork );
92exit_level_0:
93 if( info == LAPACK_WORK_MEMORY_ERROR ) {
94 LAPACKE_xerbla( "LAPACKE_cggsvd3", info );
95 }
96 return info;
97}
#define alpha
Definition eval.h:35
#define lapack_int
Definition lapack.h:83
#define lapack_complex_float
Definition lapack.h:45
#define LAPACK_WORK_MEMORY_ERROR
Definition lapacke.h:55
#define LAPACK_COL_MAJOR
Definition lapacke.h:53
#define LAPACK_C2INT(x)
Definition lapacke.h:49
#define LAPACKE_free(p)
Definition lapacke.h:46
#define LAPACK_ROW_MAJOR
Definition lapacke.h:52
lapack_int LAPACKE_cggsvd3_work(int matrix_layout, char jobu, char jobv, char jobq, lapack_int m, lapack_int n, lapack_int p, lapack_int *k, lapack_int *l, lapack_complex_float *a, lapack_int lda, lapack_complex_float *b, lapack_int ldb, float *alpha, float *beta, lapack_complex_float *u, lapack_int ldu, lapack_complex_float *v, lapack_int ldv, lapack_complex_float *q, lapack_int ldq, lapack_complex_float *work, lapack_int lwork, float *rwork, lapack_int *iwork)
int LAPACKE_get_nancheck(void)
#define LAPACKE_malloc(size)
Definition lapacke.h:43
void LAPACKE_xerbla(const char *name, lapack_int info)
#define MAX(x, y)
lapack_logical LAPACKE_cge_nancheck(int matrix_layout, lapack_int m, lapack_int n, const lapack_complex_float *a, lapack_int lda)
n