From 8ea98aea6a4a78ea857f7cc9f571061dbfe0c3c6 Mon Sep 17 00:00:00 2001 From: dwarning Date: Sat, 27 Apr 2013 11:01:02 +0200 Subject: [PATCH] cleanings for sens2 code wrt SENSDEBUG printout --- src/spicelib/analysis/dctran.c | 6 ------ src/spicelib/devices/bjt/bjtsupd.c | 5 ++--- src/unsupported/cktsncom.c | 28 ++++++---------------------- src/unsupported/snstart.c | 7 +++---- 4 files changed, 11 insertions(+), 35 deletions(-) diff --git a/src/spicelib/analysis/dctran.c b/src/spicelib/analysis/dctran.c index ff9dee3e7..9716e9fa3 100644 --- a/src/spicelib/analysis/dctran.c +++ b/src/spicelib/analysis/dctran.c @@ -80,9 +80,6 @@ DCtran(CKTcircuit *ckt, #ifdef WANT_SENSE2 int save, save2, size; long save1; -#ifdef SENSDEBUG - FILE *outsen; -#endif /* SENSDEBUG */ #endif int save_order; long save_mode; @@ -484,9 +481,6 @@ DCtran(CKTcircuit *ckt, #ifdef WANT_SENSE2 if(ckt->CKTsenInfo && (ckt->CKTsenInfo->SENmode & TRANSEN)){ ckt->CKTsenInfo->SENmode = save; -#ifdef SENSDEBUG - fclose(outsen); -#endif /* SENSDEBUG */ } #endif return(OK); diff --git a/src/spicelib/devices/bjt/bjtsupd.c b/src/spicelib/devices/bjt/bjtsupd.c index f2551e6c9..f76ef8f71 100644 --- a/src/spicelib/devices/bjt/bjtsupd.c +++ b/src/spicelib/devices/bjt/bjtsupd.c @@ -55,9 +55,8 @@ BJTsUpdate(GENmodel *inModel, CKTcircuit *ckt) sxpbx = 0; #ifdef SENSDEBUG printf("senupdate Instance name: %s\n",here->BJTname); - printf("iparmno = %d,CKTag[0] = %.2e,CKTag[1] = %.2e\n", - iparmno,ckt->CKTag[0],ckt->CKTag[1]); - + printf("CKTag[0] = %.2e,CKTag[1] = %.2e\n", + ckt->CKTag[0],ckt->CKTag[1]); printf("capbe = %.7e\n",here->BJTcapbe); printf("capbc = %.7e\n",here->BJTcapbc); printf("capsub = %.7e\n",here->BJTcapsub); diff --git a/src/unsupported/cktsncom.c b/src/unsupported/cktsncom.c index 78c5241d5..ec18e13c1 100644 --- a/src/unsupported/cktsncom.c +++ b/src/unsupported/cktsncom.c @@ -26,7 +26,6 @@ Author: 1985 Thomas L. Quarles // introduce the opaque struct MatrixElement here // (only the first struct members which are of importance to us) - struct MatrixElement { double Real; @@ -45,24 +44,6 @@ CKTsenComp(CKTcircuit *ckt) #ifdef SENSDEBUG char *rowe; SMPelement *elt; -/* -in smpdefs.h steht: -typedef struct MatrixElement SMPelement; -SMPelement * SMPfindElt( SMPmatrix *, int , int , int ); -(die Fkt. steht in spsmp.c und gibt einen auf SMPelement * gecasteten Elementptr. zurück) - -in sparse/spdefs.h steht: -struct MatrixElement -{ - RealNumber Real; - RealNumber Imag; - int Row; - int Col; - struct MatrixElement *NextInRow; - struct MatrixElement *NextInCol; -}; -typedef struct MatrixElement *ElementPtr; -*/ #endif #ifdef SENSDEBUG @@ -122,11 +103,13 @@ typedef struct MatrixElement *ElementPtr; printf(" Jacobian matrix :\n"); for (row = 1; row <= size; row++) { - for (col = 1; col <= size; col++) - if ((elt = SMPfindElt(ckt->CKTmatrix, row , col , 0))) + for (col = 1; col <= size; col++) { + elt = SMPfindElt(ckt->CKTmatrix, row , col , 0); + if (elt) printf("%.7e ", elt->Real); else printf("0.0000000e+00 "); + } printf("\n"); } #endif @@ -188,7 +171,8 @@ typedef struct MatrixElement *ElementPtr; printf(" Jacobian matrix for AC :\n"); for (row = 1; row <= size; row++) { for (col = 1; col <= size; col++) { - if ((elt = SMPfindElt(ckt->CKTmatrix, row , col , 0))) { + elt = SMPfindElt(ckt->CKTmatrix, row , col , 0); + if (elt) { printf("%.7e ", elt->Real); printf("+j%.7e\t", elt->Imag); } else{ diff --git a/src/unsupported/snstart.c b/src/unsupported/snstart.c index d3c0da9ca..9d812494a 100644 --- a/src/unsupported/snstart.c +++ b/src/unsupported/snstart.c @@ -23,12 +23,11 @@ SENstartup(CKTcircuit *ckt, int restart) IFvalue parmtemp; int type; GENinstance *fast; -/* + if (restart) { - fprintf(stderr, "unsupported code, (SENstartup), doesn't support restart\n"); - exit(1); + fprintf(stdout, "Sensitivity-2 analysis: unsupported code\n"); } -*/ + #ifdef SENSDEBUG printf("SENstartup\n"); #endif