Ambiguous lapacke interfaces to Cosine/Sine decomposition

Post here if you want to report a bug to the LAPACK team

Ambiguous lapacke interfaces to Cosine/Sine decomposition

Postby Victor_K » Thu Jul 09, 2015 2:17 am

Cosine/Sine decomposition subroutines in their APIs have special parameter TRANS which is treated as layout (column major or row major) of matrices in memory. For example,
SUBROUTINE DORBDB( TRANS, SIGNS, M, P, Q, X11, LDX11, X12, LDX12,
X21, LDX21, X22, LDX22, THETA, PHI, TAUP1,
TAUP2, TAUQ1, TAUQ2, WORK, LWORK, INFO )

LAPACKE interfaces have additional parameter matrix_order that play the same role:
lapack_int LAPACKE_dorbdb_work( int matrix_order, char trans, char signs,
lapack_int m, lapack_int p, lapack_int q,
double* x11, lapack_int ldx11, double* x12,
lapack_int ldx12, double* x21, lapack_int ldx21,
double* x22, lapack_int ldx22, double* theta,
double* phi, double* taup1, double* taup2,
double* tauq1, double* tauq2, double* work,
lapack_int lwork )

This mistake might mislead users - intuitive workaround (setting the same value for both parameters) would work not always because in a case of matrix_order=ROW_MAJOR LAPACKE_dorbdb_work will transpose the input data and call Fortran interface. The Fortran interface having trans='T' will transpose the data once again.

The issue relates to all 12 subroutines:
LAPACKE_?orbdb (2 routines)
LAPACKE_?unbdb (2 routines)
LAPACKE_?orcsd (2 routines)
LAPACKE_?uncsd (2 routines)
LAPACKE_?bbcsd (4 routines)
Victor_K
 
Posts: 5
Joined: Sat Nov 27, 2010 9:48 am

Re: Ambiguous lapacke interfaces to Cosine/Sine decompositio

Postby admin » Thu Jul 09, 2015 10:59 pm

Thank you Victor,
This bug has been listed as bug 130 in http://www.netlib.org/lapack/Errata/index2.html
Julie
admin
Site Admin
 
Posts: 609
Joined: Wed Dec 08, 2004 7:07 pm


Return to Bug report

Who is online

Users browsing this forum: No registered users and 5 guests