Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix segmentation fault in nlEigenSolve_ARPACK #167

Merged
merged 4 commits into from
Jul 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/lib/geogram/NL/nl_arpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ void nlEigenSolve_ARPACK(void) {

/********** Main ARPACK loop ***********/

int nev_0 = nev; /* save the requested number of eigenvalues in case ARPack modifies the value of nev */
if(nlCurrentContext->verbose) {
if(symmetric) {
nl_printf("calling dsaupd()\n");
Expand Down Expand Up @@ -513,7 +514,8 @@ void nlEigenSolve_ARPACK(void) {

/********** Copy to NL context *********/

for(k=0; k<nev; ++k) {
nev_0 = min(nev_0, nev); /* enforce that no more than the requested number of eigenvalues are copied */
for(k=0; k<nev_0; ++k) {
kk = sorted[k];
nlCurrentContext->eigen_value[k] = d[kk];
for(i=0; i<(int)nlCurrentContext->nb_variables; ++i) {
Expand Down