From 02a5f6691e9f985fd04ab10c637d6d7dd04aed98 Mon Sep 17 00:00:00 2001 From: Francesco Lannutti Date: Thu, 29 Aug 2024 00:24:58 +0200 Subject: [PATCH] Fixed KLU conversion to complex for SP Analysis --- src/spicelib/analysis/span.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/spicelib/analysis/span.c b/src/spicelib/analysis/span.c index f4bdcbefa..b302d9247 100644 --- a/src/spicelib/analysis/span.c +++ b/src/spicelib/analysis/span.c @@ -760,6 +760,20 @@ SPan(CKTcircuit* ckt, int restart) else vsrcRoot = ckt->CKTVSRCid; +#ifdef KLU + if (ckt->CKTmatrix->CKTkluMODE) + { + /* Conversion from Real Matrix to Complex Matrix */ + if (!ckt->CKTmatrix->SMPkluMatrix->KLUmatrixIsComplex) + { + for (i = 0 ; i < DEVmaxnum ; i++) + if (DEVices [i] && DEVices [i]->DEVbindCSCComplex && ckt->CKThead [i]) + DEVices [i]->DEVbindCSCComplex (ckt->CKThead [i], ckt) ; + + ckt->CKTmatrix->SMPkluMatrix->KLUmatrixIsComplex = KLUMatrixComplex ; + } + } +#endif // Pre-load everything but RF Ports (these will be updated in the next cycle). error = NIspPreload(ckt);