Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Error in one LAPACK example



I've located an error in one of your FORTRAN 77 interface to the LAPACK Single Value Decomposition routines (DGESVD). This is located in 

The following two lines must be added. (1) in variable declaration and (2) just before calling DGESVD. 


DOUBLE PRECISION Asvd( size(A,1), size(A,2) )


Asvd = A




Best wishes,

Mohamed Ali Al-Badri

0 Kudos
1 Reply
Honored Contributor III

The modifications that you suggest are needed only if the original matrix A has to be preserved for some other use after the call to ?GESVD(). The description of the calling sequence at (or in the MKL documentation) states quite clearly that A may be overwritten, and in what way. 

At the time that the Lapack library was designed and implemented, computer memory was a valuable resource and programs were written in such a way that the consumption of scratch space was kept low. From that perspective, what you call an "error" is, instead, a "feature", and you should not expect any corrections to be made to either the Lapack codes or to the examples. Once in a while, a new version of a Lapack routine may be added when a new algorithm is created or a much needed additional capability is to be provided, but changing an existing routine would break too many existing codes that depend on the stability of the Lapack interfaces.

0 Kudos