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

LanczosVectors: memory ownership bug fix for swap

parent ea068573
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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);
	}

+1 −0
Original line number Diff line number Diff line
@@ -274,6 +274,7 @@ public:
		if (!ptr)
			throw RuntimeError("LanczosCore::lanczosVectors() called but no data stored\n");

		lanczosVectors_.needsDelete(false);
		ptr->swap(V);
	}

+5 −0
Original line number Diff line number Diff line
@@ -237,6 +237,11 @@ public:
		reorthoIfNecessary(V2, iter);
	}

	void needsDelete(bool b)
	{
		needsDelete_ = b;
	}

private:

	void reorthoIfNecessary(VectorType& V2, SizeType iter) const