Skip to content
Snippets Groups Projects
Commit c085d887 authored by Max Kahnt's avatar Max Kahnt
Browse files

Fix truncation in new BlockGSSteps.

Squash fix.
parent b605bfa3
Branches
No related tags found
No related merge requests found
Pipeline #
......@@ -99,8 +99,7 @@ static constexpr double defaultCgTol = 1e-15;
template <class MBlock, class VBlock>
VBlock cg(const MBlock& m, VBlock r, size_t maxIter = defaultCgMaxIter,
double tol = defaultCgTol) {
VBlock x;
x = 0;
VBlock x(0);
VBlock p = r;
auto q = r;
auto rOldSquared = r * r;
......@@ -140,11 +139,11 @@ namespace LocalSolverFromLinearSolver {
*/
template <class LinearSolver>
auto truncate(LinearSolver&& linearSolver) {
return [&, localSolver = std::move(linearSolver) ](
return [linearSolver = std::move(linearSolver) ](
const auto& m, const auto& b, const auto& ignore) {
using Return = typename std::result_of<LinearSolver(decltype(m), decltype(b))>::type;
if (ignore.all())
return Return{0};
return Return(0);
if (ignore.none())
return linearSolver(m, b);
......
......@@ -140,7 +140,7 @@ struct GSTestSuite {
type, reg ? "regularized" : "");
test(&gsStep1, gsString1);
test(gsStep2Ptr.get(), gsString2);
diffTest(&gsStep1, gsString1, gsStep2Ptr.get(), gsString2, 1e-7);
diffTest(&gsStep1, gsString1, gsStep2Ptr.get(), gsString2, 1e-9);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment