From 4f7a0acb7af11f6d610e8d33aece693c92a427da Mon Sep 17 00:00:00 2001 From: Francesco Lannutti Date: Sun, 19 Jun 2016 01:21:46 +0200 Subject: [PATCH] Fixed SMPcZeroCol --- src/maths/KLU/klusmp.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/maths/KLU/klusmp.c b/src/maths/KLU/klusmp.c index d72b82414..750eed65f 100644 --- a/src/maths/KLU/klusmp.c +++ b/src/maths/KLU/klusmp.c @@ -724,13 +724,23 @@ SMPcZeroCol (SMPmatrix *eMatrix, int Col) Col = Matrix->ExtToIntColMap [Col] ; - for (Element = Matrix->FirstInCol [Col] ; Element != NULL ; Element = Element->NextInCol) + if (eMatrix->CKTkluMODE) { - Element->Real = 0.0 ; - Element->Imag = 0.0 ; + int i ; + for (i = eMatrix->CKTkluAp [Col - 1] ; i < eMatrix->CKTkluAp [Col] ; i++) + { + eMatrix->CKTkluAx_Complex [2 * i] = 0 ; + eMatrix->CKTkluAx_Complex [2 * i + 1] = 0 ; + } + return 0 ; + } else { + for (Element = Matrix->FirstInCol [Col] ; Element != NULL ; Element = Element->NextInCol) + { + Element->Real = 0.0 ; + Element->Imag = 0.0 ; + } + return spError (Matrix) ; } - - return spError (Matrix) ; } /*