-
Notifications
You must be signed in to change notification settings - Fork 466
Incorrect call to SLASET in schkst2stg.f #425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The same issue is present in TESTING/EIG/schksb2stg.f, around the line 673: 671 * using the SSBTRD. The fix is the same. |
Actually, the fix isn't entirely correct either, since SLASET is expecting a single character for the first argument, and you're instead passing in a string. |
As a matter of Fortran pedantry, Fortran association rules explicitly allow passing a longer string of the default character kind, where the dummy argument is a shorter default-kind character type. This situation is covered by the clause 4 of the section 12.5.2.4 of Fortran 2008, ISO/IEC 1539:2010. (you can find an unofficial, believed accurate, copy of the standard at https://wg5-fortran.org/f2008.html). Because 'Full' has type CHARACTER(LEN=4), it can be associated to a CHARACTER dummy argument in SLASET, and the code is standard-conformant. Not that it really matters in the grand scheme of things. |
Uh oh!
There was an error while loading. Please reload this page.
This appears to be related to #318 https://github.com/Reference-LAPACK/lapack/issues/318. The problem is not in SLASET but in the calling routine.
TESTING/EIG/schkst2stg.f contains the following code fragment (both in 3.9.0 and in the repo):
1000 * using the 1-stage.
1001 *
1002 CALL SLASET( 'Full', N, 1, ZERO, ZERO, SD, 1 )
1003 CALL SLASET( 'Full', N, 1, ZERO, ZERO, SE, 1 )
1004 CALL SLACPY( "U", N, N, A, LDA, V, LDU )
1005 LH = MAX(1, 4*N)
1006 LW = LWORK - LH
This code is incorrect, and causes a bounds violation in SLASET. The correct code is:
1002 CALL SLASET( 'Full', N, 1, ZERO, ZERO, SD, N )
1003 CALL SLASET( 'Full', N, 1, ZERO, ZERO, SE, N )
The text was updated successfully, but these errors were encountered: