From acb7a6dffe6bfda1594654d0277ece210cddf520 Mon Sep 17 00:00:00 2001 From: rlar Date: Wed, 31 Jan 2018 19:17:18 +0100 Subject: [PATCH] a new variant of a fix, don't accept solution if previous one was marked CKTnoncon this is only a "sketch" for the test-poly-3.cir debugging session. there are more CKTnoncon in niiter, and all need to be studied/ponderd with respect to this "fix" --- src/maths/ni/niiter.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/maths/ni/niiter.c b/src/maths/ni/niiter.c index 1a45b823b..882476cf7 100644 --- a/src/maths/ni/niiter.c +++ b/src/maths/ni/niiter.c @@ -26,6 +26,7 @@ int NIiter(CKTcircuit *ckt, int maxIter) { double startTime, *OldCKTstate0 = NULL; + int old_noncon; int error, i, j; int iterno = 0; @@ -66,6 +67,7 @@ NIiter(CKTcircuit *ckt, int maxIter) for (;;) { + old_noncon = ckt->CKTnoncon; ckt->CKTnoncon = 0; #ifdef NEWPRED @@ -240,7 +242,7 @@ NIiter(CKTcircuit *ckt, int maxIter) ckt->CKTnoncon = ipass; ipass = 0; } - if (ckt->CKTnoncon == 0) { + if (ckt->CKTnoncon == 0 && old_noncon == 0) { ckt->CKTstat->STATnumIter += iterno; FREE(OldCKTstate0); printf("niiter[%d], accepted and return\n", iterno);