Skip to content

TESTING/LIN: align ISEED declarations with documented dimension in four test routines#1197

Merged
langou merged 1 commit intoReference-LAPACK:masterfrom
nakatamaho:master
Mar 7, 2026
Merged

TESTING/LIN: align ISEED declarations with documented dimension in four test routines#1197
langou merged 1 commit intoReference-LAPACK:masterfrom
nakatamaho:master

Conversation

@nakatamaho
Copy link
Contributor

This PR updates four TESTING/LIN routines:

  • clatsp
  • clatsy
  • zlatsp
  • zlatsy

In all four files, the parameter documentation says that ISEED is an
INTEGER array of dimension (4), but the actual dummy argument
declaration is currently ISEED(*).

These routines pass ISEED to CLARND/ZLARND, whose interfaces use
ISEED(4) and whose documentation states that the fourth element must
be odd.

This patch changes both the commented argument declarations and the
actual dummy argument declarations from ISEED(*) to ISEED(4) so
that the routine declarations match the documented contract and the
callee interfaces.

No functional change is intended.

…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.
@langou
Copy link
Contributor

langou commented Mar 7, 2026

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!

@langou langou merged commit 58ba032 into Reference-LAPACK:master Mar 7, 2026
12 checks passed
@nakatamaho
Copy link
Contributor Author

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.

@langou
Copy link
Contributor

langou commented Mar 7, 2026

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants