Browse Source

devices/**, unify structure member variables, ptr -> Ptr

pre-master-46
rlar 10 years ago
parent
commit
07d89b5fcd
  1. 14
      src/spicelib/devices/asrc/asrcacld.c
  2. 2
      src/spicelib/devices/asrc/asrcdefs.h
  3. 2
      src/spicelib/devices/asrc/asrcdest.c
  4. 14
      src/spicelib/devices/asrc/asrcload.c
  5. 14
      src/spicelib/devices/asrc/asrcpzld.c
  6. 18
      src/spicelib/devices/asrc/asrcset.c
  7. 8
      src/spicelib/devices/cap/capacld.c
  8. 8
      src/spicelib/devices/cap/capdefs.h
  9. 8
      src/spicelib/devices/cap/capload.c
  10. 16
      src/spicelib/devices/cap/cappzld.c
  11. 8
      src/spicelib/devices/cap/capsetup.c
  12. 4
      src/spicelib/devices/cccs/cccsdefs.h
  13. 4
      src/spicelib/devices/cccs/cccsload.c
  14. 4
      src/spicelib/devices/cccs/cccspzld.c
  15. 4
      src/spicelib/devices/cccs/cccsset.c
  16. 10
      src/spicelib/devices/ccvs/ccvsdefs.h
  17. 10
      src/spicelib/devices/ccvs/ccvsload.c
  18. 10
      src/spicelib/devices/ccvs/ccvspzld.c
  19. 10
      src/spicelib/devices/ccvs/ccvsset.c
  20. 30
      src/spicelib/devices/cpl/cpldefs.h
  21. 42
      src/spicelib/devices/cpl/cplload.c
  22. 90
      src/spicelib/devices/cpl/cplsetup.c
  23. 8
      src/spicelib/devices/csw/cswacld.c
  24. 8
      src/spicelib/devices/csw/cswdefs.h
  25. 8
      src/spicelib/devices/csw/cswload.c
  26. 8
      src/spicelib/devices/csw/cswpzld.c
  27. 8
      src/spicelib/devices/csw/cswsetup.c
  28. 10
      src/spicelib/devices/ind/indacld.c
  29. 14
      src/spicelib/devices/ind/inddefs.h
  30. 14
      src/spicelib/devices/ind/indload.c
  31. 12
      src/spicelib/devices/ind/indpzld.c
  32. 10
      src/spicelib/devices/ind/indsetup.c
  33. 4
      src/spicelib/devices/ind/mutacld.c
  34. 8
      src/spicelib/devices/ind/mutpzld.c
  35. 4
      src/spicelib/devices/ind/mutsetup.c
  36. 8
      src/spicelib/devices/res/resdefs.h
  37. 16
      src/spicelib/devices/res/resload.c
  38. 8
      src/spicelib/devices/res/respzld.c
  39. 8
      src/spicelib/devices/res/ressetup.c
  40. 8
      src/spicelib/devices/sw/swacload.c
  41. 8
      src/spicelib/devices/sw/swdefs.h
  42. 8
      src/spicelib/devices/sw/swload.c
  43. 8
      src/spicelib/devices/sw/swpzload.c
  44. 8
      src/spicelib/devices/sw/swsetup.c
  45. 28
      src/spicelib/devices/txl/txldefs.h
  46. 62
      src/spicelib/devices/txl/txlload.c
  47. 28
      src/spicelib/devices/txl/txlsetup.c
  48. 8
      src/spicelib/devices/vccs/vccsdefs.h
  49. 8
      src/spicelib/devices/vccs/vccsload.c
  50. 8
      src/spicelib/devices/vccs/vccspzld.c
  51. 8
      src/spicelib/devices/vccs/vccsset.c
  52. 12
      src/spicelib/devices/vcvs/vcvsdefs.h
  53. 12
      src/spicelib/devices/vcvs/vcvsload.c
  54. 12
      src/spicelib/devices/vcvs/vcvspzld.c
  55. 12
      src/spicelib/devices/vcvs/vcvsset.c
  56. 8
      src/spicelib/devices/vsrc/vsrcacld.c
  57. 10
      src/spicelib/devices/vsrc/vsrcdefs.h
  58. 8
      src/spicelib/devices/vsrc/vsrcload.c
  59. 14
      src/spicelib/devices/vsrc/vsrcpzld.c
  60. 10
      src/spicelib/devices/vsrc/vsrcpzs.c
  61. 8
      src/spicelib/devices/vsrc/vsrcset.c

14
src/spicelib/devices/asrc/asrcacld.c

@ -51,19 +51,19 @@ ASRCacLoad(GENmodel *inModel, CKTcircuit *ckt)
if (here->ASRCtype == ASRC_VOLTAGE) { if (here->ASRCtype == ASRC_VOLTAGE) {
*(here->ASRCposptr[j++]) += 1.0;
*(here->ASRCposptr[j++]) -= 1.0;
*(here->ASRCposptr[j++]) -= 1.0;
*(here->ASRCposptr[j++]) += 1.0;
*(here->ASRCposPtr[j++]) += 1.0;
*(here->ASRCposPtr[j++]) -= 1.0;
*(here->ASRCposPtr[j++]) -= 1.0;
*(here->ASRCposPtr[j++]) += 1.0;
for (i = 0; i < here->ASRCtree->numVars; i++) for (i = 0; i < here->ASRCtree->numVars; i++)
*(here->ASRCposptr[j++]) -= derivs[i] / factor;
*(here->ASRCposPtr[j++]) -= derivs[i] / factor;
} else { } else {
for (i = 0; i < here->ASRCtree->numVars; i++) { for (i = 0; i < here->ASRCtree->numVars; i++) {
*(here->ASRCposptr[j++]) += derivs[i] / factor;
*(here->ASRCposptr[j++]) -= derivs[i] / factor;
*(here->ASRCposPtr[j++]) += derivs[i] / factor;
*(here->ASRCposPtr[j++]) -= derivs[i] / factor;
} }
} }

2
src/spicelib/devices/asrc/asrcdefs.h

@ -36,7 +36,7 @@ typedef struct sASRCinstance {
double ASRCtc1; /* first temperature coefficient of resistors */ double ASRCtc1; /* first temperature coefficient of resistors */
double ASRCtc2; /* second temperature coefficient of resistors */ double ASRCtc2; /* second temperature coefficient of resistors */
int ASRCreciproctc; /* Flag to calculate reciprocal temperature behaviour */ int ASRCreciproctc; /* Flag to calculate reciprocal temperature behaviour */
double **ASRCposptr; /* pointer to pointers of the elements
double **ASRCposPtr; /* pointer to pointers of the elements
* in the sparce matrix */ * in the sparce matrix */
double ASRCprev_value; /* Previous value for the convergence test */ double ASRCprev_value; /* Previous value for the convergence test */
double *ASRCacValues; /* Store rhs and derivatives for ac anal */ double *ASRCacValues; /* Store rhs and derivatives for ac anal */

2
src/spicelib/devices/asrc/asrcdest.c

@ -21,7 +21,7 @@ ASRCdestroy(GENmodel **inModel)
ASRCinstance *next_inst = inst->ASRCnextInstance; ASRCinstance *next_inst = inst->ASRCnextInstance;
INPfreeTree(inst->ASRCtree); INPfreeTree(inst->ASRCtree);
FREE(inst->ASRCacValues); FREE(inst->ASRCacValues);
FREE(inst->ASRCposptr);
FREE(inst->ASRCposPtr);
FREE(inst->ASRCvars); FREE(inst->ASRCvars);
FREE(inst); FREE(inst);
inst = next_inst; inst = next_inst;

14
src/spicelib/devices/asrc/asrcload.c

@ -71,15 +71,15 @@ ASRCload(GENmodel *inModel, CKTcircuit *ckt)
if (here->ASRCtype == ASRC_VOLTAGE) { if (here->ASRCtype == ASRC_VOLTAGE) {
*(here->ASRCposptr[j++]) += 1.0;
*(here->ASRCposptr[j++]) -= 1.0;
*(here->ASRCposptr[j++]) -= 1.0;
*(here->ASRCposptr[j++]) += 1.0;
*(here->ASRCposPtr[j++]) += 1.0;
*(here->ASRCposPtr[j++]) -= 1.0;
*(here->ASRCposPtr[j++]) -= 1.0;
*(here->ASRCposPtr[j++]) += 1.0;
for (i = 0; i < here->ASRCtree->numVars; i++) { for (i = 0; i < here->ASRCtree->numVars; i++) {
rhs -= (asrc_vals[i] * asrc_derivs[i]); rhs -= (asrc_vals[i] * asrc_derivs[i]);
*(here->ASRCposptr[j++]) -= asrc_derivs[i] * factor;
*(here->ASRCposPtr[j++]) -= asrc_derivs[i] * factor;
} }
ckt->CKTrhs[here->ASRCbranch] += factor * rhs; ckt->CKTrhs[here->ASRCbranch] += factor * rhs;
@ -89,8 +89,8 @@ ASRCload(GENmodel *inModel, CKTcircuit *ckt)
for (i = 0; i < here->ASRCtree->numVars; i++) { for (i = 0; i < here->ASRCtree->numVars; i++) {
rhs -= (asrc_vals[i] * asrc_derivs[i]); rhs -= (asrc_vals[i] * asrc_derivs[i]);
*(here->ASRCposptr[j++]) += asrc_derivs[i] * factor;
*(here->ASRCposptr[j++]) -= asrc_derivs[i] * factor;
*(here->ASRCposPtr[j++]) += asrc_derivs[i] * factor;
*(here->ASRCposPtr[j++]) -= asrc_derivs[i] * factor;
} }
ckt->CKTrhs[here->ASRCposNode] -= factor * rhs; ckt->CKTrhs[here->ASRCposNode] -= factor * rhs;

14
src/spicelib/devices/asrc/asrcpzld.c

@ -63,19 +63,19 @@ ASRCpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
if (here->ASRCtype == ASRC_VOLTAGE) { if (here->ASRCtype == ASRC_VOLTAGE) {
*(here->ASRCposptr[j++]) += 1.0;
*(here->ASRCposptr[j++]) -= 1.0;
*(here->ASRCposptr[j++]) -= 1.0;
*(here->ASRCposptr[j++]) += 1.0;
*(here->ASRCposPtr[j++]) += 1.0;
*(here->ASRCposPtr[j++]) -= 1.0;
*(here->ASRCposPtr[j++]) -= 1.0;
*(here->ASRCposPtr[j++]) += 1.0;
for (i = 0; i < here->ASRCtree->numVars; i++) for (i = 0; i < here->ASRCtree->numVars; i++)
*(here->ASRCposptr[j++]) -= asrc_derivs[i] / factor;
*(here->ASRCposPtr[j++]) -= asrc_derivs[i] / factor;
} else { } else {
for (i = 0; i < here->ASRCtree->numVars; i++) { for (i = 0; i < here->ASRCtree->numVars; i++) {
*(here->ASRCposptr[j++]) += asrc_derivs[i] / factor;
*(here->ASRCposptr[j++]) -= asrc_derivs[i] / factor;
*(here->ASRCposPtr[j++]) += asrc_derivs[i] / factor;
*(here->ASRCposPtr[j++]) -= asrc_derivs[i] / factor;
} }
} }

18
src/spicelib/devices/asrc/asrcset.c

@ -61,7 +61,7 @@ ASRCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
return (E_BADPARM); return (E_BADPARM);
} }
here->ASRCposptr = TMALLOC(double *, j);
here->ASRCposPtr = TMALLOC(double *, j);
here->ASRCvars = TMALLOC(int, here->ASRCtree->numVars); here->ASRCvars = TMALLOC(int, here->ASRCtree->numVars);
here->ASRCacValues = TMALLOC(double, here->ASRCtree->numVars + 1); here->ASRCacValues = TMALLOC(double, here->ASRCtree->numVars + 1);
@ -79,10 +79,10 @@ ASRCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
here->ASRCbranch = tmp->number; here->ASRCbranch = tmp->number;
} }
TSTALLOC(ASRCposptr[j++], here->ASRCposNode, here->ASRCbranch);
TSTALLOC(ASRCposptr[j++], here->ASRCnegNode, here->ASRCbranch);
TSTALLOC(ASRCposptr[j++], here->ASRCbranch, here->ASRCnegNode);
TSTALLOC(ASRCposptr[j++], here->ASRCbranch, here->ASRCposNode);
TSTALLOC(ASRCposPtr[j++], here->ASRCposNode, here->ASRCbranch);
TSTALLOC(ASRCposPtr[j++], here->ASRCnegNode, here->ASRCbranch);
TSTALLOC(ASRCposPtr[j++], here->ASRCbranch, here->ASRCnegNode);
TSTALLOC(ASRCposPtr[j++], here->ASRCbranch, here->ASRCposNode);
} }
for (i = 0; i < here->ASRCtree->numVars; i++) { for (i = 0; i < here->ASRCtree->numVars; i++) {
@ -107,10 +107,10 @@ ASRCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
here->ASRCvars[i] = column; here->ASRCvars[i] = column;
if (here->ASRCtype == ASRC_VOLTAGE) { if (here->ASRCtype == ASRC_VOLTAGE) {
TSTALLOC(ASRCposptr[j++], here->ASRCbranch, column);
TSTALLOC(ASRCposPtr[j++], here->ASRCbranch, column);
} else { } else {
TSTALLOC(ASRCposptr[j++], here->ASRCposNode, column);
TSTALLOC(ASRCposptr[j++], here->ASRCnegNode, column);
TSTALLOC(ASRCposPtr[j++], here->ASRCposNode, column);
TSTALLOC(ASRCposPtr[j++], here->ASRCnegNode, column);
} }
} }
} }
@ -132,7 +132,7 @@ ASRCunsetup(GENmodel *inModel, CKTcircuit *ckt)
CKTdltNNum(ckt, here->ASRCbranch); CKTdltNNum(ckt, here->ASRCbranch);
here->ASRCbranch = 0; here->ASRCbranch = 0;
} }
FREE(here->ASRCposptr);
FREE(here->ASRCposPtr);
FREE(here->ASRCvars); FREE(here->ASRCvars);
FREE(here->ASRCacValues); FREE(here->ASRCacValues);
} }

8
src/spicelib/devices/cap/capacld.c

@ -29,10 +29,10 @@ CAPacLoad(GENmodel *inModel, CKTcircuit *ckt)
val = ckt->CKTomega * here->CAPcapac; val = ckt->CKTomega * here->CAPcapac;
*(here->CAPposPosptr +1) += m * val;
*(here->CAPnegNegptr +1) += m * val;
*(here->CAPposNegptr +1) -= m * val;
*(here->CAPnegPosptr +1) -= m * val;
*(here->CAPposPosPtr +1) += m * val;
*(here->CAPnegNegPtr +1) += m * val;
*(here->CAPposNegPtr +1) -= m * val;
*(here->CAPnegPosPtr +1) -= m * val;
} }
} }
return(OK); return(OK);

8
src/spicelib/devices/cap/capdefs.h

@ -39,13 +39,13 @@ typedef struct sCAPinstance {
double CAPtc2; /* second temperature coefficient of capacitors */ double CAPtc2; /* second temperature coefficient of capacitors */
double CAPbv_max; /* Maximum capacitor voltage */ double CAPbv_max; /* Maximum capacitor voltage */
double *CAPposPosptr; /* pointer to sparse matrix diagonal at
double *CAPposPosPtr; /* pointer to sparse matrix diagonal at
* (positive,positive) */ * (positive,positive) */
double *CAPnegNegptr; /* pointer to sparse matrix diagonal at
double *CAPnegNegPtr; /* pointer to sparse matrix diagonal at
* (negative,negative) */ * (negative,negative) */
double *CAPposNegptr; /* pointer to sparse matrix offdiagonal at
double *CAPposNegPtr; /* pointer to sparse matrix offdiagonal at
* (positive,negative) */ * (positive,negative) */
double *CAPnegPosptr; /* pointer to sparse matrix offdiagonal at
double *CAPnegPosPtr; /* pointer to sparse matrix offdiagonal at
* (negative,positive) */ * (negative,positive) */
unsigned CAPcapGiven : 1; /* flag to indicate capacitance was specified */ unsigned CAPcapGiven : 1; /* flag to indicate capacitance was specified */
unsigned CAPicGiven : 1; /* flag to indicate init. cond. was specified */ unsigned CAPicGiven : 1; /* flag to indicate init. cond. was specified */

8
src/spicelib/devices/cap/capload.c

@ -71,10 +71,10 @@ CAPload(GENmodel *inModel, CKTcircuit *ckt)
*(ckt->CKTstate1+here->CAPccap) = *(ckt->CKTstate1+here->CAPccap) =
*(ckt->CKTstate0+here->CAPccap); *(ckt->CKTstate0+here->CAPccap);
} }
*(here->CAPposPosptr) += m * geq;
*(here->CAPnegNegptr) += m * geq;
*(here->CAPposNegptr) -= m * geq;
*(here->CAPnegPosptr) -= m * geq;
*(here->CAPposPosPtr) += m * geq;
*(here->CAPnegNegPtr) += m * geq;
*(here->CAPposNegPtr) -= m * geq;
*(here->CAPnegPosPtr) -= m * geq;
*(ckt->CKTrhs+here->CAPposNode) -= m * ceq; *(ckt->CKTrhs+here->CAPposNode) -= m * ceq;
*(ckt->CKTrhs+here->CAPnegNode) += m * ceq; *(ckt->CKTrhs+here->CAPnegNode) += m * ceq;
} else } else

16
src/spicelib/devices/cap/cappzld.c

@ -33,14 +33,14 @@ CAPpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
val = here->CAPcapac; val = here->CAPcapac;
m = here->CAPm; m = here->CAPm;
*(here->CAPposPosptr ) += m * val * s->real;
*(here->CAPposPosptr +1) += m * val * s->imag;
*(here->CAPnegNegptr ) += m * val * s->real;
*(here->CAPnegNegptr +1) += m * val * s->imag;
*(here->CAPposNegptr ) -= m * val * s->real;
*(here->CAPposNegptr +1) -= m * val * s->imag;
*(here->CAPnegPosptr ) -= m * val * s->real;
*(here->CAPnegPosptr +1) -= m * val * s->imag;
*(here->CAPposPosPtr ) += m * val * s->real;
*(here->CAPposPosPtr +1) += m * val * s->imag;
*(here->CAPnegNegPtr ) += m * val * s->real;
*(here->CAPnegNegPtr +1) += m * val * s->imag;
*(here->CAPposNegPtr ) -= m * val * s->real;
*(here->CAPposNegPtr +1) -= m * val * s->imag;
*(here->CAPnegPosPtr ) -= m * val * s->real;
*(here->CAPnegPosPtr +1) -= m * val * s->imag;
} }
} }
return(OK); return(OK);

8
src/spicelib/devices/cap/capsetup.c

@ -111,10 +111,10 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
return(E_NOMEM);\ return(E_NOMEM);\
} } while(0) } } while(0)
TSTALLOC(CAPposPosptr,CAPposNode,CAPposNode);
TSTALLOC(CAPnegNegptr,CAPnegNode,CAPnegNode);
TSTALLOC(CAPposNegptr,CAPposNode,CAPnegNode);
TSTALLOC(CAPnegPosptr,CAPnegNode,CAPposNode);
TSTALLOC(CAPposPosPtr,CAPposNode,CAPposNode);
TSTALLOC(CAPnegNegPtr,CAPnegNode,CAPnegNode);
TSTALLOC(CAPposNegPtr,CAPposNode,CAPnegNode);
TSTALLOC(CAPnegPosPtr,CAPnegNode,CAPposNode);
} }
} }
return(OK); return(OK);

4
src/spicelib/devices/cccs/cccsdefs.h

@ -32,9 +32,9 @@ typedef struct sCCCSinstance {
double CCCSmValue; /* Parallel multiplier */ double CCCSmValue; /* Parallel multiplier */
double *CCCSposContBrptr; /* pointer to sparse matrix element at
double *CCCSposContBrPtr; /* pointer to sparse matrix element at
*(positive node, control branch eq)*/ *(positive node, control branch eq)*/
double *CCCSnegContBrptr; /* pointer to sparse matrix element at
double *CCCSnegContBrPtr; /* pointer to sparse matrix element at
*(negative node, control branch eq)*/ *(negative node, control branch eq)*/
unsigned CCCScoeffGiven :1 ; /* flag to indicate coeff given */ unsigned CCCScoeffGiven :1 ; /* flag to indicate coeff given */
unsigned CCCSmGiven :1 ; /* flag to indicate multiplier given */ unsigned CCCSmGiven :1 ; /* flag to indicate multiplier given */

4
src/spicelib/devices/cccs/cccsload.c

@ -32,8 +32,8 @@ CCCSload(GENmodel *inModel, CKTcircuit *ckt)
for (here = model->CCCSinstances; here != NULL ; for (here = model->CCCSinstances; here != NULL ;
here=here->CCCSnextInstance) { here=here->CCCSnextInstance) {
*(here->CCCSposContBrptr) += here->CCCScoeff ;
*(here->CCCSnegContBrptr) -= here->CCCScoeff ;
*(here->CCCSposContBrPtr) += here->CCCScoeff ;
*(here->CCCSnegContBrPtr) -= here->CCCScoeff ;
} }
} }
return(OK); return(OK);

4
src/spicelib/devices/cccs/cccspzld.c

@ -34,8 +34,8 @@ CCCSpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
for (here = model->CCCSinstances; here != NULL ; for (here = model->CCCSinstances; here != NULL ;
here=here->CCCSnextInstance) { here=here->CCCSnextInstance) {
*(here->CCCSposContBrptr) += here->CCCScoeff ;
*(here->CCCSnegContBrptr) -= here->CCCScoeff ;
*(here->CCCSposContBrPtr) += here->CCCScoeff ;
*(here->CCCSnegContBrPtr) -= here->CCCScoeff ;
} }
} }
return(OK); return(OK);

4
src/spicelib/devices/cccs/cccsset.c

@ -46,8 +46,8 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
return(E_NOMEM);\ return(E_NOMEM);\
} } while(0) } } while(0)
TSTALLOC(CCCSposContBrptr,CCCSposNode,CCCScontBranch);
TSTALLOC(CCCSnegContBrptr,CCCSnegNode,CCCScontBranch);
TSTALLOC(CCCSposContBrPtr,CCCSposNode,CCCScontBranch);
TSTALLOC(CCCSnegContBrPtr,CCCSnegNode,CCCScontBranch);
} }
} }
return(OK); return(OK);

10
src/spicelib/devices/ccvs/ccvsdefs.h

@ -31,15 +31,15 @@ typedef struct sCCVSinstance {
double CCVScoeff; /* coefficient */ double CCVScoeff; /* coefficient */
double *CCVSposIbrptr; /* pointer to sparse matrix element at
double *CCVSposIbrPtr; /* pointer to sparse matrix element at
* (positive node, branch equation) */ * (positive node, branch equation) */
double *CCVSnegIbrptr; /* pointer to sparse matrix element at
double *CCVSnegIbrPtr; /* pointer to sparse matrix element at
* (negative node, branch equation) */ * (negative node, branch equation) */
double *CCVSibrPosptr; /* pointer to sparse matrix element at
double *CCVSibrPosPtr; /* pointer to sparse matrix element at
* (branch equation, positive node) */ * (branch equation, positive node) */
double *CCVSibrNegptr; /* pointer to sparse matrix element at
double *CCVSibrNegPtr; /* pointer to sparse matrix element at
* (branch equation, negative node) */ * (branch equation, negative node) */
double *CCVSibrContBrptr; /* pointer to sparse matrix element at
double *CCVSibrContBrPtr; /* pointer to sparse matrix element at
*(branch equation, control branch eq)*/ *(branch equation, control branch eq)*/
unsigned CCVScoeffGiven :1 ; /* flag to indicate coeff given */ unsigned CCVScoeffGiven :1 ; /* flag to indicate coeff given */

10
src/spicelib/devices/ccvs/ccvsload.c

@ -32,11 +32,11 @@ CCVSload(GENmodel *inModel, CKTcircuit *ckt)
for (here = model->CCVSinstances; here != NULL ; for (here = model->CCVSinstances; here != NULL ;
here=here->CCVSnextInstance) { here=here->CCVSnextInstance) {
*(here->CCVSposIbrptr) += 1.0 ;
*(here->CCVSnegIbrptr) -= 1.0 ;
*(here->CCVSibrPosptr) += 1.0 ;
*(here->CCVSibrNegptr) -= 1.0 ;
*(here->CCVSibrContBrptr) -= here->CCVScoeff ;
*(here->CCVSposIbrPtr) += 1.0 ;
*(here->CCVSnegIbrPtr) -= 1.0 ;
*(here->CCVSibrPosPtr) += 1.0 ;
*(here->CCVSibrNegPtr) -= 1.0 ;
*(here->CCVSibrContBrPtr) -= here->CCVScoeff ;
} }
} }
return(OK); return(OK);

10
src/spicelib/devices/ccvs/ccvspzld.c

@ -34,11 +34,11 @@ CCVSpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
for (here = model->CCVSinstances; here != NULL ; for (here = model->CCVSinstances; here != NULL ;
here=here->CCVSnextInstance) { here=here->CCVSnextInstance) {
*(here->CCVSposIbrptr) += 1.0 ;
*(here->CCVSnegIbrptr) -= 1.0 ;
*(here->CCVSibrPosptr) += 1.0 ;
*(here->CCVSibrNegptr) -= 1.0 ;
*(here->CCVSibrContBrptr) += here->CCVScoeff ;
*(here->CCVSposIbrPtr) += 1.0 ;
*(here->CCVSnegIbrPtr) -= 1.0 ;
*(here->CCVSibrPosPtr) += 1.0 ;
*(here->CCVSibrNegPtr) -= 1.0 ;
*(here->CCVSibrContBrPtr) += here->CCVScoeff ;
} }
} }
return(OK); return(OK);

10
src/spicelib/devices/ccvs/ccvsset.c

@ -55,11 +55,11 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
return(E_NOMEM);\ return(E_NOMEM);\
} } while(0) } } while(0)
TSTALLOC(CCVSposIbrptr, CCVSposNode, CCVSbranch);
TSTALLOC(CCVSnegIbrptr, CCVSnegNode, CCVSbranch);
TSTALLOC(CCVSibrNegptr, CCVSbranch, CCVSnegNode);
TSTALLOC(CCVSibrPosptr, CCVSbranch, CCVSposNode);
TSTALLOC(CCVSibrContBrptr, CCVSbranch, CCVScontBranch);
TSTALLOC(CCVSposIbrPtr, CCVSposNode, CCVSbranch);
TSTALLOC(CCVSnegIbrPtr, CCVSnegNode, CCVSbranch);
TSTALLOC(CCVSibrNegPtr, CCVSbranch, CCVSnegNode);
TSTALLOC(CCVSibrPosPtr, CCVSbranch, CCVSposNode);
TSTALLOC(CCVSibrContBrPtr, CCVSbranch, CCVScontBranch);
} }
} }
return(OK); return(OK);

30
src/spicelib/devices/cpl/cpldefs.h

@ -35,22 +35,22 @@ typedef struct sCPLinstance {
char **in_node_names; char **in_node_names;
char **out_node_names; char **out_node_names;
double **CPLibr1Ibr1;
double **CPLibr2Ibr2;
double **CPLposIbr1;
double **CPLnegIbr2;
double **CPLibr1Ibr1Ptr;
double **CPLibr2Ibr2Ptr;
double **CPLposIbr1Ptr;
double **CPLnegIbr2Ptr;
/* trial */ /* trial */
double **CPLposPos;
double **CPLnegNeg;
double **CPLposNeg;
double **CPLnegPos;
double ***CPLibr1Pos;
double ***CPLibr2Neg;
double ***CPLibr1Neg;
double ***CPLibr2Pos;
double ***CPLibr1Ibr2;
double ***CPLibr2Ibr1;
double **CPLposPosPtr;
double **CPLnegNegPtr;
double **CPLposNegPtr;
double **CPLnegPosPtr;
double ***CPLibr1PosPtr;
double ***CPLibr2NegPtr;
double ***CPLibr1NegPtr;
double ***CPLibr2PosPtr;
double ***CPLibr1Ibr2Ptr;
double ***CPLibr2Ibr1Ptr;
unsigned CPLibr1Given : 1; unsigned CPLibr1Given : 1;
unsigned CPLibr2Given : 1; unsigned CPLibr2Given : 1;

42
src/spicelib/devices/cpl/cplload.c

@ -80,10 +80,10 @@ CPLload(GENmodel *inModel, CKTcircuit *ckt)
for(m = 0 ; m < noL ; m++) /* dc solution */ for(m = 0 ; m < noL ; m++) /* dc solution */
{ {
*here->CPLposPos[m] += gmin;
*here->CPLnegNeg[m] += gmin;
*here->CPLnegPos[m] += gmin;
*here->CPLposNeg[m] += gmin;
*here->CPLposPosPtr[m] += gmin;
*here->CPLnegNegPtr[m] += gmin;
*here->CPLnegPosPtr[m] += gmin;
*here->CPLposNegPtr[m] += gmin;
} }
if (cond1 || cp->vi_head == NULL) continue; if (cond1 || cp->vi_head == NULL) continue;
@ -158,13 +158,13 @@ CPLload(GENmodel *inModel, CKTcircuit *ckt)
if (here->CPLlengthGiven) if (here->CPLlengthGiven)
g = model->Rm[resindex] * here->CPLlength; g = model->Rm[resindex] * here->CPLlength;
else g = model->Rm[resindex] * here->CPLmodPtr->length; else g = model->Rm[resindex] * here->CPLmodPtr->length;
*(here->CPLposIbr1[m]) += 1.0;
*(here->CPLnegIbr2[m]) += 1.0;
*(here->CPLibr1Ibr1[m]) += 1.0;
*(here->CPLibr1Ibr2[m][m]) += 1.0;
*(here->CPLibr2Pos[m][m]) += 1.0;
*(here->CPLibr2Neg[m][m]) -= 1.0;
*(here->CPLibr2Ibr1[m][m]) -= g;
*(here->CPLposIbr1Ptr[m]) += 1.0;
*(here->CPLnegIbr2Ptr[m]) += 1.0;
*(here->CPLibr1Ibr1Ptr[m]) += 1.0;
*(here->CPLibr1Ibr2Ptr[m][m]) += 1.0;
*(here->CPLibr2PosPtr[m][m]) += 1.0;
*(here->CPLibr2NegPtr[m][m]) -= 1.0;
*(here->CPLibr2Ibr1Ptr[m][m]) -= g;
resindex = resindex + noL - m; resindex = resindex + noL - m;
} }
continue; continue;
@ -267,20 +267,20 @@ CPLload(GENmodel *inModel, CKTcircuit *ckt)
} }
for (m = 0; m < noL; m++) { for (m = 0; m < noL; m++) {
*(here->CPLibr1Ibr1[m]) = -1.0;
*(here->CPLibr2Ibr2[m]) = -1.0;
*(here->CPLibr1Ibr1Ptr[m]) = -1.0;
*(here->CPLibr2Ibr2Ptr[m]) = -1.0;
} }
for (m = 0; m < noL; m++) { for (m = 0; m < noL; m++) {
*(here->CPLposIbr1[m]) = 1.0;
*(here->CPLnegIbr2[m]) = 1.0;
*(here->CPLposIbr1Ptr[m]) = 1.0;
*(here->CPLnegIbr2Ptr[m]) = 1.0;
} }
for (m = 0; m < noL; m++) { for (m = 0; m < noL; m++) {
for (p = 0; p < noL; p++) { for (p = 0; p < noL; p++) {
*(here->CPLibr1Pos[m][p]) =
*(here->CPLibr1PosPtr[m][p]) =
cp->h1t[m][p]->aten + h1 * cp->h1C[m][p]; cp->h1t[m][p]->aten + h1 * cp->h1C[m][p];
*(here->CPLibr2Neg[m][p]) =
*(here->CPLibr2NegPtr[m][p]) =
cp->h1t[m][p]->aten + h1 * cp->h1C[m][p]; cp->h1t[m][p]->aten + h1 * cp->h1C[m][p];
} }
} }
@ -302,14 +302,14 @@ CPLload(GENmodel *inModel, CKTcircuit *ckt)
if (cp->h3t[m][p][q]) { if (cp->h3t[m][p][q]) {
f = ratio[q] * (h1 * cp->h3C[m][p][q] + f = ratio[q] * (h1 * cp->h3C[m][p][q] +
cp->h3t[m][p][q]->aten); cp->h3t[m][p][q]->aten);
*(here->CPLibr1Neg[m][p]) = -f;
*(here->CPLibr2Pos[m][p]) = -f;
*(here->CPLibr1NegPtr[m][p]) = -f;
*(here->CPLibr2PosPtr[m][p]) = -f;
} }
if (cp->h2t[m][p][q]) { if (cp->h2t[m][p][q]) {
f = ratio[q] * (h1 * cp->h2C[m][p][q] + f = ratio[q] * (h1 * cp->h2C[m][p][q] +
cp->h2t[m][p][q]->aten); cp->h2t[m][p][q]->aten);
*(here->CPLibr1Ibr2[m][p]) = -f;
*(here->CPLibr2Ibr1[m][p]) = -f;
*(here->CPLibr1Ibr2Ptr[m][p]) = -f;
*(here->CPLibr2Ibr1Ptr[m][p]) = -f;
} }
} }

90
src/spicelib/devices/cpl/cplsetup.c

@ -195,21 +195,21 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
here->CPLibr1 = TMALLOC(int, noL); here->CPLibr1 = TMALLOC(int, noL);
here->CPLibr2 = TMALLOC(int, noL); here->CPLibr2 = TMALLOC(int, noL);
VECTOR_ALLOC(here->CPLibr1Ibr1, double, noL);
VECTOR_ALLOC(here->CPLibr2Ibr2, double, noL);
VECTOR_ALLOC(here->CPLposIbr1, double, noL);
VECTOR_ALLOC(here->CPLnegIbr2, double, noL);
VECTOR_ALLOC(here->CPLposPos, double, noL);
VECTOR_ALLOC(here->CPLnegNeg, double, noL);
VECTOR_ALLOC(here->CPLnegPos, double, noL);
VECTOR_ALLOC(here->CPLposNeg, double, noL);
MATRIX_ALLOC(here->CPLibr1Pos, double, noL, noL);
MATRIX_ALLOC(here->CPLibr2Neg, double, noL, noL);
MATRIX_ALLOC(here->CPLibr1Neg, double, noL, noL);
MATRIX_ALLOC(here->CPLibr2Pos, double, noL, noL);
MATRIX_ALLOC(here->CPLibr1Ibr2, double, noL, noL);
MATRIX_ALLOC(here->CPLibr2Ibr1, double, noL, noL);
VECTOR_ALLOC(here->CPLibr1Ibr1Ptr, double, noL);
VECTOR_ALLOC(here->CPLibr2Ibr2Ptr, double, noL);
VECTOR_ALLOC(here->CPLposIbr1Ptr, double, noL);
VECTOR_ALLOC(here->CPLnegIbr2Ptr, double, noL);
VECTOR_ALLOC(here->CPLposPosPtr, double, noL);
VECTOR_ALLOC(here->CPLnegNegPtr, double, noL);
VECTOR_ALLOC(here->CPLnegPosPtr, double, noL);
VECTOR_ALLOC(here->CPLposNegPtr, double, noL);
MATRIX_ALLOC(here->CPLibr1PosPtr, double, noL, noL);
MATRIX_ALLOC(here->CPLibr2NegPtr, double, noL, noL);
MATRIX_ALLOC(here->CPLibr1NegPtr, double, noL, noL);
MATRIX_ALLOC(here->CPLibr2PosPtr, double, noL, noL);
MATRIX_ALLOC(here->CPLibr1Ibr2Ptr, double, noL, noL);
MATRIX_ALLOC(here->CPLibr2Ibr1Ptr, double, noL, noL);
branchname = TMALLOC(char *, here->dimension); branchname = TMALLOC(char *, here->dimension);
@ -259,23 +259,23 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
} }
for (m = 0; m < here->dimension; m++) { for (m = 0; m < here->dimension; m++) {
TSTALLOC(CPLibr1Ibr1[m],CPLibr1[m],CPLibr1[m]);
TSTALLOC(CPLibr2Ibr2[m],CPLibr2[m],CPLibr2[m]);
TSTALLOC(CPLposIbr1[m],CPLposNodes[m],CPLibr1[m]);
TSTALLOC(CPLnegIbr2[m],CPLnegNodes[m],CPLibr2[m]);
TSTALLOC(CPLposPos[m],CPLposNodes[m],CPLposNodes[m]);
TSTALLOC(CPLnegNeg[m],CPLnegNodes[m],CPLnegNodes[m]);
TSTALLOC(CPLnegPos[m],CPLnegNodes[m],CPLposNodes[m]);
TSTALLOC(CPLposNeg[m],CPLposNodes[m],CPLnegNodes[m]);
TSTALLOC(CPLibr1Ibr1Ptr[m],CPLibr1[m],CPLibr1[m]);
TSTALLOC(CPLibr2Ibr2Ptr[m],CPLibr2[m],CPLibr2[m]);
TSTALLOC(CPLposIbr1Ptr[m],CPLposNodes[m],CPLibr1[m]);
TSTALLOC(CPLnegIbr2Ptr[m],CPLnegNodes[m],CPLibr2[m]);
TSTALLOC(CPLposPosPtr[m],CPLposNodes[m],CPLposNodes[m]);
TSTALLOC(CPLnegNegPtr[m],CPLnegNodes[m],CPLnegNodes[m]);
TSTALLOC(CPLnegPosPtr[m],CPLnegNodes[m],CPLposNodes[m]);
TSTALLOC(CPLposNegPtr[m],CPLposNodes[m],CPLnegNodes[m]);
for (p = 0; p < here->dimension; p++) { for (p = 0; p < here->dimension; p++) {
TSTALLOC(CPLibr1Pos[m][p],CPLibr1[m],CPLposNodes[p]);
TSTALLOC(CPLibr2Neg[m][p],CPLibr2[m],CPLnegNodes[p]);
TSTALLOC(CPLibr1Neg[m][p],CPLibr1[m],CPLnegNodes[p]);
TSTALLOC(CPLibr2Pos[m][p],CPLibr2[m],CPLposNodes[p]);
TSTALLOC(CPLibr1Ibr2[m][p],CPLibr1[m],CPLibr2[p]);
TSTALLOC(CPLibr2Ibr1[m][p],CPLibr2[m],CPLibr1[p]);
TSTALLOC(CPLibr1PosPtr[m][p],CPLibr1[m],CPLposNodes[p]);
TSTALLOC(CPLibr2NegPtr[m][p],CPLibr2[m],CPLnegNodes[p]);
TSTALLOC(CPLibr1NegPtr[m][p],CPLibr1[m],CPLnegNodes[p]);
TSTALLOC(CPLibr2PosPtr[m][p],CPLibr2[m],CPLposNodes[p]);
TSTALLOC(CPLibr1Ibr2Ptr[m][p],CPLibr1[m],CPLibr2[p]);
TSTALLOC(CPLibr2Ibr1Ptr[m][p],CPLibr2[m],CPLibr1[p]);
} }
} }
@ -305,22 +305,22 @@ CPLunsetup(GENmodel *inModel, CKTcircuit *ckt)
noL = here->dimension; noL = here->dimension;
VECTOR_FREE(here->CPLibr1Ibr1);
VECTOR_FREE(here->CPLibr2Ibr2);
VECTOR_FREE(here->CPLposIbr1);
VECTOR_FREE(here->CPLnegIbr2);
VECTOR_FREE(here->CPLposPos);
VECTOR_FREE(here->CPLnegNeg);
VECTOR_FREE(here->CPLnegPos);
VECTOR_FREE(here->CPLposNeg);
MATRIX_FREE(here->CPLibr1Pos, noL, noL);
MATRIX_FREE(here->CPLibr2Neg, noL, noL);
MATRIX_FREE(here->CPLibr1Neg, noL, noL);
MATRIX_FREE(here->CPLibr2Pos, noL, noL);
MATRIX_FREE(here->CPLibr1Ibr2, noL, noL);
MATRIX_FREE(here->CPLibr2Ibr1, noL, noL);
VECTOR_FREE(here->CPLibr1Ibr1Ptr);
VECTOR_FREE(here->CPLibr2Ibr2Ptr);
VECTOR_FREE(here->CPLposIbr1Ptr);
VECTOR_FREE(here->CPLnegIbr2Ptr);
VECTOR_FREE(here->CPLposPosPtr);
VECTOR_FREE(here->CPLnegNegPtr);
VECTOR_FREE(here->CPLnegPosPtr);
VECTOR_FREE(here->CPLposNegPtr);
MATRIX_FREE(here->CPLibr1PosPtr, noL, noL);
MATRIX_FREE(here->CPLibr2NegPtr, noL, noL);
MATRIX_FREE(here->CPLibr1NegPtr, noL, noL);
MATRIX_FREE(here->CPLibr2PosPtr, noL, noL);
MATRIX_FREE(here->CPLibr1Ibr2Ptr, noL, noL);
MATRIX_FREE(here->CPLibr2Ibr1Ptr, noL, noL);
for (m = 0; m < noL; m++) { for (m = 0; m < noL; m++) {

8
src/spicelib/devices/csw/cswacld.c

@ -36,10 +36,10 @@ CSWacLoad(GENmodel *inModel, CKTcircuit *ckt)
g_now = current_state?(model->CSWonConduct):(model->CSWoffConduct); g_now = current_state?(model->CSWonConduct):(model->CSWoffConduct);
*(here->CSWposPosptr) += g_now;
*(here->CSWposNegptr) -= g_now;
*(here->CSWnegPosptr) -= g_now;
*(here->CSWnegNegptr) += g_now;
*(here->CSWposPosPtr) += g_now;
*(here->CSWposNegPtr) -= g_now;
*(here->CSWnegPosPtr) -= g_now;
*(here->CSWnegNegPtr) += g_now;
} }
} }
return(OK); return(OK);

8
src/spicelib/devices/csw/cswdefs.h

@ -31,13 +31,13 @@ typedef struct sCSWinstance {
IFuid CSWcontName; /* name of controlling source */ IFuid CSWcontName; /* name of controlling source */
double *CSWposPosptr; /* pointer to sparse matrix diagonal at
double *CSWposPosPtr; /* pointer to sparse matrix diagonal at
(positive,positive) for switch conductance */ (positive,positive) for switch conductance */
double *CSWnegPosptr; /* pointer to sparse matrix offdiagonal at
double *CSWnegPosPtr; /* pointer to sparse matrix offdiagonal at
(neagtive,positive) for switch conductance */ (neagtive,positive) for switch conductance */
double *CSWposNegptr; /* pointer to sparse matrix offdiagonal at
double *CSWposNegPtr; /* pointer to sparse matrix offdiagonal at
(positive,neagtive) for switch conductance */ (positive,neagtive) for switch conductance */
double *CSWnegNegptr; /* pointer to sparse matrix diagonal at
double *CSWnegNegPtr; /* pointer to sparse matrix diagonal at
(neagtive,neagtive) for switch conductance */ (neagtive,neagtive) for switch conductance */
double CSWcond; /* current conductance of switch */ double CSWcond; /* current conductance of switch */

8
src/spicelib/devices/csw/cswload.c

@ -144,10 +144,10 @@ CSWload(GENmodel *inModel, CKTcircuit *ckt)
g_now = model->CSWoffConduct; g_now = model->CSWoffConduct;
here->CSWcond = g_now; here->CSWcond = g_now;
*(here->CSWposPosptr) += g_now;
*(here->CSWposNegptr) -= g_now;
*(here->CSWnegPosptr) -= g_now;
*(here->CSWnegNegptr) += g_now;
*(here->CSWposPosPtr) += g_now;
*(here->CSWposNegPtr) -= g_now;
*(here->CSWnegPosPtr) -= g_now;
*(here->CSWnegNegPtr) += g_now;
} }
} }
return(OK); return(OK);

8
src/spicelib/devices/csw/cswpzld.c

@ -40,10 +40,10 @@ CSWpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
g_now = current_state?(model->CSWonConduct):(model->CSWoffConduct); g_now = current_state?(model->CSWonConduct):(model->CSWoffConduct);
*(here->CSWposPosptr) += g_now;
*(here->CSWposNegptr) -= g_now;
*(here->CSWnegPosptr) -= g_now;
*(here->CSWnegNegptr) += g_now;
*(here->CSWposPosPtr) += g_now;
*(here->CSWposNegPtr) -= g_now;
*(here->CSWnegPosPtr) -= g_now;
*(here->CSWnegNegPtr) += g_now;
} }
} }
return(OK); return(OK);

8
src/spicelib/devices/csw/cswsetup.c

@ -61,10 +61,10 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
return(E_NOMEM);\ return(E_NOMEM);\
} } while(0) } } while(0)
TSTALLOC(CSWposPosptr, CSWposNode, CSWposNode);
TSTALLOC(CSWposNegptr, CSWposNode, CSWnegNode);
TSTALLOC(CSWnegPosptr, CSWnegNode, CSWposNode);
TSTALLOC(CSWnegNegptr, CSWnegNode, CSWnegNode);
TSTALLOC(CSWposPosPtr, CSWposNode, CSWposNode);
TSTALLOC(CSWposNegPtr, CSWposNode, CSWnegNode);
TSTALLOC(CSWnegPosPtr, CSWnegNode, CSWposNode);
TSTALLOC(CSWnegNegPtr, CSWnegNode, CSWnegNode);
} }
} }
return(OK); return(OK);

10
src/spicelib/devices/ind/indacld.c

@ -28,11 +28,11 @@ INDacLoad(GENmodel *inModel, CKTcircuit *ckt)
val = ckt->CKTomega * here->INDinduct / m; val = ckt->CKTomega * here->INDinduct / m;
*(here->INDposIbrptr) += 1;
*(here->INDnegIbrptr) -= 1;
*(here->INDibrPosptr) += 1;
*(here->INDibrNegptr) -= 1;
*(here->INDibrIbrptr +1) -= val;
*(here->INDposIbrPtr) += 1;
*(here->INDnegIbrPtr) -= 1;
*(here->INDibrPosPtr) += 1;
*(here->INDibrNegPtr) -= 1;
*(here->INDibrIbrPtr +1) -= val;
} }
} }
return(OK); return(OK);

14
src/spicelib/devices/ind/inddefs.h

@ -46,15 +46,15 @@ struct sINDinstance {
double INDnt; /* Number of turns */ double INDnt; /* Number of turns */
double INDinitCond; /* initial inductor voltage if specified */ double INDinitCond; /* initial inductor voltage if specified */
double *INDposIbrptr; /* pointer to sparse matrix diagonal at
double *INDposIbrPtr; /* pointer to sparse matrix diagonal at
* (positive,branch eq) */ * (positive,branch eq) */
double *INDnegIbrptr; /* pointer to sparse matrix diagonal at
double *INDnegIbrPtr; /* pointer to sparse matrix diagonal at
* (negative,branch eq) */ * (negative,branch eq) */
double *INDibrNegptr; /* pointer to sparse matrix offdiagonal at
double *INDibrNegPtr; /* pointer to sparse matrix offdiagonal at
* (branch eq,negative) */ * (branch eq,negative) */
double *INDibrPosptr; /* pointer to sparse matrix offdiagonal at
double *INDibrPosPtr; /* pointer to sparse matrix offdiagonal at
* (branch eq,positive) */ * (branch eq,positive) */
double *INDibrIbrptr; /* pointer to sparse matrix offdiagonal at
double *INDibrIbrPtr; /* pointer to sparse matrix offdiagonal at
* (branch eq,branch eq) */ * (branch eq,branch eq) */
unsigned INDindGiven : 1; /* flag to indicate inductance was specified */ unsigned INDindGiven : 1; /* flag to indicate inductance was specified */
@ -133,8 +133,8 @@ struct sMUTinstance {
IFuid MUTindName2; /* name of coupled inductor 2 */ IFuid MUTindName2; /* name of coupled inductor 2 */
INDinstance *MUTind1; /* pointer to coupled inductor 1 */ INDinstance *MUTind1; /* pointer to coupled inductor 1 */
INDinstance *MUTind2; /* pointer to coupled inductor 2 */ INDinstance *MUTind2; /* pointer to coupled inductor 2 */
double *MUTbr1br2; /* pointers to off-diagonal intersections of */
double *MUTbr2br1; /* current branch equations in matrix */
double *MUTbr1br2Ptr; /* pointers to off-diagonal intersections of */
double *MUTbr2br1Ptr; /* current branch equations in matrix */
unsigned MUTindGiven : 1; /* flag to indicate inductance was specified */ unsigned MUTindGiven : 1; /* flag to indicate inductance was specified */
int MUTsenParmNo; /* parameter # for sensitivity use; int MUTsenParmNo; /* parameter # for sensitivity use;

14
src/spicelib/devices/ind/indload.c

@ -71,8 +71,8 @@ INDload(GENmodel *inModel, CKTcircuit *ckt)
muthere->MUTind1->INDbrEq); muthere->MUTind1->INDbrEq);
} }
*(muthere->MUTbr1br2) -= muthere->MUTfactor*ckt->CKTag[0];
*(muthere->MUTbr2br1) -= muthere->MUTfactor*ckt->CKTag[0];
*(muthere->MUTbr1br2Ptr) -= muthere->MUTfactor*ckt->CKTag[0];
*(muthere->MUTbr2br1Ptr) -= muthere->MUTfactor*ckt->CKTag[0];
} }
} }
itype = CKTtypelook("Inductor"); itype = CKTtypelook("Inductor");
@ -116,11 +116,11 @@ INDload(GENmodel *inModel, CKTcircuit *ckt)
*(ckt->CKTstate0+here->INDvolt); *(ckt->CKTstate0+here->INDvolt);
} }
*(here->INDposIbrptr) += 1;
*(here->INDnegIbrptr) -= 1;
*(here->INDibrPosptr) += 1;
*(here->INDibrNegptr) -= 1;
*(here->INDibrIbrptr) -= req;
*(here->INDposIbrPtr) += 1;
*(here->INDnegIbrPtr) -= 1;
*(here->INDibrPosPtr) += 1;
*(here->INDibrNegPtr) -= 1;
*(here->INDibrIbrPtr) -= req;
} }
} }
return(OK); return(OK);

12
src/spicelib/devices/ind/indpzld.c

@ -29,12 +29,12 @@ INDpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
val = here->INDinduct / here->INDm; val = here->INDinduct / here->INDm;
*(here->INDposIbrptr) += 1;
*(here->INDnegIbrptr) -= 1;
*(here->INDibrPosptr) += 1;
*(here->INDibrNegptr) -= 1;
*(here->INDibrIbrptr ) -= val * s->real;
*(here->INDibrIbrptr +1) -= val * s->imag;
*(here->INDposIbrPtr) += 1;
*(here->INDnegIbrPtr) -= 1;
*(here->INDibrPosPtr) += 1;
*(here->INDibrNegPtr) -= 1;
*(here->INDibrIbrPtr ) -= val * s->real;
*(here->INDibrIbrPtr +1) -= val * s->imag;
} }
} }
return(OK); return(OK);

10
src/spicelib/devices/ind/indsetup.c

@ -96,11 +96,11 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
return(E_NOMEM);\ return(E_NOMEM);\
} } while(0) } } while(0)
TSTALLOC(INDposIbrptr,INDposNode,INDbrEq);
TSTALLOC(INDnegIbrptr,INDnegNode,INDbrEq);
TSTALLOC(INDibrNegptr,INDbrEq,INDnegNode);
TSTALLOC(INDibrPosptr,INDbrEq,INDposNode);
TSTALLOC(INDibrIbrptr,INDbrEq,INDbrEq);
TSTALLOC(INDposIbrPtr,INDposNode,INDbrEq);
TSTALLOC(INDnegIbrPtr,INDnegNode,INDbrEq);
TSTALLOC(INDibrNegPtr,INDbrEq,INDnegNode);
TSTALLOC(INDibrPosPtr,INDbrEq,INDposNode);
TSTALLOC(INDibrIbrPtr,INDbrEq,INDbrEq);
} }
} }
return(OK); return(OK);

4
src/spicelib/devices/ind/mutacld.c

@ -25,8 +25,8 @@ MUTacLoad(GENmodel *inModel, CKTcircuit *ckt)
here = here->MUTnextInstance) { here = here->MUTnextInstance) {
val = ckt->CKTomega * here->MUTfactor; val = ckt->CKTomega * here->MUTfactor;
*(here->MUTbr1br2 +1) -= val;
*(here->MUTbr2br1 +1) -= val;
*(here->MUTbr1br2Ptr +1) -= val;
*(here->MUTbr2br1Ptr +1) -= val;
} }
} }
return(OK); return(OK);

8
src/spicelib/devices/ind/mutpzld.c

@ -29,10 +29,10 @@ MUTpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
here = here->MUTnextInstance) { here = here->MUTnextInstance) {
val = here->MUTfactor; val = here->MUTfactor;
*(here->MUTbr1br2 ) -= val * s->real;
*(here->MUTbr1br2 +1) -= val * s->imag;
*(here->MUTbr2br1 ) -= val * s->real;
*(here->MUTbr2br1 +1) -= val * s->imag;
*(here->MUTbr1br2Ptr ) -= val * s->real;
*(here->MUTbr1br2Ptr +1) -= val * s->imag;
*(here->MUTbr2br1Ptr ) -= val * s->real;
*(here->MUTbr2br1Ptr +1) -= val * s->imag;
} }
} }
return(OK); return(OK);

4
src/spicelib/devices/ind/mutsetup.c

@ -60,8 +60,8 @@ MUTsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
here->MUTname, here->MUTindName2); here->MUTname, here->MUTindName2);
} }
TSTALLOC(MUTbr1br2, MUTind1->INDbrEq, MUTind2->INDbrEq);
TSTALLOC(MUTbr2br1, MUTind2->INDbrEq, MUTind1->INDbrEq);
TSTALLOC(MUTbr1br2Ptr, MUTind1->INDbrEq, MUTind2->INDbrEq);
TSTALLOC(MUTbr2br1Ptr, MUTind2->INDbrEq, MUTind1->INDbrEq);
} }
return(OK); return(OK);

8
src/spicelib/devices/res/resdefs.h

@ -46,13 +46,13 @@ typedef struct sRESinstance {
double RESbv_max; /* Maximum resistor voltage */ double RESbv_max; /* Maximum resistor voltage */
int RESnoisy; /* Set if the resistor generates noise */ int RESnoisy; /* Set if the resistor generates noise */
double RESeffNoiseArea; /* effective resistor area for noise calculation */ double RESeffNoiseArea; /* effective resistor area for noise calculation */
double *RESposPosptr; /* pointer to sparse matrix diagonal at
double *RESposPosPtr; /* pointer to sparse matrix diagonal at
* (positive,positive) */ * (positive,positive) */
double *RESnegNegptr; /* pointer to sparse matrix diagonal at
double *RESnegNegPtr; /* pointer to sparse matrix diagonal at
* (negative,negative) */ * (negative,negative) */
double *RESposNegptr; /* pointer to sparse matrix offdiagonal at
double *RESposNegPtr; /* pointer to sparse matrix offdiagonal at
* (positive,negative) */ * (positive,negative) */
double *RESnegPosptr; /* pointer to sparse matrix offdiagonal at
double *RESnegPosPtr; /* pointer to sparse matrix offdiagonal at
* (negative,positive) */ * (negative,positive) */
unsigned RESresGiven : 1; /* flag to indicate resistance was specified */ unsigned RESresGiven : 1; /* flag to indicate resistance was specified */
unsigned RESwidthGiven : 1; /* flag to indicate width given */ unsigned RESwidthGiven : 1; /* flag to indicate width given */

16
src/spicelib/devices/res/resload.c

@ -31,10 +31,10 @@ RESload(GENmodel *inModel, CKTcircuit *ckt)
m = (here->RESm); m = (here->RESm);
*(here->RESposPosptr) += m * here->RESconduct;
*(here->RESnegNegptr) += m * here->RESconduct;
*(here->RESposNegptr) -= m * here->RESconduct;
*(here->RESnegPosptr) -= m * here->RESconduct;
*(here->RESposPosPtr) += m * here->RESconduct;
*(here->RESnegNegPtr) += m * here->RESconduct;
*(here->RESposNegPtr) -= m * here->RESconduct;
*(here->RESnegPosPtr) -= m * here->RESconduct;
} }
} }
return(OK); return(OK);
@ -64,10 +64,10 @@ RESacload(GENmodel *inModel, CKTcircuit *ckt)
else else
g = here->RESm * here->RESconduct; g = here->RESm * here->RESconduct;
*(here->RESposPosptr) += g;
*(here->RESnegNegptr) += g;
*(here->RESposNegptr) -= g;
*(here->RESnegPosptr) -= g;
*(here->RESposPosPtr) += g;
*(here->RESnegNegPtr) += g;
*(here->RESposNegPtr) -= g;
*(here->RESnegPosPtr) -= g;
} }
} }
return(OK); return(OK);

8
src/spicelib/devices/res/respzld.c

@ -38,10 +38,10 @@ RESpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
else else
g = here->RESm * here->RESconduct; g = here->RESm * here->RESconduct;
*(here->RESposPosptr) += g;
*(here->RESnegNegptr) += g;
*(here->RESposNegptr) -= g;
*(here->RESnegPosptr) -= g;
*(here->RESposPosPtr) += g;
*(here->RESnegNegPtr) += g;
*(here->RESposNegPtr) -= g;
*(here->RESnegPosPtr) -= g;
} }
} }
return(OK); return(OK);

8
src/spicelib/devices/res/ressetup.c

@ -69,10 +69,10 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
return(E_NOMEM);\ return(E_NOMEM);\
} } while(0) } } while(0)
TSTALLOC(RESposPosptr, RESposNode, RESposNode);
TSTALLOC(RESnegNegptr, RESnegNode, RESnegNode);
TSTALLOC(RESposNegptr, RESposNode, RESnegNode);
TSTALLOC(RESnegPosptr, RESnegNode, RESposNode);
TSTALLOC(RESposPosPtr, RESposNode, RESposNode);
TSTALLOC(RESnegNegPtr, RESnegNode, RESnegNode);
TSTALLOC(RESposNegPtr, RESposNode, RESnegNode);
TSTALLOC(RESnegPosPtr, RESnegNode, RESposNode);
} }
} }
return(OK); return(OK);

8
src/spicelib/devices/sw/swacload.c

@ -37,10 +37,10 @@ SWacLoad(GENmodel *inModel, CKTcircuit *ckt)
g_now = current_state?(model->SWonConduct):(model->SWoffConduct); g_now = current_state?(model->SWonConduct):(model->SWoffConduct);
*(here->SWposPosptr) += g_now;
*(here->SWposNegptr) -= g_now;
*(here->SWnegPosptr) -= g_now;
*(here->SWnegNegptr) += g_now;
*(here->SWposPosPtr) += g_now;
*(here->SWposNegPtr) -= g_now;
*(here->SWnegPosPtr) -= g_now;
*(here->SWnegNegPtr) += g_now;
} }
} }
return(OK); return(OK);

8
src/spicelib/devices/sw/swdefs.h

@ -30,13 +30,13 @@ typedef struct sSWinstance {
int SWposCntrlNode; /* number of positive controlling node of switch */ int SWposCntrlNode; /* number of positive controlling node of switch */
int SWnegCntrlNode; /* number of negative controlling node of switch */ int SWnegCntrlNode; /* number of negative controlling node of switch */
double *SWposPosptr; /* pointer to sparse matrix diagonal at
double *SWposPosPtr; /* pointer to sparse matrix diagonal at
(positive,positive) for switch conductance */ (positive,positive) for switch conductance */
double *SWnegPosptr; /* pointer to sparse matrix offdiagonal at
double *SWnegPosPtr; /* pointer to sparse matrix offdiagonal at
(neagtive,positive) for switch conductance */ (neagtive,positive) for switch conductance */
double *SWposNegptr; /* pointer to sparse matrix offdiagonal at
double *SWposNegPtr; /* pointer to sparse matrix offdiagonal at
(positive,neagtive) for switch conductance */ (positive,neagtive) for switch conductance */
double *SWnegNegptr; /* pointer to sparse matrix diagonal at
double *SWnegNegPtr; /* pointer to sparse matrix diagonal at
(neagtive,neagtive) for switch conductance */ (neagtive,neagtive) for switch conductance */
double SWcond; /* conductance of the switch now */ double SWcond; /* conductance of the switch now */

8
src/spicelib/devices/sw/swload.c

@ -146,10 +146,10 @@ SWload(GENmodel *inModel, CKTcircuit *ckt)
g_now = model->SWoffConduct; g_now = model->SWoffConduct;
here->SWcond = g_now; here->SWcond = g_now;
*(here->SWposPosptr) += g_now;
*(here->SWposNegptr) -= g_now;
*(here->SWnegPosptr) -= g_now;
*(here->SWnegNegptr) += g_now;
*(here->SWposPosPtr) += g_now;
*(here->SWposNegPtr) -= g_now;
*(here->SWnegPosPtr) -= g_now;
*(here->SWnegNegPtr) += g_now;
} }
} }
return(OK); return(OK);

8
src/spicelib/devices/sw/swpzload.c

@ -41,10 +41,10 @@ SWpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
g_now = current_state?(model->SWonConduct):(model->SWoffConduct); g_now = current_state?(model->SWonConduct):(model->SWoffConduct);
*(here->SWposPosptr) += g_now;
*(here->SWposNegptr) -= g_now;
*(here->SWnegPosptr) -= g_now;
*(here->SWnegNegptr) += g_now;
*(here->SWposPosPtr) += g_now;
*(here->SWposNegPtr) -= g_now;
*(here->SWnegPosPtr) -= g_now;
*(here->SWnegNegPtr) += g_now;
} }
} }
return(OK); return(OK);

8
src/spicelib/devices/sw/swsetup.c

@ -56,10 +56,10 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
return(E_NOMEM);\ return(E_NOMEM);\
} } while(0) } } while(0)
TSTALLOC(SWposPosptr, SWposNode, SWposNode);
TSTALLOC(SWposNegptr, SWposNode, SWnegNode);
TSTALLOC(SWnegPosptr, SWnegNode, SWposNode);
TSTALLOC(SWnegNegptr, SWnegNode, SWnegNode);
TSTALLOC(SWposPosPtr, SWposNode, SWposNode);
TSTALLOC(SWposNegPtr, SWposNode, SWnegNode);
TSTALLOC(SWnegPosPtr, SWnegNode, SWposNode);
TSTALLOC(SWnegNegPtr, SWnegNode, SWnegNode);
} }
} }
return(OK); return(OK);

28
src/spicelib/devices/txl/txldefs.h

@ -29,20 +29,20 @@ typedef struct sTXLinstance {
char *out_node_name; char *out_node_name;
int TXLbranch; /* unused */ int TXLbranch; /* unused */
double *TXLposPosptr;
double *TXLposNegptr;
double *TXLnegPosptr;
double *TXLnegNegptr;
double *TXLibr1Posptr;
double *TXLibr2Negptr;
double *TXLposIbr1ptr;
double *TXLnegIbr2ptr;
double *TXLibr1Negptr;
double *TXLibr2Posptr;
double *TXLibr1Ibr1ptr;
double *TXLibr2Ibr2ptr;
double *TXLibr1Ibr2ptr;
double *TXLibr2Ibr1ptr;
double *TXLposPosPtr;
double *TXLposNegPtr;
double *TXLnegPosPtr;
double *TXLnegNegPtr;
double *TXLibr1PosPtr;
double *TXLibr2NegPtr;
double *TXLposIbr1Ptr;
double *TXLnegIbr2Ptr;
double *TXLibr1NegPtr;
double *TXLibr2PosPtr;
double *TXLibr1Ibr1Ptr;
double *TXLibr2Ibr2Ptr;
double *TXLibr1Ibr2Ptr;
double *TXLibr2Ibr1Ptr;
unsigned TXLibr1Given : 1; unsigned TXLibr1Given : 1;
unsigned TXLibr2Given : 1; unsigned TXLibr2Given : 1;

62
src/spicelib/devices/txl/txlload.c

@ -67,10 +67,10 @@ TXLload(GENmodel *inModel, CKTcircuit *ckt)
tx = here->txline; tx = here->txline;
*here->TXLposPosptr += gmin; /* dc solution */
*here->TXLnegNegptr += gmin;
*here->TXLnegPosptr += gmin;
*here->TXLposNegptr += gmin;
*here->TXLposPosPtr += gmin; /* dc solution */
*here->TXLnegNegPtr += gmin;
*here->TXLnegPosPtr += gmin;
*here->TXLposNegPtr += gmin;
if (cond1 || tx->vi_head == NULL) continue; if (cond1 || tx->vi_head == NULL) continue;
@ -133,13 +133,13 @@ TXLload(GENmodel *inModel, CKTcircuit *ckt)
if (here->TXLlengthgiven) if (here->TXLlengthgiven)
g = model->R * here->TXLlength; g = model->R * here->TXLlength;
else g = model->R * here->TXLmodPtr->length; else g = model->R * here->TXLmodPtr->length;
*(here->TXLposIbr1ptr) += 1.0;
*(here->TXLnegIbr2ptr) += 1.0;
*(here->TXLibr1Ibr1ptr) += 1.0;
*(here->TXLibr1Ibr2ptr) += 1.0;
*(here->TXLibr2Posptr) += 1.0;
*(here->TXLibr2Negptr) -= 1.0;
*(here->TXLibr2Ibr1ptr) -= g;
*(here->TXLposIbr1Ptr) += 1.0;
*(here->TXLnegIbr2Ptr) += 1.0;
*(here->TXLibr1Ibr1Ptr) += 1.0;
*(here->TXLibr1Ibr2Ptr) += 1.0;
*(here->TXLibr2PosPtr) += 1.0;
*(here->TXLibr2NegPtr) -= 1.0;
*(here->TXLibr2Ibr1Ptr) -= g;
continue; continue;
@ -199,19 +199,19 @@ TXLload(GENmodel *inModel, CKTcircuit *ckt)
} }
/* change 6,6 1/18/93 /* change 6,6 1/18/93
*(here->TXLibr1Ibr1ptr) -= 1.0;
*(here->TXLibr2Ibr2ptr) -= 1.0;
*(here->TXLposIbr1ptr) += 1.0;
*(here->TXLnegIbr2ptr) += 1.0;
*(here->TXLibr1Posptr) += tx->sqtCdL + h1 * tx->h1C;
*(here->TXLibr2Negptr) += tx->sqtCdL + h1 * tx->h1C;
*(here->TXLibr1Ibr1Ptr) -= 1.0;
*(here->TXLibr2Ibr2Ptr) -= 1.0;
*(here->TXLposIbr1Ptr) += 1.0;
*(here->TXLnegIbr2Ptr) += 1.0;
*(here->TXLibr1PosPtr) += tx->sqtCdL + h1 * tx->h1C;
*(here->TXLibr2NegPtr) += tx->sqtCdL + h1 * tx->h1C;
*/ */
*(here->TXLibr1Ibr1ptr) = -1.0;
*(here->TXLibr2Ibr2ptr) = -1.0;
*(here->TXLposIbr1ptr) = 1.0;
*(here->TXLnegIbr2ptr) = 1.0;
*(here->TXLibr1Posptr) = tx->sqtCdL + h1 * tx->h1C;
*(here->TXLibr2Negptr) = tx->sqtCdL + h1 * tx->h1C;
*(here->TXLibr1Ibr1Ptr) = -1.0;
*(here->TXLibr2Ibr2Ptr) = -1.0;
*(here->TXLposIbr1Ptr) = 1.0;
*(here->TXLnegIbr2Ptr) = 1.0;
*(here->TXLibr1PosPtr) = tx->sqtCdL + h1 * tx->h1C;
*(here->TXLibr2NegPtr) = tx->sqtCdL + h1 * tx->h1C;
k = here->TXLibr1; k = here->TXLibr1;
l = here->TXLibr2; l = here->TXLibr2;
@ -221,11 +221,11 @@ TXLload(GENmodel *inModel, CKTcircuit *ckt)
if (right_consts_txl(tx2, time, time2, h, h1, k, l, ckt)) { if (right_consts_txl(tx2, time, time2, h, h1, k, l, ckt)) {
if (tx->lsl) { if (tx->lsl) {
f = ratio[0] * tx->h3_aten; f = ratio[0] * tx->h3_aten;
*(here->TXLibr1Negptr) = -f;
*(here->TXLibr2Posptr) = -f;
*(here->TXLibr1NegPtr) = -f;
*(here->TXLibr2PosPtr) = -f;
f = ratio[0] * tx->h2_aten; f = ratio[0] * tx->h2_aten;
*(here->TXLibr1Ibr2ptr) = -f;
*(here->TXLibr2Ibr1ptr) = -f;
*(here->TXLibr1Ibr2Ptr) = -f;
*(here->TXLibr2Ibr1Ptr) = -f;
} }
else { else {
tx->ext = 1; tx->ext = 1;
@ -235,13 +235,13 @@ TXLload(GENmodel *inModel, CKTcircuit *ckt)
+ tx->h3_term[1].c + tx->h3_term[2].c + tx->h3_term[1].c + tx->h3_term[2].c
+ tx->h3_term[3].c + tx->h3_term[4].c + tx->h3_term[3].c + tx->h3_term[4].c
+ tx->h3_term[5].c ) + tx->h3_aten); + tx->h3_term[5].c ) + tx->h3_aten);
*(here->TXLibr1Negptr) = -f;
*(here->TXLibr2Posptr) = -f;
*(here->TXLibr1NegPtr) = -f;
*(here->TXLibr2PosPtr) = -f;
f = ratio[0] * (h1 * ( tx->h2_term[0].c f = ratio[0] * (h1 * ( tx->h2_term[0].c
+ tx->h2_term[1].c + tx->h2_term[2].c ) + tx->h2_term[1].c + tx->h2_term[2].c )
+ tx->h2_aten); + tx->h2_aten);
*(here->TXLibr1Ibr2ptr) = -f;
*(here->TXLibr2Ibr1ptr) = -f;
*(here->TXLibr1Ibr2Ptr) = -f;
*(here->TXLibr2Ibr1Ptr) = -f;
} }
} }
} }

28
src/spicelib/devices/txl/txlsetup.c

@ -134,20 +134,20 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
here->TXLibr2 = tmp->number; here->TXLibr2 = tmp->number;
} }
TSTALLOC(TXLposPosptr, TXLposNode, TXLposNode);
TSTALLOC(TXLposNegptr, TXLposNode, TXLnegNode);
TSTALLOC(TXLnegPosptr, TXLnegNode, TXLposNode);
TSTALLOC(TXLnegNegptr, TXLnegNode, TXLnegNode);
TSTALLOC(TXLibr1Posptr, TXLibr1, TXLposNode);
TSTALLOC(TXLibr2Negptr, TXLibr2, TXLnegNode);
TSTALLOC(TXLnegIbr2ptr, TXLnegNode, TXLibr2);
TSTALLOC(TXLposIbr1ptr, TXLposNode, TXLibr1);
TSTALLOC(TXLibr1Ibr1ptr, TXLibr1, TXLibr1);
TSTALLOC(TXLibr2Ibr2ptr, TXLibr2, TXLibr2);
TSTALLOC(TXLibr1Negptr, TXLibr1, TXLnegNode);
TSTALLOC(TXLibr2Posptr, TXLibr2, TXLposNode);
TSTALLOC(TXLibr1Ibr2ptr, TXLibr1, TXLibr2);
TSTALLOC(TXLibr2Ibr1ptr, TXLibr2, TXLibr1);
TSTALLOC(TXLposPosPtr, TXLposNode, TXLposNode);
TSTALLOC(TXLposNegPtr, TXLposNode, TXLnegNode);
TSTALLOC(TXLnegPosPtr, TXLnegNode, TXLposNode);
TSTALLOC(TXLnegNegPtr, TXLnegNode, TXLnegNode);
TSTALLOC(TXLibr1PosPtr, TXLibr1, TXLposNode);
TSTALLOC(TXLibr2NegPtr, TXLibr2, TXLnegNode);
TSTALLOC(TXLnegIbr2Ptr, TXLnegNode, TXLibr2);
TSTALLOC(TXLposIbr1Ptr, TXLposNode, TXLibr1);
TSTALLOC(TXLibr1Ibr1Ptr, TXLibr1, TXLibr1);
TSTALLOC(TXLibr2Ibr2Ptr, TXLibr2, TXLibr2);
TSTALLOC(TXLibr1NegPtr, TXLibr1, TXLnegNode);
TSTALLOC(TXLibr2PosPtr, TXLibr2, TXLposNode);
TSTALLOC(TXLibr1Ibr2Ptr, TXLibr1, TXLibr2);
TSTALLOC(TXLibr2Ibr1Ptr, TXLibr2, TXLibr1);
here->in_node_name = CKTnodName(ckt,here->TXLposNode); here->in_node_name = CKTnodName(ckt,here->TXLposNode);
here->out_node_name = CKTnodName(ckt,here->TXLnegNode); here->out_node_name = CKTnodName(ckt,here->TXLnegNode);

8
src/spicelib/devices/vccs/vccsdefs.h

@ -33,13 +33,13 @@ typedef struct sVCCSinstance {
double VCCScoeff; /* coefficient */ double VCCScoeff; /* coefficient */
double VCCSmValue; /* Parallel multiplier */ double VCCSmValue; /* Parallel multiplier */
double *VCCSposContPosptr; /* pointer to sparse matrix element at
double *VCCSposContPosPtr; /* pointer to sparse matrix element at
* (positive node, control positive node) */ * (positive node, control positive node) */
double *VCCSposContNegptr; /* pointer to sparse matrix element at
double *VCCSposContNegPtr; /* pointer to sparse matrix element at
* (negative node, control negative node) */ * (negative node, control negative node) */
double *VCCSnegContPosptr; /* pointer to sparse matrix element at
double *VCCSnegContPosPtr; /* pointer to sparse matrix element at
* (positive node, control positive node) */ * (positive node, control positive node) */
double *VCCSnegContNegptr; /* pointer to sparse matrix element at
double *VCCSnegContNegPtr; /* pointer to sparse matrix element at
* (negative node, control negative node) */ * (negative node, control negative node) */
unsigned VCCScoeffGiven :1 ;/* flag to indicate function coeffs given */ unsigned VCCScoeffGiven :1 ;/* flag to indicate function coeffs given */
unsigned VCCSmGiven :1 ;/* flag to indicate multiplier given */ unsigned VCCSmGiven :1 ;/* flag to indicate multiplier given */

8
src/spicelib/devices/vccs/vccsload.c

@ -31,10 +31,10 @@ VCCSload(GENmodel *inModel, CKTcircuit *ckt)
for (here = model->VCCSinstances; here != NULL ; for (here = model->VCCSinstances; here != NULL ;
here=here->VCCSnextInstance) { here=here->VCCSnextInstance) {
*(here->VCCSposContPosptr) += here->VCCScoeff ;
*(here->VCCSposContNegptr) -= here->VCCScoeff ;
*(here->VCCSnegContPosptr) -= here->VCCScoeff ;
*(here->VCCSnegContNegptr) += here->VCCScoeff ;
*(here->VCCSposContPosPtr) += here->VCCScoeff ;
*(here->VCCSposContNegPtr) -= here->VCCScoeff ;
*(here->VCCSnegContPosPtr) -= here->VCCScoeff ;
*(here->VCCSnegContNegPtr) += here->VCCScoeff ;
} }
} }
return(OK); return(OK);

8
src/spicelib/devices/vccs/vccspzld.c

@ -33,10 +33,10 @@ VCCSpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
for (here = model->VCCSinstances; here != NULL ; for (here = model->VCCSinstances; here != NULL ;
here=here->VCCSnextInstance) { here=here->VCCSnextInstance) {
*(here->VCCSposContPosptr) += here->VCCScoeff ;
*(here->VCCSposContNegptr) -= here->VCCScoeff ;
*(here->VCCSnegContPosptr) -= here->VCCScoeff ;
*(here->VCCSnegContNegptr) += here->VCCScoeff ;
*(here->VCCSposContPosPtr) += here->VCCScoeff ;
*(here->VCCSposContNegPtr) -= here->VCCScoeff ;
*(here->VCCSnegContPosPtr) -= here->VCCScoeff ;
*(here->VCCSnegContNegPtr) += here->VCCScoeff ;
} }
} }
return(OK); return(OK);

8
src/spicelib/devices/vccs/vccsset.c

@ -40,10 +40,10 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
return(E_NOMEM);\ return(E_NOMEM);\
} } while(0) } } while(0)
TSTALLOC(VCCSposContPosptr, VCCSposNode, VCCScontPosNode);
TSTALLOC(VCCSposContNegptr, VCCSposNode, VCCScontNegNode);
TSTALLOC(VCCSnegContPosptr, VCCSnegNode, VCCScontPosNode);
TSTALLOC(VCCSnegContNegptr, VCCSnegNode, VCCScontNegNode);
TSTALLOC(VCCSposContPosPtr, VCCSposNode, VCCScontPosNode);
TSTALLOC(VCCSposContNegPtr, VCCSposNode, VCCScontNegNode);
TSTALLOC(VCCSnegContPosPtr, VCCSnegNode, VCCScontPosNode);
TSTALLOC(VCCSnegContNegPtr, VCCSnegNode, VCCScontNegNode);
} }
} }
return(OK); return(OK);

12
src/spicelib/devices/vcvs/vcvsdefs.h

@ -34,17 +34,17 @@ typedef struct sVCVSinstance {
double VCVSinitCond; /* initial condition (of controlling source) */ double VCVSinitCond; /* initial condition (of controlling source) */
double VCVScoeff; /* coefficient */ double VCVScoeff; /* coefficient */
double *VCVSposIbrptr; /* pointer to sparse matrix element at
double *VCVSposIbrPtr; /* pointer to sparse matrix element at
* (positive node, branch equation) */ * (positive node, branch equation) */
double *VCVSnegIbrptr; /* pointer to sparse matrix element at
double *VCVSnegIbrPtr; /* pointer to sparse matrix element at
* (negative node, branch equation) */ * (negative node, branch equation) */
double *VCVSibrPosptr; /* pointer to sparse matrix element at
double *VCVSibrPosPtr; /* pointer to sparse matrix element at
* (branch equation, positive node) */ * (branch equation, positive node) */
double *VCVSibrNegptr; /* pointer to sparse matrix element at
double *VCVSibrNegPtr; /* pointer to sparse matrix element at
* (branch equation, negative node) */ * (branch equation, negative node) */
double *VCVSibrContPosptr; /* pointer to sparse matrix element at
double *VCVSibrContPosPtr; /* pointer to sparse matrix element at
*(branch equation, control positive node)*/ *(branch equation, control positive node)*/
double *VCVSibrContNegptr; /* pointer to sparse matrix element at
double *VCVSibrContNegPtr; /* pointer to sparse matrix element at
*(branch equation, control negative node)*/ *(branch equation, control negative node)*/
unsigned VCVScoeffGiven :1 ;/* flag to indicate function coeffs given */ unsigned VCVScoeffGiven :1 ;/* flag to indicate function coeffs given */

12
src/spicelib/devices/vcvs/vcvsload.c

@ -31,12 +31,12 @@ VCVSload(GENmodel *inModel, CKTcircuit *ckt)
for (here = model->VCVSinstances; here != NULL ; for (here = model->VCVSinstances; here != NULL ;
here=here->VCVSnextInstance) { here=here->VCVSnextInstance) {
*(here->VCVSposIbrptr) += 1.0 ;
*(here->VCVSnegIbrptr) -= 1.0 ;
*(here->VCVSibrPosptr) += 1.0 ;
*(here->VCVSibrNegptr) -= 1.0 ;
*(here->VCVSibrContPosptr) -= here->VCVScoeff ;
*(here->VCVSibrContNegptr) += here->VCVScoeff ;
*(here->VCVSposIbrPtr) += 1.0 ;
*(here->VCVSnegIbrPtr) -= 1.0 ;
*(here->VCVSibrPosPtr) += 1.0 ;
*(here->VCVSibrNegPtr) -= 1.0 ;
*(here->VCVSibrContPosPtr) -= here->VCVScoeff ;
*(here->VCVSibrContNegPtr) += here->VCVScoeff ;
} }
} }
return(OK); return(OK);

12
src/spicelib/devices/vcvs/vcvspzld.c

@ -33,12 +33,12 @@ VCVSpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
for (here = model->VCVSinstances; here != NULL ; for (here = model->VCVSinstances; here != NULL ;
here=here->VCVSnextInstance) { here=here->VCVSnextInstance) {
*(here->VCVSposIbrptr) += 1.0 ;
*(here->VCVSnegIbrptr) -= 1.0 ;
*(here->VCVSibrPosptr) += 1.0 ;
*(here->VCVSibrNegptr) -= 1.0 ;
*(here->VCVSibrContPosptr) -= here->VCVScoeff ;
*(here->VCVSibrContNegptr) += here->VCVScoeff ;
*(here->VCVSposIbrPtr) += 1.0 ;
*(here->VCVSnegIbrPtr) -= 1.0 ;
*(here->VCVSibrPosPtr) += 1.0 ;
*(here->VCVSibrNegPtr) -= 1.0 ;
*(here->VCVSibrContPosPtr) -= here->VCVScoeff ;
*(here->VCVSibrContNegPtr) += here->VCVScoeff ;
} }
} }
return(OK); return(OK);

12
src/spicelib/devices/vcvs/vcvsset.c

@ -50,12 +50,12 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
return(E_NOMEM);\ return(E_NOMEM);\
} } while(0) } } while(0)
TSTALLOC(VCVSposIbrptr, VCVSposNode, VCVSbranch);
TSTALLOC(VCVSnegIbrptr, VCVSnegNode, VCVSbranch);
TSTALLOC(VCVSibrPosptr, VCVSbranch, VCVSposNode);
TSTALLOC(VCVSibrNegptr, VCVSbranch, VCVSnegNode);
TSTALLOC(VCVSibrContPosptr, VCVSbranch, VCVScontPosNode);
TSTALLOC(VCVSibrContNegptr, VCVSbranch, VCVScontNegNode);
TSTALLOC(VCVSposIbrPtr, VCVSposNode, VCVSbranch);
TSTALLOC(VCVSnegIbrPtr, VCVSnegNode, VCVSbranch);
TSTALLOC(VCVSibrPosPtr, VCVSbranch, VCVSposNode);
TSTALLOC(VCVSibrNegPtr, VCVSbranch, VCVSnegNode);
TSTALLOC(VCVSibrContPosPtr, VCVSbranch, VCVScontPosNode);
TSTALLOC(VCVSibrContNegPtr, VCVSbranch, VCVScontNegNode);
} }
} }
return(OK); return(OK);

8
src/spicelib/devices/vsrc/vsrcacld.c

@ -37,10 +37,10 @@ VSRCacLoad(GENmodel *inModel, CKTcircuit *ckt)
acImag = here->VSRCacImag; acImag = here->VSRCacImag;
} }
*(here->VSRCposIbrptr) += 1.0 ;
*(here->VSRCnegIbrptr) -= 1.0 ;
*(here->VSRCibrPosptr) += 1.0 ;
*(here->VSRCibrNegptr) -= 1.0 ;
*(here->VSRCposIbrPtr) += 1.0 ;
*(here->VSRCnegIbrPtr) -= 1.0 ;
*(here->VSRCibrPosPtr) += 1.0 ;
*(here->VSRCibrNegPtr) -= 1.0 ;
*(ckt->CKTrhs + (here->VSRCbranch)) += acReal; *(ckt->CKTrhs + (here->VSRCbranch)) += acReal;
*(ckt->CKTirhs + (here->VSRCbranch)) += acImag; *(ckt->CKTirhs + (here->VSRCbranch)) += acImag;
} }

10
src/spicelib/devices/vsrc/vsrcdefs.h

@ -55,15 +55,15 @@ typedef struct sVSRCinstance {
double VSRCr; /* pwl repeat */ double VSRCr; /* pwl repeat */
double VSRCrdelay; /* pwl delay period */ double VSRCrdelay; /* pwl delay period */
double *VSRCposIbrptr; /* pointer to sparse matrix element at
double *VSRCposIbrPtr; /* pointer to sparse matrix element at
* (positive node, branch equation) */ * (positive node, branch equation) */
double *VSRCnegIbrptr; /* pointer to sparse matrix element at
double *VSRCnegIbrPtr; /* pointer to sparse matrix element at
* (negative node, branch equation) */ * (negative node, branch equation) */
double *VSRCibrPosptr; /* pointer to sparse matrix element at
double *VSRCibrPosPtr; /* pointer to sparse matrix element at
* (branch equation, positive node) */ * (branch equation, positive node) */
double *VSRCibrNegptr; /* pointer to sparse matrix element at
double *VSRCibrNegPtr; /* pointer to sparse matrix element at
* (branch equation, negative node) */ * (branch equation, negative node) */
double *VSRCibrIbrptr; /* pointer to sparse matrix element at
double *VSRCibrIbrPtr; /* pointer to sparse matrix element at
* (branch equation, branch equation) */ * (branch equation, branch equation) */
unsigned VSRCdcGiven :1 ; /* flag to indicate dc value given */ unsigned VSRCdcGiven :1 ; /* flag to indicate dc value given */
unsigned VSRCacGiven :1 ; /* flag to indicate ac keyword given */ unsigned VSRCacGiven :1 ; /* flag to indicate ac keyword given */

8
src/spicelib/devices/vsrc/vsrcload.c

@ -40,10 +40,10 @@ VSRCload(GENmodel *inModel, CKTcircuit *ckt)
for (here = model->VSRCinstances; here != NULL ; for (here = model->VSRCinstances; here != NULL ;
here=here->VSRCnextInstance) { here=here->VSRCnextInstance) {
*(here->VSRCposIbrptr) += 1.0 ;
*(here->VSRCnegIbrptr) -= 1.0 ;
*(here->VSRCibrPosptr) += 1.0 ;
*(here->VSRCibrNegptr) -= 1.0 ;
*(here->VSRCposIbrPtr) += 1.0 ;
*(here->VSRCnegIbrPtr) -= 1.0 ;
*(here->VSRCibrPosPtr) += 1.0 ;
*(here->VSRCibrNegPtr) -= 1.0 ;
if( (ckt->CKTmode & (MODEDCOP | MODEDCTRANCURVE)) && if( (ckt->CKTmode & (MODEDCOP | MODEDCTRANCURVE)) &&
here->VSRCdcGiven ) { here->VSRCdcGiven ) {
/* load using DC value */ /* load using DC value */

14
src/spicelib/devices/vsrc/vsrcpzld.c

@ -29,18 +29,18 @@ VSRCpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
if (!(here->VSRCacGiven)) { if (!(here->VSRCacGiven)) {
/*a dc source*/ /*a dc source*/
/*the connecting nodes are shorted*/ /*the connecting nodes are shorted*/
*(here->VSRCposIbrptr) += 1.0 ;
*(here->VSRCnegIbrptr) += -1.0 ;
*(here->VSRCibrPosptr) += 1.0 ;
*(here->VSRCibrNegptr) += -1.0 ;
*(here->VSRCposIbrPtr) += 1.0 ;
*(here->VSRCnegIbrPtr) += -1.0 ;
*(here->VSRCibrPosPtr) += 1.0 ;
*(here->VSRCibrNegPtr) += -1.0 ;
} else { } else {
/*an ac source*/ /*an ac source*/
/*no effective contribution /*no effective contribution
*diagonal element made 1 *diagonal element made 1
*/ */
*(here->VSRCposIbrptr) += 1.0 ;
*(here->VSRCnegIbrptr) += -1.0 ;
*(here->VSRCibrIbrptr) += 1.0 ;
*(here->VSRCposIbrPtr) += 1.0 ;
*(here->VSRCnegIbrPtr) += -1.0 ;
*(here->VSRCibrIbrPtr) += 1.0 ;
} }
} }
} }

10
src/spicelib/devices/vsrc/vsrcpzs.c

@ -42,11 +42,11 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
return(E_NOMEM);\ return(E_NOMEM);\
} } while(0) } } while(0)
TSTALLOC(VSRCposIbrptr, VSRCposNode, VSRCbranch);
TSTALLOC(VSRCnegIbrptr, VSRCnegNode, VSRCbranch);
TSTALLOC(VSRCibrNegptr, VSRCbranch, VSRCnegNode);
TSTALLOC(VSRCibrPosptr, VSRCbranch, VSRCposNode);
TSTALLOC(VSRCibrIbrptr, VSRCbranch, VSRCbranch);
TSTALLOC(VSRCposIbrPtr, VSRCposNode, VSRCbranch);
TSTALLOC(VSRCnegIbrPtr, VSRCnegNode, VSRCbranch);
TSTALLOC(VSRCibrNegPtr, VSRCbranch, VSRCnegNode);
TSTALLOC(VSRCibrPosPtr, VSRCbranch, VSRCposNode);
TSTALLOC(VSRCibrIbrPtr, VSRCbranch, VSRCbranch);
} }
} }
return(OK); return(OK);

8
src/spicelib/devices/vsrc/vsrcset.c

@ -49,10 +49,10 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
return(E_NOMEM);\ return(E_NOMEM);\
} } while(0) } } while(0)
TSTALLOC(VSRCposIbrptr, VSRCposNode, VSRCbranch);
TSTALLOC(VSRCnegIbrptr, VSRCnegNode, VSRCbranch);
TSTALLOC(VSRCibrNegptr, VSRCbranch, VSRCnegNode);
TSTALLOC(VSRCibrPosptr, VSRCbranch, VSRCposNode);
TSTALLOC(VSRCposIbrPtr, VSRCposNode, VSRCbranch);
TSTALLOC(VSRCnegIbrPtr, VSRCnegNode, VSRCbranch);
TSTALLOC(VSRCibrNegPtr, VSRCbranch, VSRCnegNode);
TSTALLOC(VSRCibrPosPtr, VSRCbranch, VSRCposNode);
} }
} }
return(OK); return(OK);

Loading…
Cancel
Save