Commit 200784b7 authored by Alvarez, Gonzalo's avatar Alvarez, Gonzalo
Browse files

LanczosVectors: memory ownership bug fix for swap

parent ea068573
......@@ -240,6 +240,7 @@ public:
DenseMatrixType* ptr = lanczosVectors_.data();
if (!ptr)
err("LanczosSolver::lanczosVectors() called but no data stored\n");
lanczosVectors_.needsDelete(false);
return ptr->swap(V);
}
......
......@@ -274,6 +274,7 @@ public:
if (!ptr)
throw RuntimeError("LanczosCore::lanczosVectors() called but no data stored\n");
lanczosVectors_.needsDelete(false);
ptr->swap(V);
}
......
......@@ -237,6 +237,11 @@ public:
reorthoIfNecessary(V2, iter);
}
void needsDelete(bool b)
{
needsDelete_ = b;
}
private:
void reorthoIfNecessary(VectorType& V2, SizeType iter) const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment