From a51666e16b0b9711e32766260b322bf6f70f3e17 Mon Sep 17 00:00:00 2001 From: Pieter Pas Date: Thu, 28 Mar 2024 17:35:02 +0100 Subject: [PATCH] Fix norm computation eps_pri --- QPALM/src/iteration.c | 2 +- QPALM/src/termination.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/QPALM/src/iteration.c b/QPALM/src/iteration.c index 515b4f8c..9524606e 100644 --- a/QPALM/src/iteration.c +++ b/QPALM/src/iteration.c @@ -218,7 +218,7 @@ void update_proximal_point_and_penalty(QPALMWorkspace *work, solver_common *c, c * The infinity norm of that vector is then equal to the maximum of both norms. */ vec_ew_prod(work->scaling->Einv, work->Ax, work->temp_2m, m); vec_ew_prod(work->scaling->Einv, work->z, work->temp_2m + m, m); - eps_k = (*eps_k_abs) + (*eps_k_rel)*vec_norm_inf(work->temp_2m, m); + eps_k = (*eps_k_abs) + (*eps_k_rel)*vec_norm_inf(work->temp_2m, 2 * m); } else { diff --git a/QPALM/src/termination.c b/QPALM/src/termination.c index d28ba64b..3362a38e 100644 --- a/QPALM/src/termination.c +++ b/QPALM/src/termination.c @@ -72,7 +72,7 @@ void calculate_primal_tolerance(QPALMWorkspace *work) { * of the infinity norms of Einv*Ax and Einv*z.*/ vec_ew_prod(work->scaling->Einv, work->Ax, work->temp_2m, m); vec_ew_prod(work->scaling->Einv, work->z, work->temp_2m + m, m); - work->eps_pri = work->settings->eps_abs + work->settings->eps_rel*vec_norm_inf(work->temp_2m, m); + work->eps_pri = work->settings->eps_abs + work->settings->eps_rel*vec_norm_inf(work->temp_2m, 2 * m); } else { work->eps_pri = work->settings->eps_abs + work->settings->eps_rel*c_max( vec_norm_inf(work->Ax, m),