Index: /branches/eam_branches/ipp-20230313/psLib/test/astro/tap_psCoord.c
===================================================================
--- /branches/eam_branches/ipp-20230313/psLib/test/astro/tap_psCoord.c	(revision 42492)
+++ /branches/eam_branches/ipp-20230313/psLib/test/astro/tap_psCoord.c	(revision 42493)
@@ -48,5 +48,5 @@
     {
         psMemId id = psMemGetId();
-        psPlaneTransform *myPT = psPlaneTransformAlloc(ORDER_X, ORDER_Y);
+        psPlaneTransform *myPT = psPlaneTransformAlloc(ORDER_X, ORDER_Y, PS_POLYNOMIAL_ORD);
         ok(myPT != NULL, "psPlaneTransformAlloc() returned non-NULL");
         skip_start(myPT == NULL, 4, "Skipping tests because psPlaneTransformAlloc() returned NULL");
@@ -59,9 +59,9 @@
         // Attempt to specify negative x order and verify NULL returned and
         // errror message generated
-        myPT = psPlaneTransformAlloc(-1, 1);
+        myPT = psPlaneTransformAlloc(-1, 1, PS_POLYNOMIAL_ORD);
         ok(myPT == NULL, "psPlaneTransformAlloc(-1, 1) returned NULL");
         psFree(myPT);
 
-        myPT = psPlaneTransformAlloc(1, -1);
+        myPT = psPlaneTransformAlloc(1, -1, PS_POLYNOMIAL_ORD);
         ok(myPT == NULL, "psPlaneTransformAlloc(1, -1) returned NULL");
         psFree(myPT);
@@ -110,5 +110,5 @@
         ok(in != NULL, "psPlaneAlloc() returned non-NULL");
         skip_start(in == NULL, 2, "Skipping tests because psPlaneAlloc() returned NULL");
-        psPlaneTransform* pt = psPlaneTransformAlloc(2,2);
+        psPlaneTransform* pt = psPlaneTransformAlloc(2, 2, PS_POLYNOMIAL_ORD);
         ok(pt != NULL, "psPlaneTransformAlloc() returned non-NULL");
         skip_start(pt == NULL, 1, "Skipping tests because psPlaneTransformAlloc() returned NULL");
@@ -169,5 +169,5 @@
         psMemId id = psMemGetId();
         psPlane *in = psPlaneAlloc();
-        psPlaneTransform *pt = psPlaneTransformAlloc(2,2);
+        psPlaneTransform *pt = psPlaneTransformAlloc(2, 2, PS_POLYNOMIAL_ORD);
         psFree(pt->x);
         pt->x = NULL;
@@ -184,5 +184,5 @@
         psMemId id = psMemGetId();
         psPlane* in = psPlaneAlloc();
-        psPlaneTransform* pt = psPlaneTransformAlloc(2,2);
+        psPlaneTransform* pt = psPlaneTransformAlloc(2,2, PS_POLYNOMIAL_ORD);
         psFree(pt->y);
         pt->y = NULL;
@@ -198,5 +198,5 @@
     {
         psMemId id = psMemGetId();
-        psPlaneTransform* pt = psPlaneTransformAlloc(2,2);
+        psPlaneTransform* pt = psPlaneTransformAlloc(2,2, PS_POLYNOMIAL_ORD);
         psPlane *tmpPL = psPlaneTransformApply(NULL, pt, NULL);
         ok(tmpPL == NULL, "psPlaneTransformApply(NULL, pt, NULL) did not return NULL");
@@ -314,5 +314,5 @@
     {
         psMemId id = psMemGetId();
-        psPlaneTransform *trans = psPlaneTransformAlloc(1, 3);
+        psPlaneTransform *trans = psPlaneTransformAlloc(1, 3, PS_POLYNOMIAL_ORD);
         psPixels *output = psPixelsTransform(NULL, NULL, trans);
         ok(output == NULL, "psPixelsTransform(NULL, NULL, trans) returned NULL");
@@ -342,5 +342,5 @@
         input->data[1].x = 1.0;
         input->data[1].y = 6.0;
-        psPlaneTransform *trans = psPlaneTransformAlloc(1, 3);
+        psPlaneTransform *trans = psPlaneTransformAlloc(1, 3, PS_POLYNOMIAL_ORD);
         trans->x->coeff[0][0] = 0;
         trans->x->coeff[1][0] = 1.0;
Index: /branches/eam_branches/ipp-20230313/psLib/test/astro/tap_psCoord02.c
===================================================================
--- /branches/eam_branches/ipp-20230313/psLib/test/astro/tap_psCoord02.c	(revision 42492)
+++ /branches/eam_branches/ipp-20230313/psLib/test/astro/tap_psCoord02.c	(revision 42493)
@@ -189,6 +189,6 @@
                                     for (psS32 t2yy = 0 ; t2yy < TST04_T2_Y_Y ; t2yy++) {
                                         //printf("(%d %d %d %d %d %d %d %d)\n", t1xx, t1xy, t1yx, t1yy, t2xx, t2xy, t2yx, t2yy);
-                                        psPlaneTransform *trans1 = psPlaneTransformAlloc(PS_MAX(t1xx, t1yx), PS_MAX(t1xy, t1yy));
-                                        psPlaneTransform *trans2 = psPlaneTransformAlloc(PS_MAX(t2xx, t2yx), PS_MAX(t2xy, t2yy));
+                                        psPlaneTransform *trans1 = psPlaneTransformAlloc(PS_MAX(t1xx, t1yx), PS_MAX(t1xy, t1yy), PS_POLYNOMIAL_ORD);
+                                        psPlaneTransform *trans2 = psPlaneTransformAlloc(PS_MAX(t2xx, t2yx), PS_MAX(t2xy, t2yy), PS_POLYNOMIAL_ORD);
                                         psPlaneTransform *trans3 = NULL;
                                         setCoeffs(trans1, trans2);
@@ -228,5 +228,5 @@
     {
         psMemId id = psMemGetId();
-        psPlaneTransform *trans2 = psPlaneTransformAlloc(2, 2);
+        psPlaneTransform *trans2 = psPlaneTransformAlloc(2, 2, PS_POLYNOMIAL_ORD);
         psPlaneTransform *trans3 = psPlaneTransformCombine(NULL, NULL, trans2, psRegionSet(0,0,0,0), 10);
         ok(trans3 == NULL, "psPlaneTransformCombine() returned NULL with NULL trans1 input");
@@ -241,5 +241,5 @@
     {
         psMemId id = psMemGetId();
-        psPlaneTransform *trans1 = psPlaneTransformAlloc(2, 2);
+        psPlaneTransform *trans1 = psPlaneTransformAlloc(2, 2, PS_POLYNOMIAL_ORD);
         psPlaneTransform *trans3 = psPlaneTransformCombine(NULL, trans1, NULL, psRegionSet(0,0,0,0), 10);
         ok(trans3 == NULL, "psPlaneTransformCombine() returned NULL with NULL trans2 input");
@@ -281,5 +281,5 @@
     {
         psMemId id = psMemGetId();
-        psPlaneTransform *trans = psPlaneTransformAlloc(TST05_X_POLY_ORDER, TST05_Y_POLY_ORDER);
+        psPlaneTransform *trans = psPlaneTransformAlloc(TST05_X_POLY_ORDER, TST05_Y_POLY_ORDER, PS_POLYNOMIAL_ORD);
         psArray *dst = psArrayAlloc((int) TST05_NUM_DATA);
         ok(!psPlaneTransformFit(trans, NULL, dst, 100, 100.0), "psPlaneTransformFit() returned FALSE with NULL src psArray");
@@ -295,5 +295,5 @@
     {
         psMemId id = psMemGetId();
-        psPlaneTransform *trans = psPlaneTransformAlloc(TST05_X_POLY_ORDER, TST05_Y_POLY_ORDER);
+        psPlaneTransform *trans = psPlaneTransformAlloc(TST05_X_POLY_ORDER, TST05_Y_POLY_ORDER, PS_POLYNOMIAL_ORD);
         psArray *src = psArrayAlloc((int) TST05_NUM_DATA);
         ok(!psPlaneTransformFit(trans, src, NULL, 100, 100.0), "psPlaneTransformFit() returned FALSE with NULL dst psArray");
@@ -309,6 +309,6 @@
     {
         psMemId id = psMemGetId();
-        psPlaneTransform *trans = psPlaneTransformAlloc(TST05_X_POLY_ORDER, TST05_Y_POLY_ORDER);
-        psPlaneTransform *transInit = psPlaneTransformAlloc(TST05_X_POLY_ORDER, TST05_Y_POLY_ORDER);
+        psPlaneTransform *trans = psPlaneTransformAlloc(TST05_X_POLY_ORDER, TST05_Y_POLY_ORDER, PS_POLYNOMIAL_ORD);
+        psPlaneTransform *transInit = psPlaneTransformAlloc(TST05_X_POLY_ORDER, TST05_Y_POLY_ORDER, PS_POLYNOMIAL_ORD);
         psArray *src = psArrayAlloc((int) TST05_NUM_DATA);
         psArray *dst = psArrayAlloc((int) TST05_NUM_DATA);
@@ -403,5 +403,5 @@
         psMemId id = psMemGetId();
         psRegion myRegion = psRegionSet(1.0, 5.0, 1.0, 5.0);
-        psPlaneTransform *transInverse = psPlaneTransformInvert(NULL, NULL, myRegion, 10);
+        psPlaneTransform *transInverse = psPlaneTransformInvert(NULL, NULL, myRegion, 10, 2);
         ok(transInverse == NULL, "psPlaneTransformInvert() returned NULL with NULL trans");
         psFree(transInverse);
@@ -416,7 +416,7 @@
     {
         psMemId id = psMemGetId();
-        psPlaneTransform *trans = psPlaneTransformAlloc(1, 1);
+        psPlaneTransform *trans = psPlaneTransformAlloc(1, 1, PS_POLYNOMIAL_ORD);
         psRegion myRegion = psRegionSet(1.0, 5.0, 1.0, 5.0);
-        psPlaneTransform *transInverse = psPlaneTransformInvert(NULL, trans, myRegion, 0);
+        psPlaneTransform *transInverse = psPlaneTransformInvert(NULL, trans, myRegion, 0, 2);
         ok(transInverse == NULL, "psPlaneTransformInvert() returned NULL with zero nSamples");
         psFree(trans);
@@ -434,5 +434,5 @@
         psMemId id = psMemGetId();
         bool errorFlag = false;
-        psPlaneTransform *trans = psPlaneTransformAlloc(1, 1);
+        psPlaneTransform *trans = psPlaneTransformAlloc(1, 1, PS_POLYNOMIAL_ORD);
         psPlaneTransform *transInverse = NULL;
         psRegion myRegion = psRegionSet(1.0, 5.0, 1.0, 5.0);
@@ -473,5 +473,5 @@
             }
 
-            transInverse = psPlaneTransformInvert(NULL, trans, myRegion, 10);
+            transInverse = psPlaneTransformInvert(NULL, trans, myRegion, 10, 2);
             if (transInverse == NULL) {
                 diag("TEST ERROR: psPlaneTransformInvert() returned a NULL psPlaneTransform.\n");
@@ -514,5 +514,5 @@
     {
         psMemId id = psMemGetId();
-        psPlaneTransform *trans = psPlaneTransformAlloc(1, 3);
+        psPlaneTransform *trans = psPlaneTransformAlloc(1, 3, PS_POLYNOMIAL_ORD);
         psPlane *deriv = psPlaneTransformDeriv(NULL, trans, NULL);
         ok(deriv == NULL, "psPlaneTransformDeriv(NULL, trans, NULL) returned NULL");
@@ -532,5 +532,5 @@
         coord->x = 3.0;
         coord->y = 1.0;
-        trans = psPlaneTransformAlloc(1, 3);
+        trans = psPlaneTransformAlloc(1, 3, PS_POLYNOMIAL_ORD);
         //Set Polynomials.  f(x) = x, f(y) = 0.5*y^2  -->  f'(x) = 1, f'(y) = y
         //So for 1,1  -> f'(1) = 1, f'(1) = 1
Index: /branches/eam_branches/ipp-20230313/psLib/test/fits/tap_psFits.c
===================================================================
--- /branches/eam_branches/ipp-20230313/psLib/test/fits/tap_psFits.c	(revision 42492)
+++ /branches/eam_branches/ipp-20230313/psLib/test/fits/tap_psFits.c	(revision 42493)
@@ -717,5 +717,5 @@
             ok(vecItem != NULL, "Retrieved psVector metadata item from file (row=%d)", row);
 
-            ok(vecItem->type.type == PS_DATA_S32 &&
+            ok(vecItem->type.type == PS_TYPE_S32 &&
                vecItem->data.S32[0] == row &&
                vecItem->data.S32[3] == row+30,
Index: /branches/eam_branches/ipp-20230313/psLib/test/imageops/Makefile.am
===================================================================
--- /branches/eam_branches/ipp-20230313/psLib/test/imageops/Makefile.am	(revision 42492)
+++ /branches/eam_branches/ipp-20230313/psLib/test/imageops/Makefile.am	(revision 42493)
@@ -18,5 +18,4 @@
 	tap_psImageSmooth \
 	tap_psImageSmoothMask_Threaded \
-	tap_psImageSmooth_PreAlloc \
 	tap_psImageStructManip \
 	tap_psImageConvolve \
@@ -32,4 +31,5 @@
 	tap_psImageCovariance
 
+# 	tap_psImageSmooth_PreAlloc
 #	tap_psImageShiftKernel
 #	tap_psImageInterpolate
Index: /branches/eam_branches/ipp-20230313/psLib/test/imageops/tap_psImageGeomManip.c
===================================================================
--- /branches/eam_branches/ipp-20230313/psLib/test/imageops/tap_psImageGeomManip.c	(revision 42492)
+++ /branches/eam_branches/ipp-20230313/psLib/test/imageops/tap_psImageGeomManip.c	(revision 42493)
@@ -528,6 +528,4 @@
 
         psImage *in;
-        psImage *out;
-        psImage *out2;
         psS32 rows = 64;
         psS32 cols = 64;
@@ -544,5 +542,5 @@
         // Verify the returned psImage structure pointer is NULL and program
         // execution doesn't stop, if input parameter input is NULL.
-        out2 = psImageRoll(NULL,NULL,0,0);
+        psImage *out2 = psImageRoll(NULL,NULL,0,0);
         if (out2 != NULL) {
             psError(PS_ERR_UNKNOWN, true,"psImageRoll did not return NULL though input image was NULL!?");
@@ -551,7 +549,7 @@
 
         psFree(in);
-        psFree(out);
-
-        #define testRollType(DATATYPE) \
+        psFree(out2);
+
+#define testRollType(DATATYPE) { 			   \
         in = psImageAlloc(rows1,cols1,PS_TYPE_##DATATYPE); \
         \
@@ -564,5 +562,5 @@
         \
         errorFlag = false; \
-        out = psImageRoll(NULL,in,rows1/4,cols1/4); \
+        psImage *out = psImageRoll(NULL,in,rows1/4,cols1/4);	\
         for (psS32 row=0;row<rows1;row++) { \
             ps##DATATYPE *inRow = in->data.DATATYPE[(row+rows1/4)%rows1]; \
@@ -579,5 +577,5 @@
         psFree(in); \
         psFree(out); \
-        ok(!errorFlag, "psImageRoll() produced the correct data values");
+        ok(!errorFlag, "psImageRoll() produced the correct data values"); }
 
         testRollType(U8);
@@ -636,5 +634,4 @@
         system("mkdir temp");
         psS32 index = 0;
-        psBool fail = false;
         psF32 radianRot;
 
@@ -711,5 +708,4 @@
                 diag("verified psF32 image failed to be read (%d deg. rotation)", rot);
                 errorFlag = true;
-                fail = true;
             } else {
                 if(fTruth->numRows != fOut->numRows || fTruth->numCols != fOut->numCols) {
@@ -788,5 +784,4 @@
                      "(%d deg. rotation) BILINEAR",rot);
                 errorFlag = true;
-                fail = true;
             } else {
                 if (sBiTruth->numRows != sBiOut->numRows ||
Index: /branches/eam_branches/ipp-20230313/psLib/test/imageops/tap_psImageInterpolate3.c
===================================================================
--- /branches/eam_branches/ipp-20230313/psLib/test/imageops/tap_psImageInterpolate3.c	(revision 42492)
+++ /branches/eam_branches/ipp-20230313/psLib/test/imageops/tap_psImageInterpolate3.c	(revision 42493)
@@ -74,12 +74,15 @@
 	// point (1) : center of center pixel
         interpOK = psImageInterpolate(&imageVal, NULL, NULL, xCenter + 0.5, yCenter + 0.5, interp);
+	ok (interpOK == PS_INTERPOLATE_STATUS_GOOD, "ok pixel");
 	pt1->data.F32[i] = imageVal;
 
 	// point (2) : edge of center pixel
         interpOK = psImageInterpolate(&imageVal, NULL, NULL, xCenter + 0.5, yCenter, interp);
+	ok (interpOK == PS_INTERPOLATE_STATUS_GOOD, "ok pixel");
 	pt2->data.F32[i] = imageVal;
 
 	// point (3) : corner of center pixel
         interpOK = psImageInterpolate(&imageVal, NULL, NULL, xCenter, yCenter, interp);
+	ok (interpOK == PS_INTERPOLATE_STATUS_GOOD, "ok pixel");
 	pt3->data.F32[i] = imageVal;
 
@@ -102,4 +105,5 @@
 
         interpOK = psImageInterpolate(&imageVal, &varianceVal, NULL, xCenter + 0.5, yCenter + 0.5, interp);
+	ok (interpOK == PS_INTERPOLATE_STATUS_GOOD, "ok pixel");
 	psStatsInit(stats);
 	psVectorStats(stats, pt1, NULL, NULL, 0);
@@ -107,4 +111,5 @@
 	
         interpOK = psImageInterpolate(&imageVal, &varianceVal, NULL, xCenter + 0.5, yCenter, interp);
+	ok (interpOK == PS_INTERPOLATE_STATUS_GOOD, "ok pixel");
 	psStatsInit(stats);
 	psVectorStats(stats, pt2, NULL, NULL, 0);
@@ -112,4 +117,5 @@
 	
         interpOK = psImageInterpolate(&imageVal, &varianceVal, NULL, xCenter, yCenter, interp);
+	ok (interpOK == PS_INTERPOLATE_STATUS_GOOD, "ok pixel");
 	psStatsInit(stats);
 	psVectorStats(stats, pt3, NULL, NULL, 0);
Index: /branches/eam_branches/ipp-20230313/psLib/test/imageops/tap_psImageMapFit.c
===================================================================
--- /branches/eam_branches/ipp-20230313/psLib/test/imageops/tap_psImageMapFit.c	(revision 42492)
+++ /branches/eam_branches/ipp-20230313/psLib/test/imageops/tap_psImageMapFit.c	(revision 42493)
@@ -79,5 +79,7 @@
 
 	// fit the data to the map
-	psImageMapFit (map, NULL, 0, x, y, f, NULL);
+	bool status;
+	psImageMapFit (&status, map, NULL, 0, x, y, f, NULL);
+	ok (status, "ok fit");
 
 	psImage *model = psImageAlloc(field->numCols, field->numRows, PS_TYPE_F32);
@@ -153,5 +155,7 @@
 
 	// fit the data to the map
-	psImageMapFit (map, NULL, 0, x, y, f, NULL);
+	bool status;
+	psImageMapFit (&status, map, NULL, 0, x, y, f, NULL);
+	ok (status, "ok fit");
 
 	psImage *model = psImageAlloc(field->numCols, field->numRows, PS_TYPE_F32);
@@ -235,5 +239,7 @@
 
 	// fit the data to the map
-	psImageMapFit (map, NULL, 0, x, y, f, NULL);
+	bool status;
+	psImageMapFit (&status, map, NULL, 0, x, y, f, NULL);
+	ok (status, "ok fit");
 
 	psImage *model = psImageAlloc(field->numCols, field->numRows, PS_TYPE_F32);
@@ -318,5 +324,7 @@
 
 	// fit the data to the map
-	psImageMapFit (map, NULL, 0, x, y, f, NULL);
+	bool status;
+	psImageMapFit (&status, map, NULL, 0, x, y, f, NULL);
+	ok (status, "ok fit");
 
 	psImage *model = psImageAlloc(field->numCols, field->numRows, PS_TYPE_F32);
@@ -384,5 +392,7 @@
 
 	// fit the data to the map
-	psImageMapFit (map, NULL, 0, x, y, f, NULL);
+	bool status;
+	psImageMapFit (&status, map, NULL, 0, x, y, f, NULL);
+	ok (status, "ok fit");
 
 	psImage *model = psImageAlloc(field->numCols, field->numRows, PS_TYPE_F32);
@@ -445,5 +455,7 @@
 
 	// fit the data to the map
-	psImageMapFit (map, NULL, 0, x, y, f, NULL);
+	bool status;
+	psImageMapFit (&status, map, NULL, 0, x, y, f, NULL);
+	ok (status, "ok fit");
 
 	psImage *model = psImageAlloc(field->numCols, field->numRows, PS_TYPE_F32);
@@ -526,5 +538,7 @@
 
 	// fit the data to the map
-	psImageMapFit (map, NULL, 0, x, y, f, NULL);
+	bool status;
+	psImageMapFit (&status, map, NULL, 0, x, y, f, NULL);
+	ok (status, "ok fit");
 
 	psImage *model = psImageAlloc(field->numCols, field->numRows, PS_TYPE_F32);
@@ -595,5 +609,7 @@
 
 	// fit the data to the map
-	psImageMapFit (map, NULL, 0, x, y, f, NULL);
+	bool status;
+	psImageMapFit (&status, map, NULL, 0, x, y, f, NULL);
+	ok (status, "ok fit");
 
 	psImage *model = psImageAlloc(field->numCols, field->numRows, PS_TYPE_F32);
@@ -686,5 +702,7 @@
 
 	// fit the data to the map
-	psImageMapFit (map, NULL, 0, x, y, f, NULL);
+	bool status;
+	psImageMapFit (&status, map, NULL, 0, x, y, f, NULL);
+	ok (status, "ok fit");
 
 	psImage *model = psImageAlloc(field->numCols, field->numRows, PS_TYPE_F32);
@@ -753,5 +771,7 @@
 
 	// fit the data to the map
-	psImageMapFit (map, NULL, 0, x, y, f, NULL);
+	bool status;
+	psImageMapFit (&status, map, NULL, 0, x, y, f, NULL);
+	ok (status, "ok fit");
 
 	psImage *model = psImageAlloc(field->numCols, field->numRows, PS_TYPE_F32);
@@ -814,5 +834,7 @@
 
 	// fit the data to the map
-	psImageMapFit (map, NULL, 0, x, y, f, NULL);
+	bool status;
+	psImageMapFit (&status, map, NULL, 0, x, y, f, NULL);
+	ok (status, "ok fit");
 
 	psImage *model = psImageAlloc(field->numCols, field->numRows, PS_TYPE_F32);
Index: /branches/eam_branches/ipp-20230313/psLib/test/imageops/tap_psImageMapFit2.c
===================================================================
--- /branches/eam_branches/ipp-20230313/psLib/test/imageops/tap_psImageMapFit2.c	(revision 42492)
+++ /branches/eam_branches/ipp-20230313/psLib/test/imageops/tap_psImageMapFit2.c	(revision 42493)
@@ -61,5 +61,8 @@
 
 	// fit the data to the map
-	psImageMapFit (map, x, y, f, NULL);
+	bool status;
+	psImageMapFit (&status, map, NULL, 0, x, y, f, NULL);
+	ok (status, "ok fit");
+	// psImageMapFit (map, x, y, f, NULL);
 
 	psImage *field = psImageAlloc(1000, 1000, PS_TYPE_F32);
@@ -124,5 +127,5 @@
 	for (int ix = 0; ix < 1000; ix += 20) {
 	    for (int iy = 0; iy < 1000; iy += 20) {
-		x->data.F32[x->n] = ix + 0,5;
+		x->data.F32[x->n] = ix + 0.5;
 		y->data.F32[y->n] = iy + 0.5;
 		f->data.F32[f->n] = PS_SQR(x->data.F32[x->n]) + PS_SQR(y->data.F32[x->n]);
@@ -141,5 +144,8 @@
 	// XXX this function needs to correct for the mean superpixel position 
 	// which is sampled...
-	psImageMapFit (map, NULL, 0, x, y, f, NULL);
+	bool status;
+	psImageMapFit (&status, map, NULL, 0, x, y, f, NULL);
+	ok (status, "ok fit");
+	// psImageMapFit (map, NULL, 0, x, y, f, NULL);
 	psFree (binning);
 
Index: /branches/eam_branches/ipp-20230313/psLib/test/imageops/tap_psImageMaskOps.c
===================================================================
--- /branches/eam_branches/ipp-20230313/psLib/test/imageops/tap_psImageMaskOps.c	(revision 42492)
+++ /branches/eam_branches/ipp-20230313/psLib/test/imageops/tap_psImageMaskOps.c	(revision 42493)
@@ -121,5 +121,5 @@
         }
         psImageMaskRegion(img, reg, "=", maskVal);
-        psBool errorFlag = false;
+        errorFlag = false;
         for (int i = 0 ; i < numRows ; i++) {
             for (int j = 0 ; j < numCols ; j++) {
@@ -149,5 +149,5 @@
         maskVal = 0xf;
         psImageMaskRegion(img, reg, "&", maskVal);
-        psBool errorFlag = false;
+        errorFlag = false;
         for (int i = 0 ; i < numRows ; i++) {
             for (int j = 0 ; j < numCols ; j++) {
@@ -177,5 +177,5 @@
         maskVal = 0xf;
         psImageMaskRegion(img, reg, "^", maskVal);
-        psBool errorFlag = false;
+        errorFlag = false;
         for (int i = 0 ; i < numRows ; i++) {
             for (int j = 0 ; j < numCols ; j++) {
@@ -250,5 +250,5 @@
         }
         psImageKeepRegion(img, reg, "=", maskVal);
-        psBool errorFlag = false;
+        errorFlag = false;
         for (int i = 0 ; i < numRows ; i++) {
             for (int j = 0 ; j < numCols ; j++) {
@@ -278,5 +278,5 @@
         maskVal = 0xf;
         psImageKeepRegion(img, reg, "&", maskVal);
-        psBool errorFlag = false;
+        errorFlag = false;
         for (int i = 0 ; i < numRows ; i++) {
             for (int j = 0 ; j < numCols ; j++) {
@@ -306,5 +306,5 @@
         maskVal = 0xf;
         psImageKeepRegion(img, reg, "^", maskVal);
-        psBool errorFlag = false;
+        errorFlag = false;
         for (int i = 0 ; i < numRows ; i++) {
             for (int j = 0 ; j < numCols ; j++) {
@@ -381,5 +381,5 @@
         }
         psImageMaskCircle(img, (psF64) x, (psF64) y, (psF64) radius, "=", maskVal);
-        psBool errorFlag = false;
+        errorFlag = false;
         for (int i = 0 ; i < numRows ; i++) {
             for (int j = 0 ; j < numCols ; j++) {
@@ -409,5 +409,5 @@
         maskVal = 0xf;
         psImageMaskCircle(img, (psF64) x, (psF64) y, (psF64) radius, "&", maskVal);
-        psBool errorFlag = false;
+        errorFlag = false;
         for (int i = 0 ; i < numRows ; i++) {
             for (int j = 0 ; j < numCols ; j++) {
@@ -437,5 +437,5 @@
         maskVal = 0xf;
         psImageMaskCircle(img, (psF64) x, (psF64) y, (psF64) radius, "^", maskVal);
-        psBool errorFlag = false;
+        errorFlag = false;
         for (int i = 0 ; i < numRows ; i++) {
             for (int j = 0 ; j < numCols ; j++) {
@@ -504,5 +504,5 @@
         }
         psImageKeepCircle(img, (psF64) x, (psF64) y, (psF64) radius, "=", maskVal);
-        psBool errorFlag = false;
+        errorFlag = false;
         for (int i = 0 ; i < numRows ; i++) {
             for (int j = 0 ; j < numCols ; j++) {
@@ -532,5 +532,5 @@
         maskVal = 0xf;
         psImageKeepCircle(img, (psF64) x, (psF64) y, (psF64) radius, "&", maskVal);
-        psBool errorFlag = false;
+        errorFlag = false;
         for (int i = 0 ; i < numRows ; i++) {
             for (int j = 0 ; j < numCols ; j++) {
@@ -560,5 +560,5 @@
         maskVal = 0xf;
         psImageKeepCircle(img, (psF64) x, (psF64) y, (psF64) radius, "^", maskVal);
-        psBool errorFlag = false;
+        errorFlag = false;
         for (int i = 0 ; i < numRows ; i++) {
             for (int j = 0 ; j < numCols ; j++) {
Index: /branches/eam_branches/ipp-20230313/psLib/test/jpeg/tap_psImageJpeg.c
===================================================================
--- /branches/eam_branches/ipp-20230313/psLib/test/jpeg/tap_psImageJpeg.c	(revision 42492)
+++ /branches/eam_branches/ipp-20230313/psLib/test/jpeg/tap_psImageJpeg.c	(revision 42493)
@@ -82,8 +82,8 @@
 
     // add elements to bDraw buffer
-    bDrawSetBuffer(bdbuf);
+    // XXX deprecated: bDrawSetBuffer(bdbuf);
     bDrawColor red = KapaColorByName("red");
-    bDrawSetStyle (red, 1, 0);
-    bDrawCircle(40.0, 20.0, 3.0);
+    bDrawSetStyle (bdbuf, red, 1, 0, 1.0);
+    bDrawCircle(bdbuf, 40.0, 20.0, 3.0);
 
     options->min = ZMIN;
Index: /branches/eam_branches/ipp-20230313/psLib/test/math/Makefile.am
===================================================================
--- /branches/eam_branches/ipp-20230313/psLib/test/math/Makefile.am	(revision 42492)
+++ /branches/eam_branches/ipp-20230313/psLib/test/math/Makefile.am	(revision 42493)
@@ -23,4 +23,5 @@
 	tap_psMatrix07 \
 	tap_psMatrix08 \
+	tap_psPolyFit_IRLS \
 	tap_psPolyFit1D \
 	tap_psPolyFit2D \
Index: /branches/eam_branches/ipp-20230313/psLib/test/math/tap_psMinimizeLMM.c
===================================================================
--- /branches/eam_branches/ipp-20230313/psLib/test/math/tap_psMinimizeLMM.c	(revision 42492)
+++ /branches/eam_branches/ipp-20230313/psLib/test/math/tap_psMinimizeLMM.c	(revision 42493)
@@ -53,5 +53,6 @@
 
 #define NUM_ITER 10
-#define TOL  20.0
+#define MIN_TOL  20.0
+#define MAX_TOL  40.0
 psS32 main(psS32 argc, char* argv[])
 {
@@ -64,9 +65,10 @@
     {
         psMemId id = psMemGetId();
-        psMinimization *tmp = psMinimizationAlloc(NUM_ITER, TOL);
+        psMinimization *tmp = psMinimizationAlloc(NUM_ITER, MIN_TOL, MAX_TOL);
         ok(tmp != NULL, "psMinimizationAlloc() returned non-NULL");
         skip_start(tmp == NULL, 5, "Skipping tests because psMinimizationAlloc() failed");
         ok(tmp->maxIter == NUM_ITER, "psMinimizationAlloc() properly set ->maxIter");
-        ok(tmp->tol == TOL, "psMinimizationAlloc() properly set ->tol");
+        ok(tmp->minTol == MIN_TOL, "psMinimizationAlloc() properly set ->tol");
+        ok(tmp->maxTol == MAX_TOL, "psMinimizationAlloc() properly set ->tol");
         ok(tmp->value == 0.0, "psMinimizationAlloc() properly set ->value");
         ok(tmp->iter == 0, "psMinimizationAlloc() properly set ->iter (%d)", tmp->iter);
@@ -96,5 +98,5 @@
         psMemId id = psMemGetId();
         psRandom *rng = psRandomAllocSpecific(PS_RANDOM_TAUS, 1); // Random number generator; using known seed
-        psMinimization *min = psMinimizationAlloc(NUM_ITERATIONS, ERR_TOL);
+        psMinimization *min = psMinimizationAlloc(NUM_ITERATIONS, ERR_TOL, 100);
         psArray *ordinates = psArrayAlloc(NUM_DATA_POINTS);
         psVector *coordinates = psVectorAlloc(NUM_DATA_POINTS, PS_TYPE_F32);
@@ -204,5 +206,5 @@
         psMemId id = psMemGetId();
         psRandom *rng = psRandomAllocSpecific(PS_RANDOM_TAUS, 1); // Random number generator; using known seed
-        psMinimization *min = psMinimizationAlloc(NUM_ITERATIONS, ERR_TOL);
+        psMinimization *min = psMinimizationAlloc(NUM_ITERATIONS, ERR_TOL, 100);
         psArray *ordinates = psArrayAlloc(NUM_DATA_POINTS);
         psVector *coordinates = psVectorAlloc(NUM_DATA_POINTS, PS_TYPE_F32);
Index: /branches/eam_branches/ipp-20230313/psLib/test/math/tap_psMinimizePowell.c
===================================================================
--- /branches/eam_branches/ipp-20230313/psLib/test/math/tap_psMinimizePowell.c	(revision 42492)
+++ /branches/eam_branches/ipp-20230313/psLib/test/math/tap_psMinimizePowell.c	(revision 42493)
@@ -81,5 +81,5 @@
         psVector *myParams = psVectorAlloc(NUM_PARAMS, PS_TYPE_F32);
         psVector *myParamMask = psVectorAlloc(NUM_PARAMS, PS_TYPE_U8);
-        psMinimization *min = psMinimizationAlloc(100, 0.01);
+        psMinimization *min = psMinimizationAlloc(100, 0.01, 0.1);
         psArray *myCoords = psArrayAlloc(N);
 
@@ -136,5 +136,5 @@
         psMemId id = psMemGetId();
         psVector *myParams = psVectorAlloc(NUM_PARAMS, PS_TYPE_F32);
-        psMinimization *min = psMinimizationAlloc(100, 0.01);
+        psMinimization *min = psMinimizationAlloc(100, 0.01, 0.1);
         psArray *myCoords = psArrayAlloc(N);
         psVector *myParamMask = psVectorAlloc(NUM_PARAMS, PS_TYPE_U8);
Index: /branches/eam_branches/ipp-20230313/psLib/test/math/tap_psPolyFit_IRLS.c
===================================================================
--- /branches/eam_branches/ipp-20230313/psLib/test/math/tap_psPolyFit_IRLS.c	(revision 42493)
+++ /branches/eam_branches/ipp-20230313/psLib/test/math/tap_psPolyFit_IRLS.c	(revision 42493)
@@ -0,0 +1,87 @@
+#include <stdio.h>
+#include <string.h>
+#include <pslib.h>
+#include "tap.h"
+#include "pstap.h"
+
+#define POLY_ORDER 5
+// #define A -560.0
+// #define B +1116.0
+// #define C -736.0
+// #define D +203.0
+// #define E -24.0
+// #define F +1.0
+
+// #define A -460.0
+// #define B +1300.0
+// #define C -300.0
+// #define D +400.0
+// #define E -30.0
+// #define F +2.0
+
+#define A -300.0
+#define B +1200.0
+#define C -400.0
+#define D +500.0
+#define E -100.0
+#define F +3.0
+
+#define MASK_VALUE 1
+
+psF32 setData(psF32 x)
+{
+  return(A + (B * x) + (C * x * x) + (D * x * x * x) + (E * x * x * x * x) + (F * x * x * x * x * x));
+}
+
+int main()
+{
+  psLogSetFormat("HLNM");
+  psLogSetLevel(PS_LOG_INFO);
+  plan_tests(104);
+
+  // create x vector running from -1 to 11 in steps of 0.1
+  int numData = 120;
+  psVector *xTruth = psVectorAlloc(numData, PS_TYPE_F64);
+  psVector *fTruth = psVectorAlloc(numData, PS_TYPE_F64);
+  psRandom *rng = psRandomAllocSpecific(PS_RANDOM_TAUS, 1); // Using a known seed
+
+  psPolynomial1D *myPoly = psPolynomial1DAlloc(PS_POLYNOMIAL_ORD, POLY_ORDER);
+  psVector *x = psVectorAlloc(numData, PS_TYPE_F64);
+  psVector *f = psVectorAlloc(numData, PS_TYPE_F64);
+  psVector *fErr = psVectorAlloc(numData, PS_TYPE_F64);
+  // psVector *mask = psVectorAlloc(numData, PS_TYPE_U8);
+    
+  // XXX F64 or F32??
+  for (int i = 0; i < numData; i++) {
+    xTruth->data.F64[i] = 0.1*i - 1.0;
+    fTruth->data.F64[i] = setData(xTruth->data.F64[i]);
+  }
+
+  // set values with an error of sigma
+  double sigma = 0.01;
+  for (int i = 0; i < numData; i++) {
+    x->data.F64[i] = xTruth->data.F64[i];
+    f->data.F64[i] = fTruth->data.F64[i] + sigma*psRandomGaussian(rng);
+    fErr->data.F64[i] = sigma;
+    // fprintf (stdout, "%d %f %f %f\n", i, x->data.F64[i], f->data.F64[i], fErr->data.F64[i]);
+  }
+
+  {
+    psMemId id = psMemGetId();
+    bool rc = psVectorFitPolynomial1D(myPoly, NULL, MASK_VALUE, f, fErr, x);
+    ok(rc == true, "fit succeeded mechanically");
+
+    // compare the fitted values to the input coefficients
+
+    fprintf (stderr, "%5.2f vs %5.2f\n", myPoly->coeff[0], A);
+    fprintf (stderr, "%5.2f vs %5.2f\n", myPoly->coeff[1], B);
+    fprintf (stderr, "%5.2f vs %5.2f\n", myPoly->coeff[2], C);
+    fprintf (stderr, "%5.2f vs %5.2f\n", myPoly->coeff[3], D);
+    fprintf (stderr, "%5.2f vs %5.2f\n", myPoly->coeff[4], E);
+    fprintf (stderr, "%5.2f vs %5.2f\n", myPoly->coeff[5], F);
+
+    ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+  }
+
+}
+
Index: /branches/eam_branches/ipp-20230313/psLib/test/math/tap_psSparse.c
===================================================================
--- /branches/eam_branches/ipp-20230313/psLib/test/math/tap_psSparse.c	(revision 42492)
+++ /branches/eam_branches/ipp-20230313/psLib/test/math/tap_psSparse.c	(revision 42493)
@@ -1,3 +1,3 @@
-    #include <stdio.h>
+#include <stdio.h>
 #include <string.h>
 #include <pslib.h>
@@ -227,5 +227,5 @@
         // test the support functions: LowerProduct
         fVec = psSparseBorderLowerProduct(NULL, border, xRef);
-        is_float(fVec->n, 1.0, "f dimen: %d", fVec->n);
+        is_int(fVec->n, 1.0, "f dimen: %d", fVec->n);
         is_float(fVec->data.F32[0], 0.3, "f(0): %f", fVec->data.F32[0]);
         psFree(fVec);
@@ -233,5 +233,5 @@
         // test the support functions: Upper Product
         fVec = psSparseBorderUpperProduct(NULL, border, yRef);
-        is_float(fVec->n, 2.0, "f dimen: %d", fVec->n);
+        is_int(fVec->n, 2.0, "f dimen: %d", fVec->n);
         is_float(fVec->data.F32[0], 0.05, "f(0): %f", fVec->data.F32[0]);
         is_float(fVec->data.F32[1], 0.10, "f(0): %f", fVec->data.F32[1]);
@@ -240,5 +240,5 @@
         // test the support functions: Square Product
         fVec = psSparseBorderSquareProduct(NULL, border, yRef);
-        is_float(fVec->n, 1.0, "f dimen: %d", fVec->n);
+        is_int(fVec->n, 1.0, "f dimen: %d", fVec->n);
         is_float(fVec->data.F32[0], 0.25, "f(0): %f", fVec->data.F32[0]);
         psFree(fVec);
Index: /branches/eam_branches/ipp-20230313/psLib/test/sys/tap_psMemory.c
===================================================================
--- /branches/eam_branches/ipp-20230313/psLib/test/sys/tap_psMemory.c	(revision 42492)
+++ /branches/eam_branches/ipp-20230313/psLib/test/sys/tap_psMemory.c	(revision 42493)
@@ -428,5 +428,5 @@
 
         psPlaneTransform *planeTransform;
-        planeTransform = psPlaneTransformAlloc(1, 1);
+        planeTransform = psPlaneTransformAlloc(1, 1, PS_POLYNOMIAL_ORD);
         okay = psMemCheckType(PS_DATA_PLANETRANSFORM, planeTransform);
         if (!okay ) psFree(planeTransform);
