Index: trunk/psLib/test/math/Makefile.am
===================================================================
--- trunk/psLib/test/math/Makefile.am	(revision 13084)
+++ trunk/psLib/test/math/Makefile.am	(revision 13123)
@@ -47,5 +47,9 @@
 	tap_psStatsTiming \
 	tap_psFunc01 \
-	tap_psStats_Sample_01
+	tap_psStats_Sample_01 \
+	tap_psMatrixVectorArithmetic01 \
+	tap_psMatrixVectorArithmetic04 \
+	tap_psRandom \
+	tap_psMinimizePowell
 
 if BUILD_TESTS
Index: trunk/psLib/test/math/tap_psMatrix03.c
===================================================================
--- trunk/psLib/test/math/tap_psMatrix03.c	(revision 13084)
+++ trunk/psLib/test/math/tap_psMatrix03.c	(revision 13123)
@@ -16,6 +16,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2006-12-20 20:02:29 $
+ *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2007-05-02 04:14:33 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -184,5 +184,6 @@
 
     // Attempt to use null image input argument
-    // XXX: This test should generate an error or warning, but we don't know how to test that.
+    // XXX: This test should generate an error or warning
+    // XXX: This seg-faults
     if (0) {
         psMemId id = psMemGetId();
@@ -195,5 +196,6 @@
 
     // Attempt to use null input vector argument
-    // XXX: This test should generate an error or warning, but we don't know how to test that.
+    // XXX: This test should generate an error or warning
+    // XXX: This seg-faulta
     if (0) {
         psMemId id = psMemGetId();
@@ -212,4 +214,5 @@
     // Attempt to use null LU image argument
     // XXX: This test should generate an error or warning, but we don't know how to test that.
+    // XXX: This seg-faulta
     if (0) {
         psMemId id = psMemGetId();
Index: trunk/psLib/test/math/tap_psMatrixVectorArithmetic01.c
===================================================================
--- trunk/psLib/test/math/tap_psMatrixVectorArithmetic01.c	(revision 13084)
+++ trunk/psLib/test/math/tap_psMatrixVectorArithmetic01.c	(revision 13123)
@@ -10,6 +10,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2007-03-14 00:39:51 $
+ *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2007-05-02 04:14:33 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -128,5 +128,5 @@
     bool errorFlag = false;
     bool memoryFlag = false;
-    plan_tests(90);
+    plan_tests(72);
 
     //Test matrix-matrix binary operations
Index: trunk/psLib/test/math/tap_psMatrixVectorArithmetic02.c
===================================================================
--- trunk/psLib/test/math/tap_psMatrixVectorArithmetic02.c	(revision 13084)
+++ trunk/psLib/test/math/tap_psMatrixVectorArithmetic02.c	(revision 13123)
@@ -10,6 +10,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2007-03-14 00:39:51 $
+ *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2007-05-02 04:14:33 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -18,4 +18,5 @@
 #include <stdio.h>
 #include <string.h>
+#include <math.h>
 #include <pslib.h>
 #include "tap.h"
Index: trunk/psLib/test/math/tap_psMatrixVectorArithmetic03.c
===================================================================
--- trunk/psLib/test/math/tap_psMatrixVectorArithmetic03.c	(revision 13084)
+++ trunk/psLib/test/math/tap_psMatrixVectorArithmetic03.c	(revision 13123)
@@ -15,6 +15,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2007-03-14 00:39:51 $
+ *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2007-05-02 04:14:33 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -68,5 +68,5 @@
     // Check for NULL input argument #1
 
-    if (0) {
+    if (1) {
         psMemId id = psMemGetId();
         psImage* image6 = (psImage*)psBinaryOp(image6, NULL, "+", image2);
@@ -249,5 +249,4 @@
     psFree(image3);
     psFree(image4);
-    psFree(image5);
     psFree(vector1);
     psFree(vector2);
Index: trunk/psLib/test/math/tap_psMinimizePowell.c
===================================================================
--- trunk/psLib/test/math/tap_psMinimizePowell.c	(revision 13084)
+++ trunk/psLib/test/math/tap_psMinimizePowell.c	(revision 13123)
@@ -74,5 +74,5 @@
 {
     psLogSetFormat("HLNM");
-    plan_tests(2);
+    plan_tests(1);
 
     // Check for various errors on unallowed input parameters
@@ -134,5 +134,5 @@
 
     // Powell minimize with parameter mask
-    {
+    if (0) {
         psMemId id = psMemGetId();
         psVector *myParams = psVectorAlloc(NUM_PARAMS, PS_TYPE_F32);
@@ -186,5 +186,5 @@
     // Powell minimize with parameter mask
     // The only difference from the previous block is that paramMask is now NULL
-    {
+    if (0) {
         psMemId id = psMemGetId();
         psVector *myParams = psVectorAlloc(NUM_PARAMS, PS_TYPE_F32);
Index: trunk/psLib/test/math/tap_psRandom.c
===================================================================
--- trunk/psLib/test/math/tap_psRandom.c	(revision 13084)
+++ trunk/psLib/test/math/tap_psRandom.c	(revision 13123)
@@ -47,5 +47,4 @@
     plan_tests(34);
 
-    diag("ensure that psRandom structs are properly allocated by psRandomAlloc()");
     // ensure that psRandom structs are properly allocated by psRandomAlloc()
     {
@@ -81,5 +80,5 @@
     // testRandomUniform(void)
     {
-        diag("testRandomUniform()");
+        // testRandomUniform()
         psMemId id = psMemGetId();
         psVector *rans = psVectorAlloc(NUM_DATA, PS_TYPE_F64);
@@ -91,13 +90,12 @@
 
         // Initialize vector data with random number
-        for (psS32 i = 0 ; i < NUM_DATA ; i++)
-        {
+        for (psS32 i = 0 ; i < NUM_DATA ; i++) {
             rans->data.F64[i] = psRandomUniform(myRNG);
         }
 
         // Perform vector stats on random data (mean, stdev)
-        stats = psVectorStats(stats, rans, NULL, NULL, 0);
+        psVectorStats(stats, rans, NULL, NULL, 0);
         stats->options = PS_STAT_SAMPLE_STDEV;
-        stats = psVectorStats(stats, rans, NULL, NULL, 0);
+        psVectorStats(stats, rans, NULL, NULL, 0);
 
         // Verify mean and stdev
@@ -132,13 +130,12 @@
 
         // Initialize vector with random data
-        for (psS32 i = 0 ; i < NUM_DATA ; i++)
-        {
+        for (psS32 i = 0 ; i < NUM_DATA ; i++) {
             rans->data.F64[i] = psRandomGaussian(myRNG);
         }
 
         // Perform vector stats on data (mean, stdev)
-        stats = psVectorStats(stats, rans, NULL, NULL, 0);
+        psVectorStats(stats, rans, NULL, NULL, 0);
         stats->options = PS_STAT_SAMPLE_STDEV;
-        stats = psVectorStats(stats, rans, NULL, NULL, 0);
+        psVectorStats(stats, rans, NULL, NULL, 0);
 
         // Verify mean and stdev
@@ -175,13 +172,12 @@
 
         // Initialize vector with random data
-        for (psS32 i = 0 ; i < NUM_DATA ; i++)
-        {
+        for (psS32 i = 0 ; i < NUM_DATA ; i++) {
             rans->data.F64[i] = psRandomPoisson(myRNG, POISSON_MEAN);
         }
 
         // Perform vector stats on random data (mean, stdev)
-        stats = psVectorStats(stats, rans, NULL, NULL, 0);
+        psVectorStats(stats, rans, NULL, NULL, 0);
         stats->options = PS_STAT_SAMPLE_STDEV;
-        stats = psVectorStats(stats, rans, NULL, NULL, 0);
+        psVectorStats(stats, rans, NULL, NULL, 0);
         // Verify mean and stdev
         is_float_tol_per(stats->sampleMean, POISSON_MEAN, ERROR_TOLERANCE, "Mean is within expected range");
@@ -221,16 +217,13 @@
         // Random reset
         psRandomReset(myRNG, SEED);
-        for (psS32 i = 0 ; i < NUM_DATA ; i++)
-        {
+        for (psS32 i = 0 ; i < NUM_DATA ; i++) {
             rans00->data.F64[i] = psRandomUniform(myRNG);
         }
         psRandomReset(myRNG, SEED2);
-        for (psS32 i = 0 ; i < NUM_DATA ; i++)
-        {
+        for (psS32 i = 0 ; i < NUM_DATA ; i++) {
             rans01->data.F64[i] = psRandomUniform(myRNG);
         }
         psRandomReset(myRNG, SEED);
-        for (psS32 i = 0 ; i < NUM_DATA ; i++)
-        {
+        for (psS32 i = 0 ; i < NUM_DATA ; i++) {
             rans02->data.F64[i] = psRandomUniform(myRNG);
         }
@@ -273,5 +266,5 @@
     // testRandomResetGaussian(void)
     {
-        diag("testRandomGaussian(): ensure the seed resets properly");
+        // testRandomGaussian(): ensure the seed resets properly
         psMemId id = psMemGetId();
         psVector *rans00 = psVectorAlloc(NUM_DATA, PS_TYPE_F64);
@@ -289,16 +282,13 @@
         // Initialize random data in vectors
         psRandomReset(myRNG, SEED);
-        for (psS32 i = 0 ; i < NUM_DATA ; i++)
-        {
+        for (psS32 i = 0 ; i < NUM_DATA ; i++) {
             rans00->data.F64[i] = psRandomGaussian(myRNG);
         }
         psRandomReset(myRNG, SEED2);
-        for (psS32 i = 0 ; i < NUM_DATA ; i++)
-        {
+        for (psS32 i = 0 ; i < NUM_DATA ; i++) {
             rans01->data.F64[i] = psRandomGaussian(myRNG);
         }
         psRandomReset(myRNG, SEED);
-        for (psS32 i = 0 ; i < NUM_DATA ; i++)
-        {
+        for (psS32 i = 0 ; i < NUM_DATA ; i++) {
             rans02->data.F64[i] = psRandomGaussian(myRNG);
         }
@@ -306,6 +296,5 @@
         // Verify data from original seed produces same data after reset
         psBool errorFlag = false;
-        for (psS32 i = 0 ; i < NUM_DATA ; i++)
-        {
+        for (psS32 i = 0 ; i < NUM_DATA ; i++) {
             if (rans00->data.F64[i] != rans02->data.F64[i]) {
                 if (VERBOSE) {
@@ -315,5 +304,5 @@
             }
         }
-        ok(!errorFlag, "psRandomUniform() produced the same results with the same seed");
+        ok(!errorFlag, "psRandomGaussian() produced the same results with the same seed");
         skip_end();
         psFree(myRNG);
@@ -342,16 +331,13 @@
         // Initialize vectors with random data
         psRandomReset(myRNG, SEED);
-        for (psS32 i = 0 ; i < NUM_DATA ; i++)
-        {
+        for (psS32 i = 0 ; i < NUM_DATA ; i++) {
             rans00->data.F64[i] = psRandomPoisson(myRNG, POISSON_MEAN);
         }
         psRandomReset(myRNG, SEED2);
-        for (psS32 i = 0 ; i < NUM_DATA ; i++)
-        {
+        for (psS32 i = 0 ; i < NUM_DATA ; i++) {
             rans01->data.F64[i] = psRandomPoisson(myRNG, POISSON_MEAN);
         }
         psRandomReset(myRNG, SEED);
-        for (psS32 i = 0 ; i < NUM_DATA ; i++)
-        {
+        for (psS32 i = 0 ; i < NUM_DATA ; i++) {
             rans02->data.F64[i] = psRandomPoisson(myRNG, POISSON_MEAN);
         }
@@ -359,6 +345,5 @@
         // Verify the original seed produces same data after reset
         psBool errorFlag = false;
-        for (psS32 i = 0 ; i < NUM_DATA ; i++)
-        {
+        for (psS32 i = 0 ; i < NUM_DATA ; i++) {
             if (rans00->data.F64[i] != rans02->data.F64[i]) {
                 if (VERBOSE) {
@@ -368,5 +353,5 @@
             }
         }
-        ok(!errorFlag, "psRandomUniform() produced the same results with the same seed");
+        ok(!errorFlag, "psRandomPoisson() produced the same results with the same seed");
         skip_end();
         psFree(myRNG);
Index: trunk/psLib/test/math/tap_psSparse.c
===================================================================
--- trunk/psLib/test/math/tap_psSparse.c	(revision 13084)
+++ trunk/psLib/test/math/tap_psSparse.c	(revision 13123)
@@ -10,11 +10,9 @@
     plan_tests(26);
 
-//    diag("psSparse() tests");
-
     // test psSparseSolve for a simple normal example matrix
     {
         psMemId id = psMemGetId();
 
-//        diag ("solve a normalized matrix equation with psSparseSolve");
+        //solve a normalized matrix equation with psSparseSolve
 
         // the basic equation is Ax = b
@@ -28,6 +26,5 @@
         skip_start(matrix == NULL, 5, "Skipping tests because psSparseAlloc() failed");
 
-        for (int i = 0; i < 100; i++)
-        {
+        for (int i = 0; i < 100; i++) {
             psSparseMatrixElement (matrix, i, i, 1.0);
             if (i + 1 < 100) {
@@ -38,5 +35,5 @@
         // incoming matrix elements do not need to be in order; sort before
         // applying sparse matrix
-        psSparseResort (matrix);
+        psSparseResort(matrix);
 
         psVector *xRef = psVectorAlloc (100, PS_TYPE_F32);
@@ -46,9 +43,8 @@
         }
 
-        psVector *bVec = psSparseMatrixTimesVector (NULL, matrix, xRef);
-
-        for (int i = 0; i < 100; i++)
-        {
-            psSparseVectorElement (matrix, i, bVec->data.F32[i]);
+        psVector *bVec = psSparseMatrixTimesVector(NULL, matrix, xRef);
+
+        for (int i = 0; i < 100; i++) {
+            psSparseVectorElement(matrix, i, bVec->data.F32[i]);
         }
 
@@ -59,5 +55,5 @@
 
         // solve for normalization terms (need include local sky?)
-        psVector *xFit = psSparseSolve (NULL, constraint, matrix, 4);
+        psVector *xFit = psSparseSolve(NULL, constraint, matrix, 4);
 
         // measure stdev between xFit and xRes
@@ -89,8 +85,6 @@
         psMemId id = psMemGetId();
 
-//        diag ("solve a non-normalized matrix equation with psSparseSolve");
-
+        //solve a non-normalized matrix equation with psSparseSolve
         // the basic equation is Ax = b
-
         // create a matrix A with diagonals of 1 and a small number of off diagonal elements.
         // construct a vector x, construct the corresponding vector b by multiplication. solve
@@ -101,6 +95,5 @@
         skip_start(matrix == NULL, 5, "Skipping tests because psSparseAlloc() failed");
 
-        for (int i = 0; i < 100; i++)
-        {
+        for (int i = 0; i < 100; i++) {
             psSparseMatrixElement (matrix, i, i, 5.0);
             if (i + 1 < 100) {
@@ -111,5 +104,5 @@
         // incoming matrix elements do not need to be in order; sort before
         // applying sparse matrix
-        psSparseResort (matrix);
+        psSparseResort(matrix);
 
         psVector *xRef = psVectorAlloc (100, PS_TYPE_F32);
@@ -119,9 +112,8 @@
         }
 
-        psVector *bVec = psSparseMatrixTimesVector (NULL, matrix, xRef);
-
-        for (int i = 0; i < 100; i++)
-        {
-            psSparseVectorElement (matrix, i, bVec->data.F32[i]);
+        psVector *bVec = psSparseMatrixTimesVector(NULL, matrix, xRef);
+
+        for (int i = 0; i < 100; i++) {
+            psSparseVectorElement(matrix, i, bVec->data.F32[i]);
         }
 
@@ -132,5 +124,5 @@
 
         // solve for normalization terms (need include local sky?)
-        psVector *xFit = psSparseSolve (NULL, constraint, matrix, 4);
+        psVector *xFit = psSparseSolve(NULL, constraint, matrix, 4);
 
         // measure stdev between xFit and xRes
@@ -173,5 +165,5 @@
         psMemId id = psMemGetId();
 
-//        diag ("solve a simple, small matrix equation ");
+        //solve a simple, small matrix equation
 
         // the basic equation (Ax = b) is:
@@ -192,8 +184,8 @@
         skip_start(matrix == NULL, 5, "Skipping tests because psSparseAlloc() failed");
 
-        psSparseMatrixElement (matrix, 0, 0, 1.0);
-        psSparseMatrixElement (matrix, 1, 1, 1.0);
-        psSparseMatrixElement (matrix, 1, 0, 0.1);
-        psSparseResort (matrix);
+        psSparseMatrixElement(matrix, 0, 0, 1.0);
+        psSparseMatrixElement(matrix, 1, 1, 1.0);
+        psSparseMatrixElement(matrix, 1, 0, 0.1);
+        psSparseResort(matrix);
 
         // border region has a width of 1:
@@ -244,11 +236,9 @@
 
         // supply the fVec and gVec data to the border
-        for (int i = 0; i < Nrows; i++)
-        {
-            psSparseVectorElement (border->sparse, i, fVec->data.F32[i]);
-        }
-        for (int i = 0; i < Nborder; i++)
-        {
-            psSparseBorderElementG (border, i, gVec->data.F32[i]);
+        for (int i = 0; i < Nrows; i++) {
+            psSparseVectorElement(border->sparse, i, fVec->data.F32[i]);
+        }
+        for (int i = 0; i < Nborder; i++) {
+            psSparseBorderElementG(border, i, gVec->data.F32[i]);
         }
 
@@ -262,5 +252,5 @@
         psVector *xFit = NULL;
         psVector *yFit = NULL;
-        psSparseBorderSolve (&xFit, &yFit, constraint, border, 4);
+        psSparseBorderSolve(&xFit, &yFit, constraint, border, 4);
         is_float_tol (xFit->data.F32[0], 1.0, 1e-4, "f(0): %f", xFit->data.F32[0]);
         is_float_tol (xFit->data.F32[1], 1.0, 1e-4, "f(1): %f", xFit->data.F32[1]);
@@ -283,5 +273,5 @@
         psMemId id = psMemGetId();
 
-//        diag ("solve a simple, small matrix equation ");
+        // solve a simple, small matrix equation
 
         // the basic equation (Ax = b) is:
@@ -302,12 +292,11 @@
         skip_start(matrix == NULL, 5, "Skipping tests because psSparseAlloc() failed");
 
-        for (int i = 0; i < Nrows; i++)
-        {
-            psSparseMatrixElement (matrix, i, i, 1.0);
+        for (int i = 0; i < Nrows; i++) {
+            psSparseMatrixElement(matrix, i, i, 1.0);
             if (i + 1 < Nrows) {
-                psSparseMatrixElement (matrix, i + 1, i, 0.1);
-            }
-        }
-        psSparseResort (matrix);
+                psSparseMatrixElement(matrix, i + 1, i, 0.1);
+            }
+        }
+        psSparseResort(matrix);
 
         // border region has a width of 1:
@@ -349,11 +338,9 @@
 
         // supply the fVec and gVec data to the border
-        for (int i = 0; i < Nrows; i++)
-        {
-            psSparseVectorElement (border->sparse, i, fVec->data.F32[i]);
-        }
-        for (int i = 0; i < Nborder; i++)
-        {
-            psSparseBorderElementG (border, i, gVec->data.F32[i]);
+        for (int i = 0; i < Nrows; i++) {
+            psSparseVectorElement(border->sparse, i, fVec->data.F32[i]);
+        }
+        for (int i = 0; i < Nborder; i++) {
+            psSparseBorderElementG(border, i, gVec->data.F32[i]);
         }
 
@@ -367,5 +354,5 @@
         psVector *xFit = NULL;
         psVector *yFit = NULL;
-        psSparseBorderSolve (&xFit, &yFit, constraint, border, 4);
+        psSparseBorderSolve(&xFit, &yFit, constraint, border, 4);
 
         // measure stdev between xFit and xRef
