Reference-LAPACK / lapack

LAPACK development repository
Other
1.48k stars 431 forks source link

[Documentation] Wrong description of array A in LAPACK ?tfsm routines #1041

Closed sergey-v-kuznetsov closed 4 weeks ago

sergey-v-kuznetsov commented 1 month ago

Description One of OneMKL customer failed to use DTFSM solver ( a triangular solver where one operand is a triangular matrix in RFP format) . The problem was reported on OneMKL forum:
https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/The-LAPACKE-dtfsm-function/m-p/1579919

Further investigation showed that the problem appears because of bugs in LAPACKE interfaces for this solver but the description of array A in Reference LAPACK ?dtfsm is also wrong.

So the current description of A (https://www.netlib.org/lapack/explore-html/dd/d79/group__tfsm_ga8f8cf589889048a6ab91d2d4f8653aac.html) is the following "A [in] A is DOUBLE PRECISION array, dimension (NT) NT = N*(N+1)/2. On entry, the matrix A in RFP Format. "

But debugging and comments in the file (see the comments on lines

361 IF( LSIDE ) THEN 362 363 SIDE = 'L' 364 365 A is M-by-M. 366 If M is odd, set NISODD = .TRUE., and M1 and M2. 367 If M is even, NISODD = .FALSE., and M. ")

in dtfsm.f shows that the size of A in the case side='L' must be NT = M*(M+1)/2

So the correct description of A must be the following: "A [in] A is DOUBLE PRECISION array, dimension (NT) NT = N(N+1)/2 if SIDE='R' and NT = M(M+1)/2 otherwise . On entry, the matrix A in RFP Format. "

Checklist

langou commented 1 month ago

It's great to hear that RFP format is being used! A PR to solve the issue would be more than welcomed.

sergey-v-kuznetsov commented 4 weeks ago

The issue was fixed in the PR https://github.com/Reference-LAPACK/lapack/pull/1042