Index: trunk/psLib/src/math/psPolynomial.c
===================================================================
--- trunk/psLib/src/math/psPolynomial.c	(revision 6348)
+++ trunk/psLib/src/math/psPolynomial.c	(revision 6437)
@@ -4,9 +4,9 @@
 *         routines.
 *
-*  This file will hold the functions for allocated, freeing, and evaluating
+*  This file will hold the routiness for allocating, freeing, and evaluating
 *  polynomials.  It also contains a Gaussian functions.
 *
-*  @version $Revision: 1.142 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-02-07 23:36:15 $
+*  @version $Revision: 1.143 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-02-17 00:56:48 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -159,5 +159,4 @@
 used frequently and the data structure created here does not contain the
 outer coefficients of the Chebyshev polynomials.
- 
  *****************************************************************************/
 psPolynomial1D **p_psCreateChebyshevPolys(psS32 numPolys)
@@ -165,40 +164,31 @@
     PS_ASSERT_INT_LARGER_THAN_OR_EQUAL(numPolys, 1, NULL);
 
-    if (0) {
-        psPolynomial1D **chebPolys = (psPolynomial1D **) psAlloc(numPolys * sizeof(psPolynomial1D *));
-        for (psS32 i = 0; i < numPolys; i++) {
-            chebPolys[i] = psPolynomial1DAlloc(PS_POLYNOMIAL_ORD, i);
-            chebPolys[i]->coeff[i] = 1;
-        }
-        return (chebPolys);
-    } else {
-        psPolynomial1D **chebPolys = (psPolynomial1D **) psAlloc(numPolys * sizeof(psPolynomial1D *));
-        for (psS32 i = 0; i < numPolys; i++) {
-            chebPolys[i] = psPolynomial1DAlloc(PS_POLYNOMIAL_ORD, i);
-        }
-
-        // Create the Chebyshev polynomials.
-        // Polynomial i has i-th order.
-        chebPolys[0]->coeff[0] = 1.0;
-        if (numPolys >= 2) {
-            chebPolys[1]->coeff[1] = 1.0;
-
-            for (psS32 i = 2; i < numPolys; i++) {
-                for (psS32 j = 0; j < chebPolys[i - 1]->nX+1; j++) {
-                    chebPolys[i]->coeff[j + 1] = 2.0 * chebPolys[i - 1]->coeff[j];
-                }
-                for (psS32 j = 0; j < chebPolys[i - 2]->nX+1; j++) {
-                    chebPolys[i]->coeff[j] -= chebPolys[i - 2]->coeff[j];
-                }
-            }
-        }
-
-        if (psTraceGetLevel(__func__) >= 6) {
-            for (psS32 j = 0; j < numPolys; j++) {
-                PS_POLY_PRINT_1D(chebPolys[j]);
-            }
-        }
-        return (chebPolys);
-    }
+    psPolynomial1D **chebPolys = (psPolynomial1D **) psAlloc(numPolys * sizeof(psPolynomial1D *));
+    for (psS32 i = 0; i < numPolys; i++) {
+        chebPolys[i] = psPolynomial1DAlloc(PS_POLYNOMIAL_ORD, i);
+    }
+
+    // Create the Chebyshev polynomials.
+    // Polynomial i has i-th order.
+    chebPolys[0]->coeff[0] = 1.0;
+    if (numPolys >= 2) {
+        chebPolys[1]->coeff[1] = 1.0;
+
+        for (psS32 i = 2; i < numPolys; i++) {
+            for (psS32 j = 0; j < chebPolys[i - 1]->nX+1; j++) {
+                chebPolys[i]->coeff[j + 1] = 2.0 * chebPolys[i - 1]->coeff[j];
+            }
+            for (psS32 j = 0; j < chebPolys[i - 2]->nX+1; j++) {
+                chebPolys[i]->coeff[j] -= chebPolys[i - 2]->coeff[j];
+            }
+        }
+    }
+
+    if (psTraceGetLevel(__func__) >= 6) {
+        for (psS32 j = 0; j < numPolys; j++) {
+            PS_POLY_PRINT_1D(chebPolys[j]);
+        }
+    }
+    return (chebPolys);
 }
 
@@ -223,6 +213,4 @@
     for (loop_x = 0; loop_x < poly->nX+1; loop_x++) {
         if (poly->mask[loop_x] == 0) {
-            // XXX: If you set the tracelevel to 10 here, and later set the tracelevel to
-            // 2 or higher in the test code, you get seg faults.
             psTrace(__func__, 8,
                     "polysum+= sum*coeff [%lf+= (%lf * %lf)\n", polySum, xSum, poly->coeff[loop_x]);
@@ -238,5 +226,5 @@
 // XXX: You can do this without having to psAlloc() vector d.
 // XXX: How does the mask vector effect Crenshaw's formula?
-// XXX: We assume that x is scaled between -1.0 and 1.0;
+// NOTE: We assume that x is scaled between -1.0 and 1.0;
 // XXX: Create a faster version for low-order Chebyshevs.
 static psF64 chebPolynomial1DEval(
@@ -298,5 +286,5 @@
         psFree(d);
     } else {
-        // This is old code that does not use Clenshaw's formula.  Get rid of it.
+        // XXX: This is old code that does not use Clenshaw's formula.  Get rid of it.
         psPolynomial1D **chebPolys = p_psCreateChebyshevPolys(1 + poly->nX);
 
