Skip to content

Commit

Permalink
Do not check LDVT when VT is not going to be referenced
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-frbg authored Jan 6, 2025
1 parent 74be676 commit 8385e02
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lapack-netlib/LAPACKE/src/lapacke_cgesvd_work.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@ lapack_int LAPACKE_cgesvd_work( int matrix_layout, char jobu, char jobvt,
LAPACKE_xerbla( "LAPACKE_cgesvd_work", info );
return info;
}
if( ldvt < ncols_vt ) {
if( LAPACKE_lsame( jobvt, 'a' ) || LAPACKE_lsame( jobvt, 's' ) ) {
if( ldvt < ncols_vt ) {
info = -12;
LAPACKE_xerbla( "LAPACKE_cgesvd_work", info );
return info;
}
}
/* Query optimal working array(s) size if requested */
if( lwork == -1 ) {
LAPACK_cgesvd( &jobu, &jobvt, &m, &n, a, &lda_t, s, u, &ldu_t, vt,
Expand Down
2 changes: 2 additions & 0 deletions lapack-netlib/LAPACKE/src/lapacke_dgesvd_work.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,13 @@ lapack_int LAPACKE_dgesvd_work( int matrix_layout, char jobu, char jobvt,
LAPACKE_xerbla( "LAPACKE_dgesvd_work", info );
return info;
}
if( LAPACKE_lsame( jobvt, 'a' ) || LAPACKE_lsame( jobvt, 's' ) ) {
if( ldvt < ncols_vt ) {
info = -12;
LAPACKE_xerbla( "LAPACKE_dgesvd_work", info );
return info;
}
}
/* Query optimal working array(s) size if requested */
if( lwork == -1 ) {
LAPACK_dgesvd( &jobu, &jobvt, &m, &n, a, &lda_t, s, u, &ldu_t, vt,
Expand Down
4 changes: 3 additions & 1 deletion lapack-netlib/LAPACKE/src/lapacke_sgesvd_work.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,13 @@ lapack_int LAPACKE_sgesvd_work( int matrix_layout, char jobu, char jobvt,
LAPACKE_xerbla( "LAPACKE_sgesvd_work", info );
return info;
}
if( ldvt < ncols_vt ) {
if( LAPACKE_lsame( jobvt, 'a' ) || LAPACKE_lsame( jobvt, 's' ) ) {
if( ldvt < ncols_vt ) {
info = -12;
LAPACKE_xerbla( "LAPACKE_sgesvd_work", info );
return info;
}
}
/* Query optimal working array(s) size if requested */
if( lwork == -1 ) {
LAPACK_sgesvd( &jobu, &jobvt, &m, &n, a, &lda_t, s, u, &ldu_t, vt,
Expand Down
4 changes: 3 additions & 1 deletion lapack-netlib/LAPACKE/src/lapacke_zgesvd_work.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@ lapack_int LAPACKE_zgesvd_work( int matrix_layout, char jobu, char jobvt,
LAPACKE_xerbla( "LAPACKE_zgesvd_work", info );
return info;
}
if( ldvt < ncols_vt ) {
if( LAPACKE_lsame( jobvt, 'a' ) || LAPACKE_lsame( jobvt, 's' ) ) {
if( ldvt < ncols_vt ) {
info = -12;
LAPACKE_xerbla( "LAPACKE_zgesvd_work", info );
return info;
}
}
/* Query optimal working array(s) size if requested */
if( lwork == -1 ) {
LAPACK_zgesvd( &jobu, &jobvt, &m, &n, a, &lda_t, s, u, &ldu_t, vt,
Expand Down

0 comments on commit 8385e02

Please sign in to comment.