[Scipy-svn] r4767 - trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC

scipy-svn@scip... scipy-svn@scip...
Sat Oct 4 17:22:56 CDT 2008


Author: wnbell
Date: 2008-10-04 17:22:39 -0500 (Sat, 04 Oct 2008)
New Revision: 4767

Modified:
   trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/cgsequ.c
   trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/cgsrfs.c
   trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/clacon.c
   trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/clangs.c
   trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/cpivotL.c
   trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/cpivotgrowth.c
   trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/cutil.c
   trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/scomplex.c
   trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/scomplex.h
   trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/scsum1.c
Log:
rename c_abs() and c_abs1() to slu_c_abs() and slu_c_abs() to
avoid conflict with Python headers
hopefully resolves ticket #735


Modified: trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/cgsequ.c
===================================================================
--- trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/cgsequ.c	2008-10-03 18:57:20 UTC (rev 4766)
+++ trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/cgsequ.c	2008-10-04 22:22:39 UTC (rev 4767)
@@ -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_cabs1(&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_cabs1(&Aval[i]) * r[irow] );
 	}
 
     /* Find the maximum and minimum scale factors. */

Modified: trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/cgsrfs.c
===================================================================
--- trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/cgsrfs.c	2008-10-03 18:57:20 UTC (rev 4766)
+++ trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/cgsrfs.c	2008-10-04 22:22:39 UTC (rev 4767)
@@ -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_cabs1( &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_cabs1( &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_cabs1(&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_cabs1(&Aval[i]) * slu_c_cabs1(&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_cabs1(&work[i]) / rwork[i] );
 		else
-		    s = SUPERLU_MAX( s, (c_abs1(&work[i]) + safe1) / 
+		    s = SUPERLU_MAX( s, (slu_c_cabs1(&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_cabs1( &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_cabs1( &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_cabs1(&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_cabs1( &Xptr[irow] );
+		    s += slu_c_cabs1(&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_cabs(&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_cabs(&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_cabs1( &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_cabs1( &Xptr[i]) );
 	} else {
 	    for (i = 0; i < A->nrow; ++i)
-	    	lstres = SUPERLU_MAX( lstres, c_abs1( &Xptr[i]) );
+	    	lstres = SUPERLU_MAX( lstres, slu_c_cabs1( &Xptr[i]) );
 	}
 	if ( lstres != 0. )
 	    ferr[j] /= lstres;

Modified: trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/clacon.c
===================================================================
--- trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/clacon.c	2008-10-03 18:57:20 UTC (rev 4766)
+++ trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/clacon.c	2008-10-04 22:22:39 UTC (rev 4767)
@@ -106,14 +106,14 @@
   L20:
     if (*n == 1) {
 	v[0] = x[0];
-	*est = c_abs(&v[0]);
+	*est = slu_c_cabs(&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_cabs(&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_cabs(&x[i]);
 	if (d__1 > safmin) {
 	    d__1 = 1 / d__1;
 	    x[i].r *= d__1;

Modified: trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/clangs.c
===================================================================
--- trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/clangs.c	2008-10-03 18:57:20 UTC (rev 4766)
+++ trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/clangs.c	2008-10-04 22:22:39 UTC (rev 4767)
@@ -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_cabs( &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_cabs( &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_cabs( &Aval[i] );
 	    }
 	value = 0.;
 	for (i = 0; i < A->nrow; ++i)

Modified: trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/cpivotL.c
===================================================================
--- trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/cpivotL.c	2008-10-03 18:57:20 UTC (rev 4766)
+++ trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/cpivotL.c	2008-10-04 22:22:39 UTC (rev 4767)
@@ -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_cabs1 (&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_cabs1 (&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_cabs1 (&lu_col_ptr[diag]);
 	    if ( rtemp != 0.0 && rtemp >= thresh ) pivptr = diag;
         }
 	*pivrow = lsub_ptr[pivptr];

Modified: trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/cpivotgrowth.c
===================================================================
--- trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/cpivotgrowth.c	2008-10-03 18:57:20 UTC (rev 4766)
+++ trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/cpivotgrowth.c	2008-10-04 22:22:39 UTC (rev 4767)
@@ -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_cabs1( &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_cabs1( &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_cabs1( &luval[i]) );
 
 	    ++nz_in_U;
 	    luval += nsupr;

Modified: trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/cutil.c
===================================================================
--- trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/cutil.c	2008-10-03 18:57:20 UTC (rev 4766)
+++ trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/cutil.c	2008-10-04 22:22:39 UTC (rev 4767)
@@ -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_cabs(&temp));
+	xnorm = SUPERLU_MAX(xnorm, slu_c_cabs(&soln_work[i]));
       }
       err = err / xnorm;
       printf("||X - Xtrue||/||X|| = %e\n", err);

Modified: trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/scomplex.c
===================================================================
--- trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/scomplex.c	2008-10-03 18:57:20 UTC (rev 4766)
+++ trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/scomplex.c	2008-10-04 22:22:39 UTC (rev 4767)
@@ -45,7 +45,7 @@
 
 
 /* Returns sqrt(z.r^2 + z.i^2) */
-double c_abs(complex *z)
+double slu_c_cabs(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_cabs1(complex *z)
 {
     float real = z->r;
     float imag = z->i;

Modified: trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/scomplex.h
===================================================================
--- trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/scomplex.h	2008-10-03 18:57:20 UTC (rev 4766)
+++ trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/scomplex.h	2008-10-04 22:22:39 UTC (rev 4767)
@@ -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_cabs(complex *);     /* exact */
+double slu_c_cabs1(complex *);    /* approximate */
 void c_exp(complex *, complex *);
 void r_cnjg(complex *, complex *);
 double r_imag(complex *);

Modified: trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/scsum1.c
===================================================================
--- trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/scsum1.c	2008-10-03 18:57:20 UTC (rev 4766)
+++ trunk/scipy/sparse/linalg/dsolve/SuperLU/SRC/scsum1.c	2008-10-04 22:22:39 UTC (rev 4767)
@@ -42,7 +42,7 @@
     int i__1, i__2;
     float ret_val;
     /* Builtin functions */
-    double c_abs(complex *);
+    double slu_c_cabs(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_cabs(&CX(i));
 /* L10: */
     }
     ret_val = stemp;
@@ -83,7 +83,7 @@
 
 /*        NEXT LINE MODIFIED. */
 
-	stemp += c_abs(&CX(i));
+	stemp += slu_c_cabs(&CX(i));
 /* L30: */
     }
     ret_val = stemp;



More information about the Scipy-svn mailing list