Closed abdullahhyder closed 1 year ago
I quickly checked the code and
double work[N];
int lwork = N*16;
looks wrong to me. Did you check info
in the output of dggev_()
? You call dggev_()
with lwork=-1
so that you have the optimal workspace size, or even use LAPACKE and then you don't need to worry about the workspace.
I have just verified and the code works if we replace double work[N];
by double work[N*16];
.
It is advisable to perform a workspace query to obtain the workspace size instead of setting it like you did.
Please, reopen if this actually does not solve your problem.
Hi. I sent this message in the LAPACK Google group. I am repeating my question here because I am unsure if the Google group is still in use. Thank you.
I have been trying to use dggev to get the eigenvectors of a generalized eigenvalue problem. The eigenvalues returned are correct, but with everything I have tried, the eigenvectors returned are incorrect, and the transpose of the matrix of eigenvectors is also incorrect.
Below is a simple example of how I am calling/using the dggev function in C++:
The output from this code is:
As you can see, the returned eigenvectors of these identity matrices include a vector of zeros instead of the <0, 1, 0> vector.
I have tried using "#include <Accelerate/Accelerate.h>" instead of "extern" to import the dggev method, but the result is the same. Any help would be greatly appreciated!
ScaLAPACK version: 2.1.0 (installed using macports) g++ version: g++ (MacPorts gcc12 12.3.0_0+stdlib_flag) 12.3.0