lapack icon indicating copy to clipboard operation
lapack copied to clipboard

Provide explicit interfaces for external functions passed as arguments

Open foxtran opened this issue 1 month ago • 2 comments

Some routines such as ?GEES, get functions as arguments. However, these arguments are declared just like external, so compilers can not actually check that passed arguments has proper types. It would be nice, if not only documentation will specify proper definition of such functions.

Actually, it is needed for generating safe Fortran 90 interfaces from the source code.

Full list of affected subroutines:

cgees
cgeesx
cgges3
cgges
cggesx
dgees
dgeesx
dgges3
dgges
dggesx
sgees
sgeesx
sgges3
sgges
sggesx
zgees
zgeesx
zgges3
zgges
zggesx

foxtran avatar Nov 30 '25 00:11 foxtran

I agree. It would be most useful if someone can provide an example demonstrating how they would do this in a clean way. Maybe through a PR. The passing of "function as argument" is limited in use in LAPACK. If I am being correct, this only appears in the five Schur reordering subroutines (GEES, GEESX, GGES, GGES3, GGESX).

langou avatar Nov 30 '25 07:11 langou

I can... Give me a couple hours.

See #1173

foxtran avatar Nov 30 '25 08:11 foxtran