Skip to content

Commit a588ea9

Browse files
authored
Merge pull request #5052 from martin-frbg/issue5051
Do not check LDVT in LAPACKE_?gesvd_work if VT is not used anyway
2 parents 21013fd + 8385e02 commit a588ea9

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

lapack-netlib/LAPACKE/src/lapacke_cgesvd_work.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,13 @@ lapack_int LAPACKE_cgesvd_work( int matrix_layout, char jobu, char jobvt,
7474
LAPACKE_xerbla( "LAPACKE_cgesvd_work", info );
7575
return info;
7676
}
77-
if( ldvt < ncols_vt ) {
77+
if( LAPACKE_lsame( jobvt, 'a' ) || LAPACKE_lsame( jobvt, 's' ) ) {
78+
if( ldvt < ncols_vt ) {
7879
info = -12;
7980
LAPACKE_xerbla( "LAPACKE_cgesvd_work", info );
8081
return info;
8182
}
83+
}
8284
/* Query optimal working array(s) size if requested */
8385
if( lwork == -1 ) {
8486
LAPACK_cgesvd( &jobu, &jobvt, &m, &n, a, &lda_t, s, u, &ldu_t, vt,

lapack-netlib/LAPACKE/src/lapacke_dgesvd_work.c

+2
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,13 @@ lapack_int LAPACKE_dgesvd_work( int matrix_layout, char jobu, char jobvt,
7272
LAPACKE_xerbla( "LAPACKE_dgesvd_work", info );
7373
return info;
7474
}
75+
if( LAPACKE_lsame( jobvt, 'a' ) || LAPACKE_lsame( jobvt, 's' ) ) {
7576
if( ldvt < ncols_vt ) {
7677
info = -12;
7778
LAPACKE_xerbla( "LAPACKE_dgesvd_work", info );
7879
return info;
7980
}
81+
}
8082
/* Query optimal working array(s) size if requested */
8183
if( lwork == -1 ) {
8284
LAPACK_dgesvd( &jobu, &jobvt, &m, &n, a, &lda_t, s, u, &ldu_t, vt,

lapack-netlib/LAPACKE/src/lapacke_sgesvd_work.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,13 @@ lapack_int LAPACKE_sgesvd_work( int matrix_layout, char jobu, char jobvt,
7272
LAPACKE_xerbla( "LAPACKE_sgesvd_work", info );
7373
return info;
7474
}
75-
if( ldvt < ncols_vt ) {
75+
if( LAPACKE_lsame( jobvt, 'a' ) || LAPACKE_lsame( jobvt, 's' ) ) {
76+
if( ldvt < ncols_vt ) {
7677
info = -12;
7778
LAPACKE_xerbla( "LAPACKE_sgesvd_work", info );
7879
return info;
7980
}
81+
}
8082
/* Query optimal working array(s) size if requested */
8183
if( lwork == -1 ) {
8284
LAPACK_sgesvd( &jobu, &jobvt, &m, &n, a, &lda_t, s, u, &ldu_t, vt,

lapack-netlib/LAPACKE/src/lapacke_zgesvd_work.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,13 @@ lapack_int LAPACKE_zgesvd_work( int matrix_layout, char jobu, char jobvt,
7474
LAPACKE_xerbla( "LAPACKE_zgesvd_work", info );
7575
return info;
7676
}
77-
if( ldvt < ncols_vt ) {
77+
if( LAPACKE_lsame( jobvt, 'a' ) || LAPACKE_lsame( jobvt, 's' ) ) {
78+
if( ldvt < ncols_vt ) {
7879
info = -12;
7980
LAPACKE_xerbla( "LAPACKE_zgesvd_work", info );
8081
return info;
8182
}
83+
}
8284
/* Query optimal working array(s) size if requested */
8385
if( lwork == -1 ) {
8486
LAPACK_zgesvd( &jobu, &jobvt, &m, &n, a, &lda_t, s, u, &ldu_t, vt,

0 commit comments

Comments
 (0)