Skip to content

SRC: detect all-zero Y columns in GEDMD scaling#1243

Open
nakatamaho wants to merge 1 commit intoReference-LAPACK:masterfrom
nakatamaho:fix/gedmd-sccoly-zero-columns
Open

SRC: detect all-zero Y columns in GEDMD scaling#1243
nakatamaho wants to merge 1 commit intoReference-LAPACK:masterfrom
nakatamaho:fix/gedmd-sccoly-zero-columns

Conversation

@nakatamaho
Copy link
Copy Markdown
Contributor

This PR adds the missing all-zero column check to the JOBS='Y'
scaling path in the GEDMD routines.

In the existing implementation, the JOBS='S' / JOBS='C' path
normalizes the columns of X and counts zero columns while doing so.
If all columns of X are zero, the routine returns early with
INFO = -8, since X is the 8th argument.

The corresponding JOBS='Y' path normalizes the columns of Y, but it
did not count zero columns of Y and therefore did not return early
when all columns of Y were zero. This made the handling of the
SCCOLY path asymmetric with the existing SCCOLX path.

This PR updates the JOBS='Y' path to:

  • initialize the zero-column counter before scanning Y
  • increment the counter for each zero column of Y
  • return early when all columns of Y are zero
  • use INFO = -10, matching Y as the 10th argument
  • document this condition in the routine header comments

Updated routines:

  • SRC/sgedmd.f90
  • SRC/dgedmd.f90
  • SRC/cgedmd.f90
  • SRC/zgedmd.f90

This is intended to make the input validation and scaling behavior of
the JOBS='Y' path consistent with the existing JOBS='S' / JOBS='C'
path. It also avoids continuing the computation after detecting that
the requested Y-based column scaling cannot be performed because all
columns of Y are zero.

Add the missing all-zero column check to the JOBS='Y' scaling path in the GEDMD routines. The existing JOBS='S'/'C' path detects when all columns of X are zero and returns INFO=-8, but the corresponding JOBS='Y' path did not count zero columns of Y or return early when all Y columns are zero.

Return INFO=-10 for the all-zero Y case, matching Y as the 10th argument and the existing SCCOLY error handling. Update the routine documentation to describe this condition.
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