LAPACK  3.10.1
LAPACK: Linear Algebra PACKage

◆ LAPACKE_sggsvd3()

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

Definition at line 35 of file lapacke_sggsvd3.c.

42 {
43  lapack_int info = 0;
44  float* work = NULL;
45  lapack_int lwork = -1;
46  float work_query;
47  if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
48  LAPACKE_xerbla( "LAPACKE_sggsvd3", -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_sge_nancheck( matrix_layout, m, n, a, lda ) ) {
55  return -10;
56  }
57  if( LAPACKE_sge_nancheck( matrix_layout, p, n, b, ldb ) ) {
58  return -12;
59  }
60  }
61 #endif
62  /* Query optimal working array(s) size if requested */
63  info = LAPACKE_sggsvd3_work( matrix_layout, jobu, jobv, jobq, m, n, p,
64  k, l, a, lda, b, ldb, alpha, beta, u, ldu,
65  v, ldv, q, ldq, &work_query, lwork, iwork );
66  if( info != 0 )
67  goto exit_level_0;
68  lwork = work_query;
69  /* Allocate memory for working array(s) */
70  work = (float*)LAPACKE_malloc( sizeof(float) * lwork );
71  if( work == NULL ) {
73  goto exit_level_0;
74  }
75  /* Call middle-level interface */
76  info = LAPACKE_sggsvd3_work( matrix_layout, jobu, jobv, jobq, m, n, p, k, l,
77  a, lda, b, ldb, alpha, beta, u, ldu, v, ldv, q,
78  ldq, work, lwork, iwork );
79  /* Release memory and exit */
80  LAPACKE_free( work );
81 exit_level_0:
82  if( info == LAPACK_WORK_MEMORY_ERROR ) {
83  LAPACKE_xerbla( "LAPACKE_sggsvd3", info );
84  }
85  return info;
86 }
#define lapack_int
Definition: lapack.h:83
#define LAPACK_WORK_MEMORY_ERROR
Definition: lapacke.h:55
#define LAPACK_COL_MAJOR
Definition: lapacke.h:53
#define LAPACKE_free(p)
Definition: lapacke.h:46
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:52
lapack_int LAPACKE_sggsvd3_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, float *a, lapack_int lda, float *b, lapack_int ldb, float *alpha, float *beta, float *u, lapack_int ldu, float *v, lapack_int ldv, float *q, lapack_int ldq, float *work, lapack_int lwork, 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)
lapack_logical LAPACKE_sge_nancheck(int matrix_layout, lapack_int m, lapack_int n, const float *a, lapack_int lda)
Here is the call graph for this function: