Community
cancel
Showing results for 
Search instead for 
Did you mean: 
55 Views

Error in one LAPACK example

Hi, 

I've located an error in one of your FORTRAN 77 interface to the LAPACK Single Value Decomposition routines (DGESVD). This is located in https://software.intel.com/sites/products/documentation/doclib/mkl_sa/11/mkl_lapack_examples/dgesvd.htm 

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

(1)

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

(2)

Asvd = A

 

 

 

Best wishes,

Mohamed Ali Al-Badri

0 Kudos
1 Reply
mecej4
Black Belt
55 Views

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 http://www.netlib.org/lapack/explore-html/d1/d7e/group__double_g_esing_ga84fdf22a62b12ff364621e4713ce02f2.html (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.

Reply