TESTING/LIN: align ISEED declarations with documented dimension in four test routines#1197
Conversation
…atsy The four TESTING/LIN routines currently document ISEED as an INTEGER array of dimension (4), but their dummy argument declarations use ISEED(*). All four routines pass ISEED to CLARND or ZLARND, whose interfaces require ISEED(4) and document that the fourth element must be odd. Replace the assumed-size declaration with an explicit size of 4 in both the commented argument declarations and the actual dummy argument declarations, so that the source matches the documented contract and the callee interfaces. No functional change is intended.
|
A comment. If, for example, an array is LDA-by-N, then LAPACK will declare it as DOUBLE PRECISION A( LDA, * )LAPACK will not declare it as DOUBLE PRECISION A( LDA, N )Similarly, if ISEED is a array of size 4, then LAPACK will declare it as INTEGER ISEED( * )and not INTEGER ISEED( 4 )Both ways of doing it are correct in FORTRAN, but I agree that the latter is better software practice. (Albeit not followed by LAPACK). All in all, all good with me. Thanks! |
|
Thanks, I agree. Both forms are valid Fortran, and I did not mean to imply that LAPACK’s (*) style is wrong. My comment was only from the downstream translation side: in our FABLE-based Fortran-to-C++ flow, explicit extents like ISEED(4) preserve fixed-size array information more reliably than ISEED(*). We first ran into this in generated WRITE/I/O handling, where missing extent information can lead to overly generic treatment on the C++ side. So I fully agree this is not a LAPACK correctness issue — just a tooling convenience on our side. |
|
Note: I would be in favor to propage these types of change more broadly. But this needs to be done with care. I appreciate the effort and contribution for this specific four routines. Thanks! |
This PR updates four TESTING/LIN routines:
clatspclatsyzlatspzlatsyIn all four files, the parameter documentation says that
ISEEDis anINTEGERarray of dimension(4), but the actual dummy argumentdeclaration is currently
ISEED(*).These routines pass
ISEEDtoCLARND/ZLARND, whose interfaces useISEED(4)and whose documentation states that the fourth element mustbe odd.
This patch changes both the commented argument declarations and the
actual dummy argument declarations from
ISEED(*)toISEED(4)sothat the routine declarations match the documented contract and the
callee interfaces.
No functional change is intended.