From 5c0024f3f2ebde012635ebe0a5379e875bd51a09 Mon Sep 17 00:00:00 2001 From: Francois Coppens Date: Fri, 27 Jan 2023 11:13:57 +0100 Subject: [PATCH] Return QMCKL_FAILURE if return code from qmckl_slagel_splitting equals QMCKL_FAILURE --- org/qmckl_sherman_morrison_woodbury.org | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/org/qmckl_sherman_morrison_woodbury.org b/org/qmckl_sherman_morrison_woodbury.org index 769a1b9..54b8b98 100644 --- a/org/qmckl_sherman_morrison_woodbury.org +++ b/org/qmckl_sherman_morrison_woodbury.org @@ -1006,14 +1006,16 @@ qmckl_exit_code qmckl_sherman_morrison_splitting(const qmckl_context context, uint64_t later_index[N_updates]; uint64_t later = 0; - (void) qmckl_slagel_splitting( - LDS, Dim, N_updates, Updates, Updates_index, breakdown, Slater_inv, - later_updates, later_index, &later, determinant); + qmckl_exit_code rc = qmckl_slagel_splitting( + LDS, Dim, N_updates, Updates, Updates_index, breakdown, Slater_inv, + later_updates, later_index, &later, determinant); + if (rc != QMCKL_SUCCESS) return QMCKL_FAILURE; if (later > 0) { - (void) qmckl_sherman_morrison_splitting( - context, LDS, Dim, later, later_updates, later_index, breakdown, - Slater_inv, determinant); + qmckl_exit_code rc = qmckl_sherman_morrison_splitting( + context, LDS, Dim, later, later_updates, later_index, breakdown, + Slater_inv, determinant); + if (rc != QMCKL_SUCCESS) return QMCKL_FAILURE; } return QMCKL_SUCCESS; @@ -1251,17 +1253,19 @@ qmckl_exit_code qmckl_sherman_morrison_smw32s(const qmckl_context context, const double* Updates_1block = &Updates[n_of_3blocks * length_3block]; const uint64_t* Updates_index_1block = &Updates_index[3 * n_of_3blocks]; uint64_t l = 0; - (void) qmckl_slagel_splitting( + qmckl_exit_code rc = qmckl_slagel_splitting( LDS, Dim, 1, Updates_1block, Updates_index_1block, breakdown, Slater_inv, later_updates + (LDS * later), later_index + later, &l, determinant); + if (rc != QMCKL_SUCCESS) return QMCKL_FAILURE; later += l; } if (later > 0) { - (void) qmckl_sherman_morrison_splitting( + qmckl_exit_code rc = qmckl_sherman_morrison_splitting( context, LDS, Dim, later, later_updates, later_index, breakdown, Slater_inv, determinant); + if (rc != QMCKL_SUCCESS) return QMCKL_FAILURE; } return QMCKL_SUCCESS;