1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
|
diff -ur scipy-0.6.0/scipy/linsolve/SuperLU/SRC/cgsequ.c scipy-svn/scipy/sparse/linalg/dsolve/SuperLU/SRC/cgsequ.c
--- scipy-0.6.0/scipy/linsolve/SuperLU/SRC/cgsequ.c 2007-09-22 09:55:18.000000000 +0200
+++ scipy-svn/scipy/sparse/linalg/dsolve/SuperLU/SRC/cgsequ.c 2008-11-11 17:32:10.000000000 +0100
@@ -118,7 +118,7 @@
for (j = 0; j < A->ncol; ++j)
for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) {
irow = Astore->rowind[i];
- r[irow] = SUPERLU_MAX( r[irow], c_abs1(&Aval[i]) );
+ r[irow] = SUPERLU_MAX( r[irow], slu_c_abs1(&Aval[i]) );
}
/* Find the maximum and minimum scale factors. */
@@ -153,7 +153,7 @@
for (j = 0; j < A->ncol; ++j)
for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) {
irow = Astore->rowind[i];
- c[j] = SUPERLU_MAX( c[j], c_abs1(&Aval[i]) * r[irow] );
+ c[j] = SUPERLU_MAX( c[j], slu_c_abs1(&Aval[i]) * r[irow] );
}
/* Find the maximum and minimum scale factors. */
diff -ur scipy-0.6.0/scipy/linsolve/SuperLU/SRC/cgsrfs.c scipy-svn/scipy/sparse/linalg/dsolve/SuperLU/SRC/cgsrfs.c
--- scipy-0.6.0/scipy/linsolve/SuperLU/SRC/cgsrfs.c 2007-09-22 09:55:18.000000000 +0200
+++ scipy-svn/scipy/sparse/linalg/dsolve/SuperLU/SRC/cgsrfs.c 2008-11-11 17:32:10.000000000 +0100
@@ -276,21 +276,21 @@
than SAFE2, then SAFE1 is added to the i-th component of the
numerator and denominator before dividing. */
- for (i = 0; i < A->nrow; ++i) rwork[i] = c_abs1( &Bptr[i] );
+ for (i = 0; i < A->nrow; ++i) rwork[i] = slu_c_abs1( &Bptr[i] );
/* Compute abs(op(A))*abs(X) + abs(B). */
if (notran) {
for (k = 0; k < A->ncol; ++k) {
- xk = c_abs1( &Xptr[k] );
+ xk = slu_c_abs1( &Xptr[k] );
for (i = Astore->colptr[k]; i < Astore->colptr[k+1]; ++i)
- rwork[Astore->rowind[i]] += c_abs1(&Aval[i]) * xk;
+ rwork[Astore->rowind[i]] += slu_c_abs1(&Aval[i]) * xk;
}
} else {
for (k = 0; k < A->ncol; ++k) {
s = 0.;
for (i = Astore->colptr[k]; i < Astore->colptr[k+1]; ++i) {
irow = Astore->rowind[i];
- s += c_abs1(&Aval[i]) * c_abs1(&Xptr[irow]);
+ s += slu_c_abs1(&Aval[i]) * slu_c_abs1(&Xptr[irow]);
}
rwork[k] += s;
}
@@ -298,9 +298,9 @@
s = 0.;
for (i = 0; i < A->nrow; ++i) {
if (rwork[i] > safe2)
- s = SUPERLU_MAX( s, c_abs1(&work[i]) / rwork[i] );
+ s = SUPERLU_MAX( s, slu_c_abs1(&work[i]) / rwork[i] );
else
- s = SUPERLU_MAX( s, (c_abs1(&work[i]) + safe1) /
+ s = SUPERLU_MAX( s, (slu_c_abs1(&work[i]) + safe1) /
(rwork[i] + safe1) );
}
berr[j] = s;
@@ -351,22 +351,22 @@
inv(op(A)) * diag(W),
where W = abs(R) + NZ*EPS*( abs(op(A))*abs(X)+abs(B) ))) */
- for (i = 0; i < A->nrow; ++i) rwork[i] = c_abs1( &Bptr[i] );
+ for (i = 0; i < A->nrow; ++i) rwork[i] = slu_c_abs1( &Bptr[i] );
/* Compute abs(op(A))*abs(X) + abs(B). */
if ( notran ) {
for (k = 0; k < A->ncol; ++k) {
- xk = c_abs1( &Xptr[k] );
+ xk = slu_c_abs1( &Xptr[k] );
for (i = Astore->colptr[k]; i < Astore->colptr[k+1]; ++i)
- rwork[Astore->rowind[i]] += c_abs1(&Aval[i]) * xk;
+ rwork[Astore->rowind[i]] += slu_c_abs1(&Aval[i]) * xk;
}
} else {
for (k = 0; k < A->ncol; ++k) {
s = 0.;
for (i = Astore->colptr[k]; i < Astore->colptr[k+1]; ++i) {
irow = Astore->rowind[i];
- xk = c_abs1( &Xptr[irow] );
- s += c_abs1(&Aval[i]) * xk;
+ xk = slu_c_abs1( &Xptr[irow] );
+ s += slu_c_abs1(&Aval[i]) * xk;
}
rwork[k] += s;
}
@@ -374,9 +374,9 @@
for (i = 0; i < A->nrow; ++i)
if (rwork[i] > safe2)
- rwork[i] = c_abs(&work[i]) + (iwork[i]+1)*eps*rwork[i];
+ rwork[i] = slu_c_abs(&work[i]) + (iwork[i]+1)*eps*rwork[i];
else
- rwork[i] = c_abs(&work[i])+(iwork[i]+1)*eps*rwork[i]+safe1;
+ rwork[i] = slu_c_abs(&work[i])+(iwork[i]+1)*eps*rwork[i]+safe1;
kase = 0;
do {
@@ -424,13 +424,13 @@
lstres = 0.;
if ( notran && colequ ) {
for (i = 0; i < A->nrow; ++i)
- lstres = SUPERLU_MAX( lstres, C[i] * c_abs1( &Xptr[i]) );
+ lstres = SUPERLU_MAX( lstres, C[i] * slu_c_abs1( &Xptr[i]) );
} else if ( !notran && rowequ ) {
for (i = 0; i < A->nrow; ++i)
- lstres = SUPERLU_MAX( lstres, R[i] * c_abs1( &Xptr[i]) );
+ lstres = SUPERLU_MAX( lstres, R[i] * slu_c_abs1( &Xptr[i]) );
} else {
for (i = 0; i < A->nrow; ++i)
- lstres = SUPERLU_MAX( lstres, c_abs1( &Xptr[i]) );
+ lstres = SUPERLU_MAX( lstres, slu_c_abs1( &Xptr[i]) );
}
if ( lstres != 0. )
ferr[j] /= lstres;
diff -ur scipy-0.6.0/scipy/linsolve/SuperLU/SRC/clacon.c scipy-svn/scipy/sparse/linalg/dsolve/SuperLU/SRC/clacon.c
--- scipy-0.6.0/scipy/linsolve/SuperLU/SRC/clacon.c 2007-09-22 09:55:18.000000000 +0200
+++ scipy-svn/scipy/sparse/linalg/dsolve/SuperLU/SRC/clacon.c 2008-11-11 17:32:10.000000000 +0100
@@ -106,14 +106,14 @@
L20:
if (*n == 1) {
v[0] = x[0];
- *est = c_abs(&v[0]);
+ *est = slu_c_abs(&v[0]);
/* ... QUIT */
goto L150;
}
*est = scsum1_(n, x, &c__1);
for (i = 0; i < *n; ++i) {
- d__1 = c_abs(&x[i]);
+ d__1 = slu_c_abs(&x[i]);
if (d__1 > safmin) {
d__1 = 1 / d__1;
x[i].r *= d__1;
@@ -158,7 +158,7 @@
if (*est <= estold) goto L120;
for (i = 0; i < *n; ++i) {
- d__1 = c_abs(&x[i]);
+ d__1 = slu_c_abs(&x[i]);
if (d__1 > safmin) {
d__1 = 1 / d__1;
x[i].r *= d__1;
diff -ur scipy-0.6.0/scipy/linsolve/SuperLU/SRC/clangs.c scipy-svn/scipy/sparse/linalg/dsolve/SuperLU/SRC/clangs.c
--- scipy-0.6.0/scipy/linsolve/SuperLU/SRC/clangs.c 2007-09-22 09:55:18.000000000 +0200
+++ scipy-svn/scipy/sparse/linalg/dsolve/SuperLU/SRC/clangs.c 2008-11-11 17:32:10.000000000 +0100
@@ -72,7 +72,7 @@
value = 0.;
for (j = 0; j < A->ncol; ++j)
for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; i++)
- value = SUPERLU_MAX( value, c_abs( &Aval[i]) );
+ value = SUPERLU_MAX( value, slu_c_abs( &Aval[i]) );
} else if (lsame_(norm, "O") || *(unsigned char *)norm == '1') {
/* Find norm1(A). */
@@ -80,7 +80,7 @@
for (j = 0; j < A->ncol; ++j) {
sum = 0.;
for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; i++)
- sum += c_abs( &Aval[i] );
+ sum += slu_c_abs( &Aval[i] );
value = SUPERLU_MAX(value,sum);
}
@@ -92,7 +92,7 @@
for (j = 0; j < A->ncol; ++j)
for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; i++) {
irow = Astore->rowind[i];
- rwork[irow] += c_abs( &Aval[i] );
+ rwork[irow] += slu_c_abs( &Aval[i] );
}
value = 0.;
for (i = 0; i < A->nrow; ++i)
diff -ur scipy-0.6.0/scipy/linsolve/SuperLU/SRC/cpivotgrowth.c scipy-svn/scipy/sparse/linalg/dsolve/SuperLU/SRC/cpivotgrowth.c
--- scipy-0.6.0/scipy/linsolve/SuperLU/SRC/cpivotgrowth.c 2007-09-22 09:55:18.000000000 +0200
+++ scipy-svn/scipy/sparse/linalg/dsolve/SuperLU/SRC/cpivotgrowth.c 2008-11-11 17:32:10.000000000 +0100
@@ -83,15 +83,15 @@
maxaj = 0.;
oldcol = inv_perm_c[j];
for (i = Astore->colptr[oldcol]; i < Astore->colptr[oldcol+1]; ++i)
- maxaj = SUPERLU_MAX( maxaj, c_abs1( &Aval[i]) );
+ maxaj = SUPERLU_MAX( maxaj, slu_c_abs1( &Aval[i]) );
maxuj = 0.;
for (i = Ustore->colptr[j]; i < Ustore->colptr[j+1]; i++)
- maxuj = SUPERLU_MAX( maxuj, c_abs1( &Uval[i]) );
+ maxuj = SUPERLU_MAX( maxuj, slu_c_abs1( &Uval[i]) );
/* Supernode */
for (i = 0; i < nz_in_U; ++i)
- maxuj = SUPERLU_MAX( maxuj, c_abs1( &luval[i]) );
+ maxuj = SUPERLU_MAX( maxuj, slu_c_abs1( &luval[i]) );
++nz_in_U;
luval += nsupr;
diff -ur scipy-0.6.0/scipy/linsolve/SuperLU/SRC/cpivotL.c scipy-svn/scipy/sparse/linalg/dsolve/SuperLU/SRC/cpivotL.c
--- scipy-0.6.0/scipy/linsolve/SuperLU/SRC/cpivotL.c 2007-09-22 09:55:18.000000000 +0200
+++ scipy-svn/scipy/sparse/linalg/dsolve/SuperLU/SRC/cpivotL.c 2008-11-11 17:32:10.000000000 +0100
@@ -106,7 +106,7 @@
diag = EMPTY;
old_pivptr = nsupc;
for (isub = nsupc; isub < nsupr; ++isub) {
- rtemp = c_abs1 (&lu_col_ptr[isub]);
+ rtemp = slu_c_abs1 (&lu_col_ptr[isub]);
if ( rtemp > pivmax ) {
pivmax = rtemp;
pivptr = isub;
@@ -127,7 +127,7 @@
/* Choose appropriate pivotal element by our policy. */
if ( *usepr ) {
- rtemp = c_abs1 (&lu_col_ptr[old_pivptr]);
+ rtemp = slu_c_abs1 (&lu_col_ptr[old_pivptr]);
if ( rtemp != 0.0 && rtemp >= thresh )
pivptr = old_pivptr;
else
@@ -136,7 +136,7 @@
if ( *usepr == 0 ) {
/* Use diagonal pivot? */
if ( diag >= 0 ) { /* diagonal exists */
- rtemp = c_abs1 (&lu_col_ptr[diag]);
+ rtemp = slu_c_abs1 (&lu_col_ptr[diag]);
if ( rtemp != 0.0 && rtemp >= thresh ) pivptr = diag;
}
*pivrow = lsub_ptr[pivptr];
diff -ur scipy-0.6.0/scipy/linsolve/SuperLU/SRC/cutil.c scipy-svn/scipy/sparse/linalg/dsolve/SuperLU/SRC/cutil.c
--- scipy-0.6.0/scipy/linsolve/SuperLU/SRC/cutil.c 2007-09-22 09:55:18.000000000 +0200
+++ scipy-svn/scipy/sparse/linalg/dsolve/SuperLU/SRC/cutil.c 2008-11-11 17:32:10.000000000 +0100
@@ -414,8 +414,8 @@
err = xnorm = 0.0;
for (i = 0; i < X->nrow; i++) {
c_sub(&temp, &soln_work[i], &xtrue[i]);
- err = SUPERLU_MAX(err, c_abs(&temp));
- xnorm = SUPERLU_MAX(xnorm, c_abs(&soln_work[i]));
+ err = SUPERLU_MAX(err, slu_c_abs(&temp));
+ xnorm = SUPERLU_MAX(xnorm, slu_c_abs(&soln_work[i]));
}
err = err / xnorm;
printf("||X - Xtrue||/||X|| = %e\n", err);
diff -ur scipy-0.6.0/scipy/linsolve/SuperLU/SRC/scomplex.c scipy-svn/scipy/sparse/linalg/dsolve/SuperLU/SRC/scomplex.c
--- scipy-0.6.0/scipy/linsolve/SuperLU/SRC/scomplex.c 2007-09-22 09:55:18.000000000 +0200
+++ scipy-svn/scipy/sparse/linalg/dsolve/SuperLU/SRC/scomplex.c 2008-11-11 17:32:10.000000000 +0100
@@ -45,7 +45,7 @@
/* Returns sqrt(z.r^2 + z.i^2) */
-double c_abs(complex *z)
+double slu_c_abs(complex *z)
{
float temp;
float real = z->r;
@@ -68,7 +68,7 @@
/* Approximates the abs */
/* Returns abs(z.r) + abs(z.i) */
-double c_abs1(complex *z)
+double slu_c_abs1(complex *z)
{
float real = z->r;
float imag = z->i;
diff -ur scipy-0.6.0/scipy/linsolve/SuperLU/SRC/scomplex.h scipy-svn/scipy/sparse/linalg/dsolve/SuperLU/SRC/scomplex.h
--- scipy-0.6.0/scipy/linsolve/SuperLU/SRC/scomplex.h 2007-09-22 09:55:18.000000000 +0200
+++ scipy-svn/scipy/sparse/linalg/dsolve/SuperLU/SRC/scomplex.h 2008-11-11 17:32:10.000000000 +0100
@@ -57,8 +57,8 @@
/* Prototypes for functions in scomplex.c */
void c_div(complex *, complex *, complex *);
-double c_abs(complex *); /* exact */
-double c_abs1(complex *); /* approximate */
+double slu_c_abs(complex *); /* exact */
+double slu_c_abs1(complex *); /* approximate */
void c_exp(complex *, complex *);
void r_cnjg(complex *, complex *);
double r_imag(complex *);
diff -ur scipy-0.6.0/scipy/linsolve/SuperLU/SRC/scsum1.c scipy-svn/scipy/sparse/linalg/dsolve/SuperLU/SRC/scsum1.c
--- scipy-0.6.0/scipy/linsolve/SuperLU/SRC/scsum1.c 2007-09-22 09:55:18.000000000 +0200
+++ scipy-svn/scipy/sparse/linalg/dsolve/SuperLU/SRC/scsum1.c 2008-11-11 17:32:10.000000000 +0100
@@ -42,7 +42,7 @@
int i__1, i__2;
float ret_val;
/* Builtin functions */
- double c_abs(complex *);
+ double slu_c_abs(complex *);
/* Local variables */
static int i, nincx;
static float stemp;
@@ -69,7 +69,7 @@
/* NEXT LINE MODIFIED. */
- stemp += c_abs(&CX(i));
+ stemp += slu_c_abs(&CX(i));
/* L10: */
}
ret_val = stemp;
@@ -83,7 +83,7 @@
/* NEXT LINE MODIFIED. */
- stemp += c_abs(&CX(i));
+ stemp += slu_c_abs(&CX(i));
/* L30: */
}
ret_val = stemp;
|