Index: /trunk/psLib/src/dataManip/psFunctions.c
===================================================================
--- /trunk/psLib/src/dataManip/psFunctions.c	(revision 3025)
+++ /trunk/psLib/src/dataManip/psFunctions.c	(revision 3026)
@@ -7,6 +7,6 @@
  *  polynomials.  It also contains a Gaussian functions.
  *
- *  @version $Revision: 1.81 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-01-14 23:40:24 $
+ *  @version $Revision: 1.82 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-01-17 22:17:29 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -1906,4 +1906,7 @@
         (tmp->spline)[i] = psPolynomial1DAlloc(order+1, PS_POLYNOMIAL_ORD);
     }
+
+    // This should be set by the psVectorFitSpline1D()
+    tmp->p_psDeriv2 = NULL;
 
     tmp->domains = (psF32 *) psAlloc((bounds->n) * sizeof(psF32));
Index: /trunk/psLib/src/dataManip/psMatrix.c
===================================================================
--- /trunk/psLib/src/dataManip/psMatrix.c	(revision 3025)
+++ /trunk/psLib/src/dataManip/psMatrix.c	(revision 3026)
@@ -20,6 +20,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-12-11 00:16:38 $
+ *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-01-17 22:17:29 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -175,5 +175,5 @@
 /*****************************************************************************/
 
-psImage* psMatrixLUD(psImage* outImage, psVector* outPerm, psImage* inImage)
+psImage* psMatrixLUD(psImage* outImage, psVector** outPerm, psImage* inImage)
 {
     psS32 signum = 0;
@@ -190,8 +190,6 @@
     PS_CHECK_POINTERS(inImage, outImage, outImage);
     PS_CHECK_DIMEN_AND_TYPE(inImage, PS_DIMEN_IMAGE, outImage);
-    PS_VECTOR_CHECK_NULL_GENERAL(outPerm, psMatrixLUD_EXIT);
-    PS_CHECK_DIMEN_AND_TYPE(outPerm, PS_DIMEN_VECTOR, outImage);
+    PS_PTR_CHECK_NULL_GENERAL(outPerm, psMatrixLUD_EXIT);
     psImageRecycle(outImage, inImage->numCols, inImage->numRows, inImage->type.type);
-    psVectorRecycle(outPerm, inImage->numRows, inImage->type.type);
     PS_CHECK_SQUARE(inImage, outImage);
     PS_CHECK_SQUARE(outImage, outImage);
@@ -203,6 +201,17 @@
     // Initialize GSL data
     perm.size = numCols;
-    outPerm->n = numCols;
-    perm.data = outPerm->data.V;
+    if (sizeof(size_t) == 4) {
+        *outPerm = psVectorRecycle(*outPerm, numCols, PS_TYPE_S32);
+    } else if (sizeof(size_t) == 8) {
+        *outPerm = psVectorRecycle(*outPerm, numCols, PS_TYPE_S64);
+    } else {
+        psError(PS_ERR_UNKNOWN, true,
+                "Failed to allocate the permutation vector; "
+                "could not determine the cooresponding data type.");
+        psMatrixLUD_EXIT;
+    }
+
+    (*outPerm)->n = numCols;
+    perm.data = (*outPerm)->data.V;
     lu = gsl_matrix_alloc(numRows, numCols);
 
@@ -244,5 +253,4 @@
     PS_CHECK_DIMEN_AND_TYPE(inVector, PS_DIMEN_VECTOR, outVector);
     PS_VECTOR_CHECK_NULL(inPerm, outVector);
-    PS_CHECK_DIMEN_AND_TYPE(inPerm, PS_DIMEN_VECTOR, outVector);
     psVectorRecycle(outVector, inImage->numRows, inImage->type.type);
 
Index: /trunk/psLib/src/dataManip/psMatrix.h
===================================================================
--- /trunk/psLib/src/dataManip/psMatrix.h	(revision 3025)
+++ /trunk/psLib/src/dataManip/psMatrix.h	(revision 3026)
@@ -22,6 +22,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-12-09 20:51:22 $
+ *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-01-17 22:17:29 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -45,5 +45,5 @@
 psImage* psMatrixLUD(
     psImage* outImage,                 ///< Image to return, or NULL.
-    psVector* outPerm,                 ///< Output permutation vector used by psMatrixLUSolve.
+    psVector** outPerm,                ///< Output permutation vector used by psMatrixLUSolve.
     psImage* inImage                   ///< Image to decompose.
 );
Index: /trunk/psLib/src/dataManip/psMinimize.c
===================================================================
--- /trunk/psLib/src/dataManip/psMinimize.c	(revision 3025)
+++ /trunk/psLib/src/dataManip/psMinimize.c	(revision 3026)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.99 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-01-14 23:27:56 $
+ *  @version $Revision: 1.100 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-01-17 22:17:29 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -294,5 +294,5 @@
         This can not be implemented until SDR states what order spline should be
         created.
-     
+
         Should we error if mySPline is not NULL?
     */
@@ -616,5 +616,5 @@
     psS32 p;
     psVector *beta = psVectorAlloc(numParams, PS_TYPE_F64);
-    psVector *perm = psVectorAlloc(numParams, PS_TYPE_F64);
+    psVector *perm = NULL;
 
     psVector *paramDeltasF64 = psVectorAlloc(numParams, PS_TYPE_F64);
@@ -738,5 +738,5 @@
         // XXX: How do we know if these functions were successful?
         //
-        aOut = psMatrixLUD(aOut, perm, A);
+        aOut = psMatrixLUD(aOut, &perm, A);
         paramDeltasF64 = psMatrixLUSolve(paramDeltasF64, aOut, beta, perm);
 
@@ -936,5 +936,4 @@
     coeffs = psVectorAlloc(polyOrder, PS_TYPE_F64);
     X = psVectorAlloc(x->n, PS_TYPE_F64);
-    outPerm = psVectorAlloc(polyOrder, PS_TYPE_F64);
     xSums = psVectorAlloc(1 + 2 * polyOrder, PS_TYPE_F64);
 
@@ -943,5 +942,4 @@
         B->data.F64[i] = 0.0;
         coeffs->data.F64[i] = 0.0;
-        outPerm->data.F64[i] = 0.0;
         for (j = 0; j < polyOrder; j++) {
             A->data.F64[i][j] = 0.0;
@@ -987,5 +985,5 @@
 
     // XXX: How do we know if these routines were successful?
-    ALUD = psMatrixLUD(ALUD, outPerm, A);
+    ALUD = psMatrixLUD(ALUD, &outPerm, A);
     coeffs = psMatrixLUSolve(coeffs, ALUD, B, outPerm);
 
@@ -1139,11 +1137,11 @@
 Algorithm:
  
-XXX completely ad hoc:  
+XXX completely ad hoc:
 start with the user-supplied starting parameter and
 call that b.  Calculate a/c as a fractional amount smaller/larger than b.
 Repeat this process until a local minimum is found.
  
-XXX:  
-new algorithm:  
+XXX:
+new algorithm:
 start at x=0, expand in one direction until the function
 decreases.  Then you have two points in the bracket.  Keep going until it
@@ -1151,8 +1149,8 @@
 direction.
  
-XXX: 
+XXX:
 This is F32 only.
  
-XXX: 
+XXX:
 output bracket vector should be an input as well.
 *****************************************************************************/
Index: /trunk/psLib/src/math/psMatrix.c
===================================================================
--- /trunk/psLib/src/math/psMatrix.c	(revision 3025)
+++ /trunk/psLib/src/math/psMatrix.c	(revision 3026)
@@ -20,6 +20,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-12-11 00:16:38 $
+ *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-01-17 22:17:29 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -175,5 +175,5 @@
 /*****************************************************************************/
 
-psImage* psMatrixLUD(psImage* outImage, psVector* outPerm, psImage* inImage)
+psImage* psMatrixLUD(psImage* outImage, psVector** outPerm, psImage* inImage)
 {
     psS32 signum = 0;
@@ -190,8 +190,6 @@
     PS_CHECK_POINTERS(inImage, outImage, outImage);
     PS_CHECK_DIMEN_AND_TYPE(inImage, PS_DIMEN_IMAGE, outImage);
-    PS_VECTOR_CHECK_NULL_GENERAL(outPerm, psMatrixLUD_EXIT);
-    PS_CHECK_DIMEN_AND_TYPE(outPerm, PS_DIMEN_VECTOR, outImage);
+    PS_PTR_CHECK_NULL_GENERAL(outPerm, psMatrixLUD_EXIT);
     psImageRecycle(outImage, inImage->numCols, inImage->numRows, inImage->type.type);
-    psVectorRecycle(outPerm, inImage->numRows, inImage->type.type);
     PS_CHECK_SQUARE(inImage, outImage);
     PS_CHECK_SQUARE(outImage, outImage);
@@ -203,6 +201,17 @@
     // Initialize GSL data
     perm.size = numCols;
-    outPerm->n = numCols;
-    perm.data = outPerm->data.V;
+    if (sizeof(size_t) == 4) {
+        *outPerm = psVectorRecycle(*outPerm, numCols, PS_TYPE_S32);
+    } else if (sizeof(size_t) == 8) {
+        *outPerm = psVectorRecycle(*outPerm, numCols, PS_TYPE_S64);
+    } else {
+        psError(PS_ERR_UNKNOWN, true,
+                "Failed to allocate the permutation vector; "
+                "could not determine the cooresponding data type.");
+        psMatrixLUD_EXIT;
+    }
+
+    (*outPerm)->n = numCols;
+    perm.data = (*outPerm)->data.V;
     lu = gsl_matrix_alloc(numRows, numCols);
 
@@ -244,5 +253,4 @@
     PS_CHECK_DIMEN_AND_TYPE(inVector, PS_DIMEN_VECTOR, outVector);
     PS_VECTOR_CHECK_NULL(inPerm, outVector);
-    PS_CHECK_DIMEN_AND_TYPE(inPerm, PS_DIMEN_VECTOR, outVector);
     psVectorRecycle(outVector, inImage->numRows, inImage->type.type);
 
Index: /trunk/psLib/src/math/psMatrix.h
===================================================================
--- /trunk/psLib/src/math/psMatrix.h	(revision 3025)
+++ /trunk/psLib/src/math/psMatrix.h	(revision 3026)
@@ -22,6 +22,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-12-09 20:51:22 $
+ *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-01-17 22:17:29 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -45,5 +45,5 @@
 psImage* psMatrixLUD(
     psImage* outImage,                 ///< Image to return, or NULL.
-    psVector* outPerm,                 ///< Output permutation vector used by psMatrixLUSolve.
+    psVector** outPerm,                ///< Output permutation vector used by psMatrixLUSolve.
     psImage* inImage                   ///< Image to decompose.
 );
Index: /trunk/psLib/src/math/psMinimize.c
===================================================================
--- /trunk/psLib/src/math/psMinimize.c	(revision 3025)
+++ /trunk/psLib/src/math/psMinimize.c	(revision 3026)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.99 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-01-14 23:27:56 $
+ *  @version $Revision: 1.100 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-01-17 22:17:29 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -294,5 +294,5 @@
         This can not be implemented until SDR states what order spline should be
         created.
-     
+
         Should we error if mySPline is not NULL?
     */
@@ -616,5 +616,5 @@
     psS32 p;
     psVector *beta = psVectorAlloc(numParams, PS_TYPE_F64);
-    psVector *perm = psVectorAlloc(numParams, PS_TYPE_F64);
+    psVector *perm = NULL;
 
     psVector *paramDeltasF64 = psVectorAlloc(numParams, PS_TYPE_F64);
@@ -738,5 +738,5 @@
         // XXX: How do we know if these functions were successful?
         //
-        aOut = psMatrixLUD(aOut, perm, A);
+        aOut = psMatrixLUD(aOut, &perm, A);
         paramDeltasF64 = psMatrixLUSolve(paramDeltasF64, aOut, beta, perm);
 
@@ -936,5 +936,4 @@
     coeffs = psVectorAlloc(polyOrder, PS_TYPE_F64);
     X = psVectorAlloc(x->n, PS_TYPE_F64);
-    outPerm = psVectorAlloc(polyOrder, PS_TYPE_F64);
     xSums = psVectorAlloc(1 + 2 * polyOrder, PS_TYPE_F64);
 
@@ -943,5 +942,4 @@
         B->data.F64[i] = 0.0;
         coeffs->data.F64[i] = 0.0;
-        outPerm->data.F64[i] = 0.0;
         for (j = 0; j < polyOrder; j++) {
             A->data.F64[i][j] = 0.0;
@@ -987,5 +985,5 @@
 
     // XXX: How do we know if these routines were successful?
-    ALUD = psMatrixLUD(ALUD, outPerm, A);
+    ALUD = psMatrixLUD(ALUD, &outPerm, A);
     coeffs = psMatrixLUSolve(coeffs, ALUD, B, outPerm);
 
@@ -1139,11 +1137,11 @@
 Algorithm:
  
-XXX completely ad hoc:  
+XXX completely ad hoc:
 start with the user-supplied starting parameter and
 call that b.  Calculate a/c as a fractional amount smaller/larger than b.
 Repeat this process until a local minimum is found.
  
-XXX:  
-new algorithm:  
+XXX:
+new algorithm:
 start at x=0, expand in one direction until the function
 decreases.  Then you have two points in the bracket.  Keep going until it
@@ -1151,8 +1149,8 @@
 direction.
  
-XXX: 
+XXX:
 This is F32 only.
  
-XXX: 
+XXX:
 output bracket vector should be an input as well.
 *****************************************************************************/
Index: /trunk/psLib/src/math/psPolynomial.c
===================================================================
--- /trunk/psLib/src/math/psPolynomial.c	(revision 3025)
+++ /trunk/psLib/src/math/psPolynomial.c	(revision 3026)
@@ -7,6 +7,6 @@
  *  polynomials.  It also contains a Gaussian functions.
  *
- *  @version $Revision: 1.81 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-01-14 23:40:24 $
+ *  @version $Revision: 1.82 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-01-17 22:17:29 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -1906,4 +1906,7 @@
         (tmp->spline)[i] = psPolynomial1DAlloc(order+1, PS_POLYNOMIAL_ORD);
     }
+
+    // This should be set by the psVectorFitSpline1D()
+    tmp->p_psDeriv2 = NULL;
 
     tmp->domains = (psF32 *) psAlloc((bounds->n) * sizeof(psF32));
Index: /trunk/psLib/src/math/psSpline.c
===================================================================
--- /trunk/psLib/src/math/psSpline.c	(revision 3025)
+++ /trunk/psLib/src/math/psSpline.c	(revision 3026)
@@ -7,6 +7,6 @@
  *  polynomials.  It also contains a Gaussian functions.
  *
- *  @version $Revision: 1.81 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-01-14 23:40:24 $
+ *  @version $Revision: 1.82 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-01-17 22:17:29 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -1906,4 +1906,7 @@
         (tmp->spline)[i] = psPolynomial1DAlloc(order+1, PS_POLYNOMIAL_ORD);
     }
+
+    // This should be set by the psVectorFitSpline1D()
+    tmp->p_psDeriv2 = NULL;
 
     tmp->domains = (psF32 *) psAlloc((bounds->n) * sizeof(psF32));
Index: /trunk/psLib/test/dataIO/.cvsignore
===================================================================
--- /trunk/psLib/test/dataIO/.cvsignore	(revision 3025)
+++ /trunk/psLib/test/dataIO/.cvsignore	(revision 3026)
@@ -3,2 +3,3 @@
 tst_psFits
 multi.fits
+table.fits
Index: /trunk/psLib/test/dataManip/tst_psMatrix03.c
===================================================================
--- /trunk/psLib/test/dataManip/tst_psMatrix03.c	(revision 3025)
+++ /trunk/psLib/test/dataManip/tst_psMatrix03.c	(revision 3026)
@@ -14,6 +14,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.12 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2004-12-10 20:00:06 $
+ *  @version $Revision: 1.13 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2005-01-17 22:17:29 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -108,5 +108,4 @@
     inVector->n = 3;
     luImage32 = (psImage*)psImageAlloc(3, 3, PS_TYPE_F32);
-    perm32 = (psVector*)psVectorAlloc(3, PS_TYPE_F32);
     outVector32 = (psVector*)psVectorAlloc(3, PS_TYPE_F32);
     inVector32 = (psVector*)psVectorAlloc(3, PS_TYPE_F32);
@@ -131,5 +130,5 @@
     printPositiveTestHeader(stdout, "psMatrix", "Calculate LU matrix");
     tempImage = luImage;
-    luImage = psMatrixLUD(luImage, perm, inImage);
+    luImage = psMatrixLUD(luImage, &perm, inImage);
     CHECK_MATRIX(luImage);
     if(luImage->type.dimen != PS_DIMEN_IMAGE) {
@@ -140,5 +139,5 @@
 
     tempImage32 = luImage32;
-    luImage32 = psMatrixLUD(luImage32, perm32, inImage32);
+    luImage32 = psMatrixLUD(luImage32, &perm32, inImage32);
     CHECK_MATRIX(luImage32);
     if(luImage32->type.dimen != PS_DIMEN_IMAGE) {
Index: /trunk/psLib/test/fileUtils/.cvsignore
===================================================================
--- /trunk/psLib/test/fileUtils/.cvsignore	(revision 3025)
+++ /trunk/psLib/test/fileUtils/.cvsignore	(revision 3026)
@@ -3,2 +3,3 @@
 tst_psFits
 multi.fits
+table.fits
