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

LAPACKE_?trexc_work: ldq must be always >= n #26

Closed
vladimir-ch opened this issue Aug 3, 2016 · 1 comment
Closed

LAPACKE_?trexc_work: ldq must be always >= n #26

vladimir-ch opened this issue Aug 3, 2016 · 1 comment

Comments

@vladimir-ch
Copy link
Contributor

In row-major case, LAPACKE_?trexc_work requires ldq >= n even when compq is not 'v', that is, when the matrix Q is not referenced. The ldq parameter is always used conditionally only if compq is 'v', so the ldq >= n check should be also done only in that case.

In ?TREXC the corresponding check is:

IF( LDQ.LT.1 .OR. ( WANTQ .AND. LDQ.LT.MAX( 1, N ) ) ) THEN
   INFO = -6
@langou
Copy link
Contributor

langou commented Aug 4, 2016

Thanks for spotting this. What about on line 54 of LAPACKE_dtrexc_work.c:

        if(( ldq < n )&&(LAPACKE_lsame( compq, 'v' ))) {

Note: LAPACKE does not check for ( ldq < 1 ) if the array is not referenced. This is fine. This is not consistent with LAPACK. LAPACK (Fortran) does check for ( ldq < 1 ).

Do you want to submit a pull request? And if you have a better solution for changing the check, please go ahead.

Cheers,
Julien.

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

No branches or pull requests

3 participants