use `SWAP' macro
This commit is contained in:
parent
b36385e333
commit
bd0bc3038b
|
|
@ -378,9 +378,7 @@ com_compose(wordlist *wl)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (startgiven && stopgiven && (start > stop)) {
|
if (startgiven && stopgiven && (start > stop)) {
|
||||||
tt = start;
|
SWAP(double, start, stop);
|
||||||
start = stop;
|
|
||||||
stop = tt;
|
|
||||||
reverse = TRUE;
|
reverse = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1232,9 +1232,7 @@ measure_parse_stdParams(
|
||||||
/* dc: make m_from always less than m_to */
|
/* dc: make m_from always less than m_to */
|
||||||
if (cieq("dc", meas->m_analysis))
|
if (cieq("dc", meas->m_analysis))
|
||||||
if (meas->m_to < meas->m_from) {
|
if (meas->m_to < meas->m_from) {
|
||||||
double tmp_val = meas->m_to;
|
SWAP(double, meas->m_to, meas->m_from);
|
||||||
meas->m_to = meas->m_from;
|
|
||||||
meas->m_from = tmp_val;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
||||||
|
|
@ -597,9 +597,7 @@ op_range(struct pnode *arg1, struct pnode *arg2)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (up < low) {
|
if (up < low) {
|
||||||
td = up;
|
SWAP(double, up, low);
|
||||||
up = low;
|
|
||||||
low = td;
|
|
||||||
rev = TRUE;
|
rev = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -727,9 +725,7 @@ op_ind(struct pnode *arg1, struct pnode *arg2)
|
||||||
up = (int)floor(imagpart(ind->v_compdata[0]) + 0.5);
|
up = (int)floor(imagpart(ind->v_compdata[0]) + 0.5);
|
||||||
}
|
}
|
||||||
if (up < down) {
|
if (up < down) {
|
||||||
i = up;
|
SWAP(int, up, down);
|
||||||
up = down;
|
|
||||||
down = i;
|
|
||||||
rev = TRUE;
|
rev = TRUE;
|
||||||
}
|
}
|
||||||
if (up < 0) {
|
if (up < 0) {
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,6 @@ clip_to_circle(int *x1, int *y1, int *x2, int *y2, int cx, int cy, int rad)
|
||||||
double dtheta;
|
double dtheta;
|
||||||
double theta1, theta2, tt, alpha, beta, gamma;
|
double theta1, theta2, tt, alpha, beta, gamma;
|
||||||
bool flip = FALSE;
|
bool flip = FALSE;
|
||||||
int i;
|
|
||||||
|
|
||||||
/* Get the angles between the origin and the endpoints. */
|
/* Get the angles between the origin and the endpoints. */
|
||||||
if ((*x1-cx) || (*y1-cy))
|
if ((*x1-cx) || (*y1-cy))
|
||||||
|
|
@ -131,15 +130,9 @@ clip_to_circle(int *x1, int *y1, int *x2, int *y2, int cx, int cy, int rad)
|
||||||
|
|
||||||
/* Make sure that p1 is the first point */
|
/* Make sure that p1 is the first point */
|
||||||
if (dtheta < 0) {
|
if (dtheta < 0) {
|
||||||
tt = theta1;
|
SWAP(double, theta1, theta2);
|
||||||
theta1 = theta2;
|
SWAP(int, *x1, *x2);
|
||||||
theta2 = tt;
|
SWAP(int, *y1, *y2);
|
||||||
i = *x1;
|
|
||||||
*x1 = *x2;
|
|
||||||
*x2 = i;
|
|
||||||
i = *y1;
|
|
||||||
*y1 = *y2;
|
|
||||||
*y2 = i;
|
|
||||||
flip = TRUE;
|
flip = TRUE;
|
||||||
dtheta = -dtheta;
|
dtheta = -dtheta;
|
||||||
}
|
}
|
||||||
|
|
@ -209,12 +202,8 @@ clip_to_circle(int *x1, int *y1, int *x2, int *y2, int cx, int cy, int rad)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flip) {
|
if (flip) {
|
||||||
i = *x1;
|
SWAP(int, *x1, *x2);
|
||||||
*x1 = *x2;
|
SWAP(int, *y1, *y2);
|
||||||
*x2 = i;
|
|
||||||
i = *y1;
|
|
||||||
*y1 = *y2;
|
|
||||||
*y2 = i;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
|
|
|
||||||
|
|
@ -1491,10 +1491,7 @@ cliparc(double cx, double cy, double rad, double start, double end, int iclipx,
|
||||||
|
|
||||||
if (in) {
|
if (in) {
|
||||||
if (start > d) {
|
if (start > d) {
|
||||||
double tmp;
|
SWAP(double, start, d);
|
||||||
tmp = start;
|
|
||||||
start = d;
|
|
||||||
d = tmp;
|
|
||||||
}
|
}
|
||||||
DevDrawArc((int)cx, (int)cy, (int)rad, start, d-start);
|
DevDrawArc((int)cx, (int)cy, (int)rad, start, d-start);
|
||||||
sclip = start;
|
sclip = start;
|
||||||
|
|
|
||||||
|
|
@ -219,7 +219,6 @@ plotit(wordlist *wl, char *hcopy, char *devname)
|
||||||
struct dvec *d = NULL, *vecs = NULL, *lv, *lastvs = NULL;
|
struct dvec *d = NULL, *vecs = NULL, *lv, *lastvs = NULL;
|
||||||
char *xn;
|
char *xn;
|
||||||
int i, y_type, xt;
|
int i, y_type, xt;
|
||||||
double tt;
|
|
||||||
wordlist *wwl, *tail;
|
wordlist *wwl, *tail;
|
||||||
char *cline = NULL, buf[BSIZE_SP], *pname;
|
char *cline = NULL, buf[BSIZE_SP], *pname;
|
||||||
char *nxlabel = NULL, *nylabel = NULL, *ntitle = NULL;
|
char *nxlabel = NULL, *nylabel = NULL, *ntitle = NULL;
|
||||||
|
|
@ -831,14 +830,10 @@ plotit(wordlist *wl, char *hcopy, char *devname)
|
||||||
ylims[1] = 1.0;
|
ylims[1] = 1.0;
|
||||||
}
|
}
|
||||||
if (xlims[0] > xlims[1]) {
|
if (xlims[0] > xlims[1]) {
|
||||||
tt = xlims[1];
|
SWAP(double, xlims[1], xlims[0]);
|
||||||
xlims[1] = xlims[0];
|
|
||||||
xlims[0] = tt;
|
|
||||||
}
|
}
|
||||||
if (ylims[0] > ylims[1]) {
|
if (ylims[0] > ylims[1]) {
|
||||||
tt = ylims[1];
|
SWAP(double, ylims[1], ylims[0]);
|
||||||
ylims[1] = ylims[0];
|
|
||||||
ylims[0] = tt;
|
|
||||||
}
|
}
|
||||||
if (AlmostEqualUlps(xlims[0], xlims[1], 10)) {
|
if (AlmostEqualUlps(xlims[0], xlims[1], 10)) {
|
||||||
xlims[0] *= (xlims[0] > 0) ? 0.9 : 1.1;
|
xlims[0] *= (xlims[0] > 0) ? 0.9 : 1.1;
|
||||||
|
|
|
||||||
|
|
@ -753,7 +753,7 @@ zoomin(GRAPH *graph)
|
||||||
/* note: need to add circular boxes XXX */
|
/* note: need to add circular boxes XXX */
|
||||||
|
|
||||||
int x0, y0, x1, y1;
|
int x0, y0, x1, y1;
|
||||||
double fx0, fx1, fy0, fy1, ftemp;
|
double fx0, fx1, fy0, fy1;
|
||||||
char buf[BSIZE_SP];
|
char buf[BSIZE_SP];
|
||||||
char buf2[128];
|
char buf2[128];
|
||||||
char *t;
|
char *t;
|
||||||
|
|
@ -811,14 +811,10 @@ zoomin(GRAPH *graph)
|
||||||
X_ScreentoData(graph, x1, y1, &fx1, &fy1);
|
X_ScreentoData(graph, x1, y1, &fx1, &fy1);
|
||||||
|
|
||||||
if (fx0 > fx1) {
|
if (fx0 > fx1) {
|
||||||
ftemp = fx0;
|
SWAP(double, fx0, fx1);
|
||||||
fx0 = fx1;
|
|
||||||
fx1 = ftemp;
|
|
||||||
}
|
}
|
||||||
if (fy0 > fy1) {
|
if (fy0 > fy1) {
|
||||||
ftemp = fy0;
|
SWAP(double, fy0, fy1);
|
||||||
fy0 = fy1;
|
|
||||||
fy1 = ftemp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
strncpy(buf2, graph->plotname, sizeof(buf2));
|
strncpy(buf2, graph->plotname, sizeof(buf2));
|
||||||
|
|
|
||||||
|
|
@ -600,7 +600,7 @@ Sf wk1 [WL], wk2 [WL]; /* Pools of variates. */
|
||||||
static void
|
static void
|
||||||
regen(void)
|
regen(void)
|
||||||
{
|
{
|
||||||
Sw i, j, k, m;
|
Sw i, j, m;
|
||||||
Sf p, q, r, s, t;
|
Sf p, q, r, s, t;
|
||||||
Sw topv[6], ord[4], *top;
|
Sw topv[6], ord[4], *top;
|
||||||
Sf *ppt[4], *ptn;
|
Sf *ppt[4], *ptn;
|
||||||
|
|
@ -626,10 +626,8 @@ reran1:
|
||||||
for (i = 2; i >= 0; i--)
|
for (i = 2; i >= 0; i--)
|
||||||
for (j = 0; j <= i; j++)
|
for (j = 0; j <= i; j++)
|
||||||
if (top[j] < top[j+1]) {
|
if (top[j] < top[j+1]) {
|
||||||
k = top[j]; top[j] = top[j+1];
|
SWAP(Sw, top[j], top[j+1]);
|
||||||
top[j+1] = k;
|
SWAP(Sw, ord[j], ord[j+1]);
|
||||||
k = ord[j]; ord[j] = ord[j+1];
|
|
||||||
ord[j+1] = k;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ensure all different */
|
/* Ensure all different */
|
||||||
|
|
|
||||||
|
|
@ -197,10 +197,8 @@ reran1:
|
||||||
for (i = 2; i >= 0; i--)
|
for (i = 2; i >= 0; i--)
|
||||||
for (j = 0; j <= i; j++)
|
for (j = 0; j <= i; j++)
|
||||||
if (top[j] < top[j+1]) {
|
if (top[j] < top[j+1]) {
|
||||||
k = top[j]; top[j] = top[j+1];
|
SWAP(int, top[j], top[j+1]);
|
||||||
top[j+1] = k;
|
SWAP(int, ord[j], ord[j+1]);
|
||||||
k = ord[j]; ord[j] = ord[j+1];
|
|
||||||
ord[j+1] = k;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ensure all different */
|
/* Ensure all different */
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@ NIacIter(CKTcircuit *ckt)
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
int ignore;
|
int ignore;
|
||||||
double *temp;
|
|
||||||
double startTime;
|
double startTime;
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
|
|
@ -77,13 +76,9 @@ retry:
|
||||||
*ckt->CKTirhsSpare = 0;
|
*ckt->CKTirhsSpare = 0;
|
||||||
*ckt->CKTirhsOld = 0;
|
*ckt->CKTirhsOld = 0;
|
||||||
|
|
||||||
temp = ckt->CKTirhsOld;
|
SWAP(double *, ckt->CKTirhsOld, ckt->CKTirhs);
|
||||||
ckt->CKTirhsOld = ckt->CKTirhs;
|
|
||||||
ckt->CKTirhs = temp;
|
|
||||||
|
|
||||||
temp = ckt->CKTrhsOld;
|
SWAP(double *, ckt->CKTrhsOld, ckt->CKTrhs);
|
||||||
ckt->CKTrhsOld = ckt->CKTrhs;
|
|
||||||
ckt->CKTrhs = temp;
|
|
||||||
|
|
||||||
return(OK);
|
return(OK);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,31 +23,22 @@ NIdIter(CKTcircuit *ckt)
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
int ignore;
|
int ignore;
|
||||||
double *temp;
|
|
||||||
|
|
||||||
ckt->CKTnoncon = 0;
|
ckt->CKTnoncon = 0;
|
||||||
goto skip;
|
goto skip;
|
||||||
retry:
|
retry:
|
||||||
ckt->CKTnoncon=0;
|
ckt->CKTnoncon=0;
|
||||||
|
|
||||||
temp = ckt->CKTrhs;
|
SWAP(double *, ckt->CKTrhs, ckt->CKTrhsSpare);
|
||||||
ckt->CKTrhs = ckt->CKTrhsSpare;
|
|
||||||
ckt->CKTrhsSpare = temp;
|
|
||||||
|
|
||||||
temp = ckt->CKTirhs;
|
SWAP(double *, ckt->CKTirhs, ckt->CKTirhsSpare);
|
||||||
ckt->CKTirhs = ckt->CKTirhsSpare;
|
|
||||||
ckt->CKTirhsSpare = temp;
|
|
||||||
|
|
||||||
error = CKTacLoad(ckt);
|
error = CKTacLoad(ckt);
|
||||||
if(error) return(error);
|
if(error) return(error);
|
||||||
|
|
||||||
temp = ckt->CKTrhs;
|
SWAP(double *, ckt->CKTrhs, ckt->CKTrhsSpare);
|
||||||
ckt->CKTrhs = ckt->CKTrhsSpare;
|
|
||||||
ckt->CKTrhsSpare = temp;
|
|
||||||
|
|
||||||
temp = ckt->CKTirhs;
|
SWAP(double *, ckt->CKTirhs, ckt->CKTirhsSpare);
|
||||||
ckt->CKTirhs = ckt->CKTirhsSpare;
|
|
||||||
ckt->CKTirhsSpare = temp;
|
|
||||||
|
|
||||||
skip:
|
skip:
|
||||||
if(ckt->CKTniState & NIACSHOULDREORDER) {
|
if(ckt->CKTniState & NIACSHOULDREORDER) {
|
||||||
|
|
@ -85,12 +76,8 @@ skip:
|
||||||
*ckt->CKTirhsSpare = 0;
|
*ckt->CKTirhsSpare = 0;
|
||||||
*ckt->CKTirhsOld = 0;
|
*ckt->CKTirhsOld = 0;
|
||||||
|
|
||||||
temp = ckt->CKTirhsOld;
|
SWAP(double *, ckt->CKTirhsOld, ckt->CKTirhs);
|
||||||
ckt->CKTirhsOld = ckt->CKTirhs;
|
|
||||||
ckt->CKTirhs = temp;
|
|
||||||
|
|
||||||
temp = ckt->CKTrhsOld;
|
SWAP(double *, ckt->CKTrhsOld, ckt->CKTrhs);
|
||||||
ckt->CKTrhsOld = ckt->CKTrhs;
|
|
||||||
ckt->CKTrhs = temp;
|
|
||||||
return(OK);
|
return(OK);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ NIiter(CKTcircuit *ckt, int maxIter)
|
||||||
int ipass;
|
int ipass;
|
||||||
int error;
|
int error;
|
||||||
int i,j; /* temporaries for finding error location */
|
int i,j; /* temporaries for finding error location */
|
||||||
double *temp;
|
|
||||||
double startTime;
|
double startTime;
|
||||||
static char *msg = "Too many iterations without convergence";
|
static char *msg = "Too many iterations without convergence";
|
||||||
|
|
||||||
|
|
@ -43,9 +42,7 @@ NIiter(CKTcircuit *ckt, int maxIter)
|
||||||
|
|
||||||
|
|
||||||
if( (ckt->CKTmode & MODETRANOP) && (ckt->CKTmode & MODEUIC)) {
|
if( (ckt->CKTmode & MODETRANOP) && (ckt->CKTmode & MODEUIC)) {
|
||||||
temp = ckt->CKTrhsOld;
|
SWAP(double *, ckt->CKTrhsOld, ckt->CKTrhs);
|
||||||
ckt->CKTrhsOld = ckt->CKTrhs;
|
|
||||||
ckt->CKTrhs = temp;
|
|
||||||
error = CKTload(ckt);
|
error = CKTload(ckt);
|
||||||
if(error) {
|
if(error) {
|
||||||
return(error);
|
return(error);
|
||||||
|
|
@ -269,9 +266,7 @@ NIiter(CKTcircuit *ckt, int maxIter)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* build up the lvnim1 array from the lvn array */
|
/* build up the lvnim1 array from the lvn array */
|
||||||
temp = ckt->CKTrhsOld;
|
SWAP(double *, ckt->CKTrhsOld, ckt->CKTrhs);
|
||||||
ckt->CKTrhsOld = ckt->CKTrhs;
|
|
||||||
ckt->CKTrhs = temp;
|
|
||||||
/*printf("after loading, after solving\n");*/
|
/*printf("after loading, after solving\n");*/
|
||||||
/*CKTdump(ckt);*/
|
/*CKTdump(ckt);*/
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,13 +53,9 @@ ft_polyfit(double *xdata, double *ydata, double *result,
|
||||||
if (lindex != i) {
|
if (lindex != i) {
|
||||||
/* swap rows i and lindex */
|
/* swap rows i and lindex */
|
||||||
for (k = 0; k < n; k++) {
|
for (k = 0; k < n; k++) {
|
||||||
d = mat1[i * n + k];
|
SWAP(double, mat1[i * n + k], mat1[lindex * n + k]);
|
||||||
mat1[i * n + k] = mat1[lindex * n + k];
|
|
||||||
mat1[lindex * n + k] = d;
|
|
||||||
}
|
}
|
||||||
d = mat2[i];
|
SWAP(double, mat2[i], mat2[lindex]);
|
||||||
mat2[i] = mat2[lindex];
|
|
||||||
mat2[lindex] = d;
|
|
||||||
}
|
}
|
||||||
/* Make sure we have a non-zero pivot. */
|
/* Make sure we have a non-zero pivot. */
|
||||||
if (mat1[i * n + i] == 0.0) {
|
if (mat1[i * n + i] == 0.0) {
|
||||||
|
|
|
||||||
|
|
@ -151,9 +151,7 @@ wl_reverse(wordlist *wl)
|
||||||
return (wl);
|
return (wl);
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
wordlist *t = wl->wl_next;
|
SWAP(wordlist *, wl->wl_next, wl->wl_prev);
|
||||||
wl->wl_next = wl->wl_prev;
|
|
||||||
wl->wl_prev = t;
|
|
||||||
if (!wl->wl_prev)
|
if (!wl->wl_prev)
|
||||||
return (wl);
|
return (wl);
|
||||||
wl = wl->wl_prev;
|
wl = wl->wl_prev;
|
||||||
|
|
@ -231,14 +229,11 @@ wl_sort(wordlist *wl)
|
||||||
wordlist *
|
wordlist *
|
||||||
wl_range(wordlist *wl, int low, int up)
|
wl_range(wordlist *wl, int low, int up)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
wordlist *tt;
|
wordlist *tt;
|
||||||
bool rev = FALSE;
|
bool rev = FALSE;
|
||||||
|
|
||||||
if (low > up) {
|
if (low > up) {
|
||||||
i = up;
|
SWAP(int, up, low);
|
||||||
up = low;
|
|
||||||
low = i;
|
|
||||||
rev = TRUE;
|
rev = TRUE;
|
||||||
}
|
}
|
||||||
up -= low;
|
up -= low;
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ CKTpzSetup(CKTcircuit *ckt, int type)
|
||||||
|
|
||||||
SMPmatrix *matrix;
|
SMPmatrix *matrix;
|
||||||
int error;
|
int error;
|
||||||
int i, temp, solution_col, balance_col;
|
int i, solution_col, balance_col;
|
||||||
int input_pos, input_neg, output_pos, output_neg;
|
int input_pos, input_neg, output_pos, output_neg;
|
||||||
|
|
||||||
NIdestroy(ckt);
|
NIdestroy(ckt);
|
||||||
|
|
@ -71,9 +71,7 @@ CKTpzSetup(CKTcircuit *ckt, int type)
|
||||||
balance_col = output_neg;
|
balance_col = output_neg;
|
||||||
} else {
|
} else {
|
||||||
solution_col = output_neg;
|
solution_col = output_neg;
|
||||||
temp = input_pos;
|
SWAP(int, input_pos, input_neg);
|
||||||
input_pos = input_neg;
|
|
||||||
input_neg = temp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (input_pos)
|
if (input_pos)
|
||||||
|
|
|
||||||
|
|
@ -12,11 +12,7 @@ Author: 1988 Jaijeet S Roychowdhury
|
||||||
static void
|
static void
|
||||||
DISswap(double **a, double **b)
|
DISswap(double **a, double **b)
|
||||||
{
|
{
|
||||||
double *c;
|
SWAP(double *, *a, *b);
|
||||||
|
|
||||||
c = *a;
|
|
||||||
*a = *b;
|
|
||||||
*b = c;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
|
|
@ -769,9 +769,7 @@ Gaussian_Elimination2(int dims, int type)
|
||||||
}
|
}
|
||||||
if (imax != i)
|
if (imax != i)
|
||||||
for (k = i; k <= dim; k++) {
|
for (k = i; k <= dim; k++) {
|
||||||
f = A[i][k];
|
SWAP(double, A[i][k], A[imax][k]);
|
||||||
A[i][k] = A[imax][k];
|
|
||||||
A[imax][k] = f;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
f = 1.0 / A[i][i];
|
f = 1.0 / A[i][i];
|
||||||
|
|
@ -1699,9 +1697,7 @@ Gaussian_Elimination(int dims)
|
||||||
}
|
}
|
||||||
if (imax != i)
|
if (imax != i)
|
||||||
for (k = i; k <= dim; k++) {
|
for (k = i; k <= dim; k++) {
|
||||||
f = At[i][k];
|
SWAP(double, At[i][k], At[imax][k]);
|
||||||
At[i][k] = At[imax][k];
|
|
||||||
At[imax][k] = f;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
f = 1.0 / At[i][i];
|
f = 1.0 / At[i][i];
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@ JFETdSetup(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
double lcapgs1;
|
double lcapgs1;
|
||||||
double cd;
|
double cd;
|
||||||
double cdrain;
|
double cdrain;
|
||||||
double temp;
|
|
||||||
double cg;
|
double cg;
|
||||||
double cgd;
|
double cgd;
|
||||||
double csat;
|
double csat;
|
||||||
|
|
@ -95,10 +94,8 @@ JFETdSetup(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
|
|
||||||
if (vds < 0.0) {
|
if (vds < 0.0) {
|
||||||
vds = -vds;
|
vds = -vds;
|
||||||
temp = vgs;
|
SWAP(double, vgs, vgd);
|
||||||
vgs = vgd;
|
/* so now these have become the local variables */
|
||||||
vgd = temp; /* so now these have become the
|
|
||||||
local variables */
|
|
||||||
here->JFETmode = -1;
|
here->JFETmode = -1;
|
||||||
} else {
|
} else {
|
||||||
here->JFETmode = 1;
|
here->JFETmode = 1;
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,6 @@ MESAload(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
#ifndef PREDICTOR
|
#ifndef PREDICTOR
|
||||||
double xfact;
|
double xfact;
|
||||||
#endif
|
#endif
|
||||||
double temp;
|
|
||||||
double vted;
|
double vted;
|
||||||
double vtes;
|
double vtes;
|
||||||
double vtd;
|
double vtd;
|
||||||
|
|
@ -321,9 +320,7 @@ MESAload(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
if(inverse) {
|
if(inverse) {
|
||||||
cdrain = -cdrain;
|
cdrain = -cdrain;
|
||||||
vds = -vds;
|
vds = -vds;
|
||||||
temp = capgs;
|
SWAP(double, capgs, capgd);
|
||||||
capgs = capgd;
|
|
||||||
capgd = temp;
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* compute equivalent drain current source
|
* compute equivalent drain current source
|
||||||
|
|
|
||||||
|
|
@ -984,9 +984,7 @@ SOI3load(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
/* Now we use a nasty trick - if device is A over T, must "swap" drain and source
|
/* Now we use a nasty trick - if device is A over T, must "swap" drain and source
|
||||||
potentials. we do a literal switch and change it back for the outside world. */
|
potentials. we do a literal switch and change it back for the outside world. */
|
||||||
if (here->SOI3mode == -1) {
|
if (here->SOI3mode == -1) {
|
||||||
tmp = vsb;
|
SWAP(double, vsb, vdb);
|
||||||
vsb = vdb;
|
|
||||||
vdb = tmp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Intrinsic Electrical Bit - has a bit of thermal due to TTC */
|
/* Intrinsic Electrical Bit - has a bit of thermal due to TTC */
|
||||||
|
|
@ -1667,9 +1665,7 @@ SOI3load(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
/* now end nasty trick - if vsb and vdb have been switched, reverse them back */
|
/* now end nasty trick - if vsb and vdb have been switched, reverse them back */
|
||||||
if (here->SOI3mode == -1)
|
if (here->SOI3mode == -1)
|
||||||
{
|
{
|
||||||
tmp = vsb;
|
SWAP(double, vsb, vdb);
|
||||||
vsb = vdb;
|
|
||||||
vdb = tmp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -550,9 +550,7 @@ Gaussian_Elimination1(int dims)
|
||||||
}
|
}
|
||||||
if (imax != i)
|
if (imax != i)
|
||||||
for (k = i; k <= dim; k++) {
|
for (k = i; k <= dim; k++) {
|
||||||
f = A[i][k];
|
SWAP(double, A[i][k], A[imax][k]);
|
||||||
A[i][k] = A[imax][k];
|
|
||||||
A[imax][k] = f;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
f = 1.0 / A[i][i];
|
f = 1.0 / A[i][i];
|
||||||
|
|
@ -913,9 +911,7 @@ Gaussian_Elimination2(int dims)
|
||||||
}
|
}
|
||||||
if (imax != i)
|
if (imax != i)
|
||||||
for (k = i; k <= dim; k++) {
|
for (k = i; k <= dim; k++) {
|
||||||
f = AA[i][k];
|
SWAP(double, AA[i][k], AA[imax][k]);
|
||||||
AA[i][k] = AA[imax][k];
|
|
||||||
AA[imax][k] = f;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
f = 1.0 / AA[i][i];
|
f = 1.0 / AA[i][i];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue