I used lapack.Dgeev with a previous version of Gonum to obtain the eigenvalues of a matrix. This evening I updated Gonum to version v0.15.1, published on Aug 16, 2024.
When I try to run/compile the code that was running OK before, I get an error at the line
lapack.Dgeev(jobvl, jobvr, n, b, lda, wr, wi, vl, ldvl, vr, lvdr)
The error is "undefined lapack.Dgeev."
What version of Go and Gonum are you using?
OS: Linux Ubuntu 22.04.4 LTS
Go version : 1.22.6
Go.mod
require (
github.com/gonum/blas v0.0.0-20181208220705-f22b278b28ac // indirect
github.com/gonum/floats v0.0.0-20181209220543-c233463c7e82 // indirect
github.com/gonum/internal v0.0.0-20181124074243-f884aa714029 // indirect
github.com/gonum/lapack v0.0.0-20181123203213-e4cdc5a0bff9 // indirect
github.com/gonum/matrix v0.0.0-20181209220409-c518dec07be9 // indirect
)
The Matrix I use to obtain the eigenvalues is
0.0167 0.4667 0.4667 0.0167 0.0167 0.0167
0.1667 0.1667 0.1667 0.1667 0.1667 0.1667
0.3167 0.3167 0.0167 0.0167 0.3167 0.0167
0.0167 0.0167 0.0167 0.0167 0.4667 0.4667
0.0167 0.0167 0.0167 0.4667 0.0167 0.4667
0.0167 0.0167 0.0167 0.9167 0.0167 0.0167
The code is:
func ComputePiVector(g *Graph) {
nRows, nCols := g.sMatrix.Dims()
n, lda, ldvl, lvdr := nRows, nRows, nRows, nRows
b := make([]float64, nRows*nCols)
// copy the transpose of g.sMatrix into b
k := 0
for i := 0; i < nRows; i++ {
for j := 0; j < nCols; j++ {
// a.Set(i, j, g.sMatrix.At(i, j)) // matrix a would not be a transpose.
b[k] = g.sMatrix.At(j, i)
k += 1
}
}
jobvl := lapack.Job('V')
jobvr := lapack.Job('V')
wi := make([]float64, nRows)
wr := make([]float64, nRows)
vl := make([]float64, nRows*nRows)
vr := make([]float64, nRows*nRows)
piVector := make([]float64, nRows)
lapack.Dgeev(jobvl, jobvr, n, b, lda, wr, wi, vl, ldvl, vr, lvdr) // error here
}