Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index out of bounds error in MB04DD, line 327 #21

Open
mccullerlp opened this issue Dec 29, 2024 · 0 comments
Open

Index out of bounds error in MB04DD, line 327 #21

mccullerlp opened this issue Dec 29, 2024 · 0 comments

Comments

@mccullerlp
Copy link

I've been using Slycot wrappers with slicot compiled using -fcheck=all to debug some occasional issues, and the wrapper itself.

As soon as bounds checking was enabled I was getting MB04DD flagged with an index out of bounds error. It was being called from the Linf norm AB13DD.

            DO 170 I = ILO, N
C
C              Compute 1-norm of row and column I without diagonal
C              elements.
C
               R = DASUM( I-ILO, A(I,ILO), LDA ) +
     $             DASUM( N-I,   A(I,I+1), LDA ) +
     $             DASUM( I-ILO, QG(ILO,I+1), 1 ) +
     $             DASUM( N-I,   QG(I,I+2), LDQG )
               C = DASUM( I-ILO, A(ILO,I), 1 ) +
     $             DASUM( N-I,   A(I+1,I), 1 ) +
     $             DASUM( I-ILO, QG(I,ILO), LDQG ) +
     $             DASUM( N-I,   QG(I+1,I), 1 )
               QII = ABS( QG(I,I) )
               GII = ABS( QG(I,I+1) )
C
...

You can see in the above that there are many references to I+1 indices. The fix is to make the loop range from 1=ILO,N-1. This seems to fix the issue.

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

No branches or pull requests

1 participant