From 48114b1e40fa2398d63fd3016cb000edfba5b5cb Mon Sep 17 00:00:00 2001 From: Francesco Lannutti Date: Thu, 30 Jun 2016 22:43:31 +0200 Subject: [PATCH] Fixed the CSC to CSR conversion for KLU matrix-vector multiplication --- src/maths/KLU/klu_utils.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/maths/KLU/klu_utils.c b/src/maths/KLU/klu_utils.c index 861792f20..80042f6b5 100644 --- a/src/maths/KLU/klu_utils.c +++ b/src/maths/KLU/klu_utils.c @@ -72,8 +72,16 @@ KLU_convert_matrix_in_CSR /* return TRUE if successful, FALSE otherwise return (FALSE) ; } - if (Ap_CSC == NULL || Ai_CSC == NULL || Ax_CSC == NULL || Ap_CSR == NULL || Ai_CSR == NULL || Ax_CSR == NULL) + if (Ap_CSC != NULL) { + if (Ai_CSC == NULL || Ax_CSC == NULL) + { + Ap_CSR [0] = 0 ; + Ap_CSR [1] = 0 ; + Common->status = KLU_OK ; + return (TRUE) ; + } + } else { Common->status = KLU_INVALID ; return (FALSE) ; }