LAPACK inversion routine strangely mixes up all variables
问题 I'm programming in fortran and trying to use the DGETRI matrix inverter from the Lapack package: http://www.netlib.org/lapack/explore-html/df/da4/dgetri_8f.html But very strangely it seems to be messing with all my variables. In this very simple example, my matrix A initialised at the beginning of the program changes as DGETRI is applied, even though DGETRI doesn't involve A… Can anybody tell me what is going on? Thanks! PROGRAM solvelinear REAL(8), dimension(2,2) :: A,Ainv REAL(8)