Skip to content

add NaN checks for input matrix A in GEEV, return error if NaN are in matrix A, NaNs in input are detected with LANGE (needed for scaling)#1136

Merged
langou merged 2 commits intoReference-LAPACK:masterfrom
langou:try__fix_1128__adding_part_of_angsch_suggestion
Mar 24, 2026
Merged

add NaN checks for input matrix A in GEEV, return error if NaN are in matrix A, NaNs in input are detected with LANGE (needed for scaling)#1136
langou merged 2 commits intoReference-LAPACK:masterfrom
langou:try__fix_1128__adding_part_of_angsch_suggestion

Conversation

@langou
Copy link
Copy Markdown
Contributor

@langou langou commented Jun 15, 2025

This adds a NaN check on the entries of the input matrix A in GEEV,

GEEV would now return error INFO = -4 if there are NaNs in matrix A in input.

NaNs in input are detected with LANGE. Since LANGE is called for scaling anyway, there is no extra cost.

This follows @angsch's suggestion in issue #1128. This uses DISNAN instead of DISFINITE (as initially suggested). I am not opposed to create a DISFINITE function and use it, but I think it needs more decisions and consensus.

See as well PR#471 for a "similar" behavior.

@langou langou changed the title Try adding parts of @angsch's suggestion add NaN checks for input matrix A in GEEV, return error if NaN are in matrix A, NaNs in input are detected with LANGE (needed for scaling) Jun 15, 2025
Copy link
Copy Markdown

@TiborGY TiborGY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it would be worth noting in the documentation that these subroutines check for NaNs in A.
E.g. something like this:

*> \param[in,out] A
*> \verbatim
*>          A is DOUBLE PRECISION array, dimension (LDA,N)
*>          On entry, the N-by-N matrix A, which must not contain any NaN elements.
*>          On exit, A has been overwritten.
*>          Note: A is checked for NaNs on entry, and an error exit is performed if any are found.
*> \endverbatim

$ LDVR,
$ WORK, LWORK, RWORK, INFO )
implicit none
IMPLICIT NONE
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diff has a lot of formatting changes. Perhaps it would be a good idea to split this PR into a "meaningful changes" PR and a pure formatting changes PR?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback. In a perfect world, I agree with your comment. Let us merge and I'll try to be better next time.

@langou langou merged commit c806564 into Reference-LAPACK:master Mar 24, 2026
12 checks passed
@langou langou deleted the try__fix_1128__adding_part_of_angsch_suggestion branch March 24, 2026 20:40
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.

3 participants