Changeset 12607 for trunk/psLib/test/math
- Timestamp:
- Mar 27, 2007, 12:52:03 PM (19 years ago)
- Location:
- trunk/psLib/test/math
- Files:
-
- 9 edited
-
tap_psPolynomialUtils_Derivatives.c (modified) (4 diffs)
-
tap_psRandom.c (modified) (4 diffs)
-
tap_psSparse.c (modified) (7 diffs)
-
tap_psStats00.c (modified) (14 diffs)
-
tap_psStats01.c (modified) (8 diffs)
-
tap_psStats02.c (modified) (8 diffs)
-
tap_psStats03.c (modified) (2 diffs)
-
tap_psStats06.c (modified) (2 diffs)
-
tap_psStats08.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/math/tap_psPolynomialUtils_Derivatives.c
r10848 r12607 42 42 ok(dX->nY == 2, "new y order is %d", dX->nY); 43 43 44 ok_float(dX->coeff[0][0], +2.0, "x^0 y^0 coeff is %f", dX->coeff[0][0]);45 ok_float(dX->coeff[1][0], -6.0, "x^1 y^0 coeff is %f", dX->coeff[1][0]);46 ok_float(dX->coeff[0][1], +4.0, "x^0 y^1 coeff is %f", dX->coeff[0][1]);44 is_float(dX->coeff[0][0], +2.0, "x^0 y^0 coeff is %f", dX->coeff[0][0]); 45 is_float(dX->coeff[1][0], -6.0, "x^1 y^0 coeff is %f", dX->coeff[1][0]); 46 is_float(dX->coeff[0][1], +4.0, "x^0 y^1 coeff is %f", dX->coeff[0][1]); 47 47 48 48 ok(!dX->mask[0][0], "x^0 y^0 coeff is unmasked"); … … 91 91 ok(dX->nY == 2, "new y order is %d", dX->nY); 92 92 93 ok_float(dX->coeff[0][0], +2.0, "x^0 y^0 coeff is %f", dX->coeff[0][0]);94 ok_float(dX->coeff[1][0], -6.0, "x^1 y^0 coeff is %f", dX->coeff[1][0]);95 ok_float(dX->coeff[0][1], +4.0, "x^0 y^1 coeff is %f", dX->coeff[0][1]);93 is_float(dX->coeff[0][0], +2.0, "x^0 y^0 coeff is %f", dX->coeff[0][0]); 94 is_float(dX->coeff[1][0], -6.0, "x^1 y^0 coeff is %f", dX->coeff[1][0]); 95 is_float(dX->coeff[0][1], +4.0, "x^0 y^1 coeff is %f", dX->coeff[0][1]); 96 96 97 97 ok(!dX->mask[0][0], "x^0 y^0 coeff is unmasked"); … … 172 172 ok(dY->nY == 1, "new y order is %d", dY->nY); 173 173 174 ok_float(dY->coeff[0][0], +3.0, "x^0 y^0 coeff is %f", dY->coeff[0][0]);175 ok_float(dY->coeff[1][0], +4.0, "x^1 y^0 coeff is %f", dY->coeff[1][0]);176 ok_float(dY->coeff[0][1], -4.0, "x^0 y^1 coeff is %f", dY->coeff[0][1]);174 is_float(dY->coeff[0][0], +3.0, "x^0 y^0 coeff is %f", dY->coeff[0][0]); 175 is_float(dY->coeff[1][0], +4.0, "x^1 y^0 coeff is %f", dY->coeff[1][0]); 176 is_float(dY->coeff[0][1], -4.0, "x^0 y^1 coeff is %f", dY->coeff[0][1]); 177 177 178 178 ok(!dY->mask[0][0], "x^0 y^0 coeff is unmasked"); … … 221 221 ok(dY->nY == 1, "new y order is %d", dY->nY); 222 222 223 ok_float(dY->coeff[0][0], +3.0, "x^0 y^0 coeff is %f", dY->coeff[0][0]);224 ok_float(dY->coeff[1][0], +4.0, "x^1 y^0 coeff is %f", dY->coeff[1][0]);225 ok_float(dY->coeff[0][1], -4.0, "x^0 y^1 coeff is %f", dY->coeff[0][1]);223 is_float(dY->coeff[0][0], +3.0, "x^0 y^0 coeff is %f", dY->coeff[0][0]); 224 is_float(dY->coeff[1][0], +4.0, "x^1 y^0 coeff is %f", dY->coeff[1][0]); 225 is_float(dY->coeff[0][1], -4.0, "x^0 y^1 coeff is %f", dY->coeff[0][1]); 226 226 227 227 ok(!dY->mask[0][0], "x^0 y^0 coeff is unmasked"); -
trunk/psLib/test/math/tap_psRandom.c
r10945 r12607 39 39 #define ERROR_TOLERANCE 0.2 40 40 #define VERBOSE 0 41 # define ok_float_tol_per(VALUE,EXPECT,TOL,COMMENT, ...)\41 # define is_float_tol_per(VALUE,EXPECT,TOL,COMMENT, ...)\ 42 42 ok((fabs((VALUE)-(EXPECT)) < (TOL)), COMMENT, ## __VA_ARGS__); 43 43 … … 102 102 103 103 // Verify mean and stdev 104 ok_float_tol_per(stats->sampleMean, UNIFORM_MEAN, ERROR_TOLERANCE, "Mean is within expected range");105 ok_float_tol_per(stats->sampleStdev, UNIFORM_STDEV, ERROR_TOLERANCE, "StDev is within expected range");104 is_float_tol_per(stats->sampleMean, UNIFORM_MEAN, ERROR_TOLERANCE, "Mean is within expected range"); 105 is_float_tol_per(stats->sampleStdev, UNIFORM_STDEV, ERROR_TOLERANCE, "StDev is within expected range"); 106 106 107 107 skip_end(); … … 143 143 144 144 // Verify mean and stdev 145 ok_float_tol_per(stats->sampleMean, GAUSSIAN_MEAN, ERROR_TOLERANCE, "Mean is within expected range");146 ok_float_tol_per(stats->sampleStdev, GAUSSIAN_STDEV, ERROR_TOLERANCE, "StDev is within expected range");145 is_float_tol_per(stats->sampleMean, GAUSSIAN_MEAN, ERROR_TOLERANCE, "Mean is within expected range"); 146 is_float_tol_per(stats->sampleStdev, GAUSSIAN_STDEV, ERROR_TOLERANCE, "StDev is within expected range"); 147 147 148 148 skip_end(); … … 185 185 stats = psVectorStats(stats, rans, NULL, NULL, 0); 186 186 // Verify mean and stdev 187 ok_float_tol_per(stats->sampleMean, POISSON_MEAN, ERROR_TOLERANCE, "Mean is within expected range");188 ok_float_tol_per(stats->sampleStdev, POISSON_STDEV, ERROR_TOLERANCE, "StDev is within expected range");187 is_float_tol_per(stats->sampleMean, POISSON_MEAN, ERROR_TOLERANCE, "Mean is within expected range"); 188 is_float_tol_per(stats->sampleStdev, POISSON_STDEV, ERROR_TOLERANCE, "StDev is within expected range"); 189 189 190 190 skip_end(); -
trunk/psLib/test/math/tap_psSparse.c
r12513 r12607 74 74 dS2 = sqrt (dS2/100.0 - dS*dS); 75 75 76 ok_float_tol (dS2, 0.0, 1e-4, "scatter: %.20f", dS2);76 is_float_tol (dS2, 0.0, 1e-4, "scatter: %.20f", dS2); 77 77 78 78 psFree (matrix); … … 147 147 dS2 = sqrt (dS2/100.0 - dS*dS); 148 148 149 ok_float_tol (dS2, 0.0, 1e-4, "scatter: %.20f", dS2);149 is_float_tol (dS2, 0.0, 1e-4, "scatter: %.20f", dS2); 150 150 151 151 psFree (matrix); … … 219 219 // test the support functions: LowerProduct 220 220 fVec = psSparseBorderLowerProduct (NULL, border, xRef); 221 ok_float (fVec->n, 1.0, "f dimen: %d", fVec->n);222 ok_float (fVec->data.F32[0], 0.3, "f(0): %f", fVec->data.F32[0]);221 is_float (fVec->n, 1.0, "f dimen: %d", fVec->n); 222 is_float (fVec->data.F32[0], 0.3, "f(0): %f", fVec->data.F32[0]); 223 223 psFree (fVec); 224 224 225 225 // test the support functions: Upper Product 226 226 fVec = psSparseBorderUpperProduct (NULL, border, yRef); 227 ok_float (fVec->n, 2.0, "f dimen: %d", fVec->n);228 ok_float (fVec->data.F32[0], 0.05, "f(0): %f", fVec->data.F32[0]);229 ok_float (fVec->data.F32[1], 0.10, "f(0): %f", fVec->data.F32[1]);227 is_float (fVec->n, 2.0, "f dimen: %d", fVec->n); 228 is_float (fVec->data.F32[0], 0.05, "f(0): %f", fVec->data.F32[0]); 229 is_float (fVec->data.F32[1], 0.10, "f(0): %f", fVec->data.F32[1]); 230 230 psFree (fVec); 231 231 232 232 // test the support functions: Square Product 233 233 fVec = psSparseBorderSquareProduct (NULL, border, yRef); 234 ok_float (fVec->n, 1.0, "f dimen: %d", fVec->n);235 ok_float (fVec->data.F32[0], 0.25, "f(0): %f", fVec->data.F32[0]);234 is_float (fVec->n, 1.0, "f dimen: %d", fVec->n); 235 is_float (fVec->data.F32[0], 0.25, "f(0): %f", fVec->data.F32[0]); 236 236 psFree (fVec); 237 237 … … 239 239 psVector *gVec = NULL; 240 240 psSparseBorderMultiply (&fVec, &gVec, border, xRef, yRef); 241 ok_float (fVec->data.F32[0], 1.15, "f(0): %f", fVec->data.F32[0]);242 ok_float (fVec->data.F32[1], 1.20, "f(1): %f", fVec->data.F32[1]);243 ok_float (gVec->data.F32[0], 0.55, "g(0): %f", gVec->data.F32[0]);241 is_float (fVec->data.F32[0], 1.15, "f(0): %f", fVec->data.F32[0]); 242 is_float (fVec->data.F32[1], 1.20, "f(1): %f", fVec->data.F32[1]); 243 is_float (gVec->data.F32[0], 0.55, "g(0): %f", gVec->data.F32[0]); 244 244 245 245 // supply the fVec and gVec data to the border … … 263 263 psVector *yFit = NULL; 264 264 psSparseBorderSolve (&xFit, &yFit, constraint, border, 4); 265 ok_float_tol (xFit->data.F32[0], 1.0, 1e-4, "f(0): %f", xFit->data.F32[0]);266 ok_float_tol (xFit->data.F32[1], 1.0, 1e-4, "f(1): %f", xFit->data.F32[1]);267 ok_float_tol (yFit->data.F32[0], 0.5, 1e-4, "g(0): %f", yFit->data.F32[0]);265 is_float_tol (xFit->data.F32[0], 1.0, 1e-4, "f(0): %f", xFit->data.F32[0]); 266 is_float_tol (xFit->data.F32[1], 1.0, 1e-4, "f(1): %f", xFit->data.F32[1]); 267 is_float_tol (yFit->data.F32[0], 0.5, 1e-4, "g(0): %f", yFit->data.F32[0]); 268 268 269 269 psFree (xFit); … … 321 321 } 322 322 } 323 ok_float(border->Bij->data.F32[0][0], 0.1, "set matrix element %d,%d", 0, 0);323 is_float(border->Bij->data.F32[0][0], 0.1, "set matrix element %d,%d", 0, 0); 324 324 325 325 // construct the Q component: … … 381 381 dS /= Nrows; 382 382 dS2 = sqrt (dS2/Nrows - dS*dS); 383 ok_float_tol (dS2, 0.0, 1e-4, "scatter: %.20f", dS2);383 is_float_tol (dS2, 0.0, 1e-4, "scatter: %.20f", dS2); 384 384 385 385 // measure stdev between yFit and yRef 386 386 float dY = yRef->data.F32[0] - yFit->data.F32[0]; 387 387 // fprintf (stderr, "%5.3f %5.3f %5.3f %5.3f\n", gVec->data.F32[0], yRef->data.F32[0], yFit->data.F32[0], dS); 388 ok_float_tol (dY, 0.0, 2e-4, "scatter: %.20f", dY);388 is_float_tol (dY, 0.0, 2e-4, "scatter: %.20f", dY); 389 389 390 390 psFree (xRef); -
trunk/psLib/test/math/tap_psStats00.c
r12242 r12607 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $12 * @date $Date: 2007-03- 05 23:23:38$11 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2007-03-27 22:52:03 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 120 120 ok(result, "psVectorStats suceeded (F32: no mask vector, no error vector)"); 121 121 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 122 ok_float_tol(myStats->sampleMean, expectedMeanNoMaskF32, 1e-4,122 is_float_tol(myStats->sampleMean, expectedMeanNoMaskF32, 1e-4, 123 123 "The mean was %f, should be %f", myStats->sampleMean, expectedMeanNoMaskF32); 124 124 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 131 131 ok(result, "psVectorStats suceeded (F32: no mask vector, with error vector)"); 132 132 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 133 ok_float_tol(myStats->sampleMean, expectedWeightMeanNoMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedWeightMeanNoMaskF32);133 is_float_tol(myStats->sampleMean, expectedWeightMeanNoMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedWeightMeanNoMaskF32); 134 134 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 135 135 } … … 144 144 ok(result, "psVectorStats suceeded (F32, no mask, no errors, with data range)"); 145 145 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 146 ok_float_tol(myStats->sampleMean, expectedMeanRangeNoMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanRangeNoMaskF32);146 is_float_tol(myStats->sampleMean, expectedMeanRangeNoMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanRangeNoMaskF32); 147 147 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 148 148 } … … 156 156 ok(result, "psVectorStats suceeded (F32, no mask, with errors and data range)"); 157 157 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 158 ok_float_tol(myStats->sampleMean, expectedWeightMeanNoMaskRangeF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedWeightMeanNoMaskRangeF32);158 is_float_tol(myStats->sampleMean, expectedWeightMeanNoMaskRangeF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedWeightMeanNoMaskRangeF32); 159 159 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 160 160 } … … 167 167 ok(result, "psVectorStats suceeded (F32, with mask, no errors)"); 168 168 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 169 ok_float_tol(myStats->sampleMean, expectedMeanWithMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanWithMaskF32);169 is_float_tol(myStats->sampleMean, expectedMeanWithMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanWithMaskF32); 170 170 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 171 171 } … … 177 177 ok(result, "psVectorStats suceeded (F32, with mask and errors)"); 178 178 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 179 ok_float_tol(myStats->sampleMean, expectedWeightMeanWithMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedWeightMeanWithMaskF32);179 is_float_tol(myStats->sampleMean, expectedWeightMeanWithMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedWeightMeanWithMaskF32); 180 180 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 181 181 } … … 188 188 ok(result, "psVectorStats suceeded (F32, with mask and data range)"); 189 189 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 190 ok_float_tol(myStats->sampleMean, expectedMeanRangeWithMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanRangeWithMaskF32);190 is_float_tol(myStats->sampleMean, expectedMeanRangeWithMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanRangeWithMaskF32); 191 191 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 192 192 } … … 198 198 ok(result, "psVectorStats suceeded (F32, withmask, errors, and data range)"); 199 199 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 200 ok_float_tol(myStats->sampleMean, expectedWeightMeanWithMaskRangeF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedWeightMeanWithMaskRangeF32);200 is_float_tol(myStats->sampleMean, expectedWeightMeanWithMaskRangeF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedWeightMeanWithMaskRangeF32); 201 201 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 202 202 } … … 214 214 ok(result, "psVectorStats suceeded (F32, with mask = 2, no errors)"); 215 215 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 216 ok_float_tol(myStats->sampleMean, expectedMeanWithMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanWithMaskF32);216 is_float_tol(myStats->sampleMean, expectedMeanWithMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanWithMaskF32); 217 217 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 218 218 } … … 230 230 ok(result, "psVectorStats suceeded (F32, with mask = 3, no errors)"); 231 231 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 232 ok_float_tol(myStats->sampleMean, expectedMeanNoMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanNoMaskF32);232 is_float_tol(myStats->sampleMean, expectedMeanNoMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanNoMaskF32); 233 233 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 234 234 } … … 276 276 ok(result, "psVectorStats suceeded (S8, no mask, no errors)"); 277 277 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 278 ok_float_tol(myStats->sampleMean, expectedMeanNoMaskS8, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanNoMaskS8);278 is_float_tol(myStats->sampleMean, expectedMeanNoMaskS8, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanNoMaskS8); 279 279 psFree(myStats); 280 280 psFree(myVector); … … 297 297 ok(result, "psVectorStats suceeded (U16, no mask, no errors)"); 298 298 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 299 ok_float_tol(myStats->sampleMean, expectedMeanNoMaskU16, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanNoMaskU16);299 is_float_tol(myStats->sampleMean, expectedMeanNoMaskU16, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanNoMaskU16); 300 300 psFree(myStats); 301 301 psFree(myVector); … … 317 317 ok(result, "psVectorStats suceeded (F64, no mask, no errors)"); 318 318 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 319 ok_float_tol(myStats->sampleMean, expectedMeanNoMaskF64, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanNoMaskF64);319 is_float_tol(myStats->sampleMean, expectedMeanNoMaskF64, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanNoMaskF64); 320 320 psFree(myStats); 321 321 psFree(myVector); -
trunk/psLib/test/math/tap_psStats01.c
r11420 r12607 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $11 * @date $Date: 2007-0 1-30 04:41:51$10 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2007-03-27 22:52:03 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 63 63 ok(result, "psVectorStats suceeded"); 64 64 ok(!isnan(myStats->max), "psVectorStats() returned non-NAN"); 65 ok_float_tol(myStats->max, expectedMaxNoMaskF32, 1e-4,65 is_float_tol(myStats->max, expectedMaxNoMaskF32, 1e-4, 66 66 "The max was %f, should be %f", myStats->max, expectedMaxNoMaskF32); 67 67 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 74 74 ok(result, "psVectorStats suceeded"); 75 75 ok(!isnan(myStats->max), "psVectorStats() returned non-NAN"); 76 ok_float_tol(myStats->max, expectedMaxWithMaskF32, 1e-4,76 is_float_tol(myStats->max, expectedMaxWithMaskF32, 1e-4, 77 77 "The max was %f, should be %f", myStats->max, expectedMaxWithMaskF32); 78 78 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 88 88 ok(result, "psVectorStats suceeded"); 89 89 ok(!isnan(myStats->max), "psVectorStats() returned non-NAN"); 90 ok_float_tol(myStats->max, expectedMaxRangeNoMaskF32, 1e-4,90 is_float_tol(myStats->max, expectedMaxRangeNoMaskF32, 1e-4, 91 91 "The max was %f, should be %f", myStats->max, expectedMaxRangeNoMaskF32); 92 92 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 101 101 ok(result, "psVectorStats suceeded"); 102 102 ok(!isnan(myStats->max), "psVectorStats() returned non-NAN"); 103 ok_float_tol(myStats->max, expectedMaxRangeWithMaskF32, 1e-4,103 is_float_tol(myStats->max, expectedMaxRangeWithMaskF32, 1e-4, 104 104 "The max was %f, should be %f", myStats->max, expectedMaxRangeWithMaskF32); 105 105 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 136 136 ok(result, "psVectorStats suceeded"); 137 137 ok(!isnan(myStats->max), "psVectorStats() returned non-NAN"); 138 ok_float_tol(myStats->max, expectedMaxNoMaskS8, 1e-4,138 is_float_tol(myStats->max, expectedMaxNoMaskS8, 1e-4, 139 139 "The max was %f, should be %f", myStats->max, expectedMaxNoMaskS8); 140 140 psFree(myStats); … … 157 157 ok(result, "psVectorStats suceeded"); 158 158 ok(!isnan(myStats->max), "psVectorStats() returned non-NAN"); 159 ok_float_tol(myStats->max, expectedMaxNoMaskU16, 1e-4,159 is_float_tol(myStats->max, expectedMaxNoMaskU16, 1e-4, 160 160 "The max was %f, should be %f", myStats->max, expectedMaxNoMaskU16); 161 161 psFree(myStats); … … 178 178 ok(result, "psVectorStats suceeded"); 179 179 ok(!isnan(myStats->max), "psVectorStats() returned non-NAN"); 180 ok_float_tol(myStats->max, expectedMaxNoMaskF64, 1e-4,180 is_float_tol(myStats->max, expectedMaxNoMaskF64, 1e-4, 181 181 "The max was %f, should be %f", myStats->max, expectedMaxNoMaskF64); 182 182 psFree(myStats); -
trunk/psLib/test/math/tap_psStats02.c
r11420 r12607 11 11 * @author GLG, MHPCC 12 12 * 13 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $14 * @date $Date: 2007-0 1-30 04:41:51$13 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2007-03-27 22:52:03 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 67 67 ok(result, "psVectorStats suceeded"); 68 68 ok(!isnan(myStats->min), "psVectorStats() returned non-NAN"); 69 ok_float_tol(myStats->min, expectedMinNoMaskF32, 1e-4,69 is_float_tol(myStats->min, expectedMinNoMaskF32, 1e-4, 70 70 "The min was %f, should be %f", myStats->min, expectedMinNoMaskF32); 71 71 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 80 80 ok(result, "psVectorStats suceeded"); 81 81 ok(!isnan(myStats->min), "psVectorStats() returned non-NAN"); 82 ok_float_tol(myStats->min, expectedMinWithMaskF32, 1e-4,82 is_float_tol(myStats->min, expectedMinWithMaskF32, 1e-4, 83 83 "The min was %f, should be %f", myStats->min, expectedMinWithMaskF32); 84 84 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 94 94 ok(result, "psVectorStats suceeded"); 95 95 ok(!isnan(myStats->min), "psVectorStats() returned non-NAN"); 96 ok_float_tol(myStats->min, expectedMinRangeNoMaskF32, 1e-4,96 is_float_tol(myStats->min, expectedMinRangeNoMaskF32, 1e-4, 97 97 "The min was %f, should be %f", myStats->min, expectedMinRangeNoMaskF32); 98 98 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 107 107 ok(result, "psVectorStats succeeded"); 108 108 ok(!isnan(myStats->min), "psVectorStats() returned non-NAN"); 109 ok_float_tol(myStats->min, expectedMinRangeWithMaskF32, 1e-4,109 is_float_tol(myStats->min, expectedMinRangeWithMaskF32, 1e-4, 110 110 "The min was %f, should be %f", myStats->min, expectedMinRangeWithMaskF32); 111 111 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 142 142 ok(result, "psVectorStats succeeded"); 143 143 ok(!isnan(myStats->min), "psVectorStats() returned non-NAN"); 144 ok_float_tol(myStats->min, expectedMinNoMaskS8, 1e-4,144 is_float_tol(myStats->min, expectedMinNoMaskS8, 1e-4, 145 145 "The min was %f, should be %f", myStats->min, expectedMinNoMaskS8); 146 146 psFree(myStats); … … 163 163 ok(result, "psVectorStats succeeded"); 164 164 ok(!isnan(myStats->min), "psVectorStats() returned non-NAN"); 165 ok_float_tol(myStats->min, expectedMinNoMaskU16, 1e-4,165 is_float_tol(myStats->min, expectedMinNoMaskU16, 1e-4, 166 166 "The min was %f, should be %f", myStats->min, expectedMinNoMaskU16); 167 167 psFree(myStats); … … 184 184 ok(result, "psVectorStats succeeded"); 185 185 ok(!isnan(myStats->min), "psVectorStats() returned non-NAN"); 186 ok_float_tol(myStats->min, expectedMinNoMaskF64, 1e-4,186 is_float_tol(myStats->min, expectedMinNoMaskF64, 1e-4, 187 187 "The min was %f, should be %f", myStats->min, expectedMinNoMaskF64); 188 188 psFree(myStats); -
trunk/psLib/test/math/tap_psStats03.c
r11420 r12607 44 44 ok(result, "psVectorStats succeeded"); 45 45 ok(!isnan(myStats->sampleMedian), "psVectorStats() returned non-NAN"); 46 ok_float_tol(myStats->sampleMedian, realMedianNoMask, 1e-4,46 is_float_tol(myStats->sampleMedian, realMedianNoMask, 1e-4, 47 47 "The sample median was %f, should be %f", myStats->sampleMedian, realMedianNoMask); 48 48 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 55 55 ok(result, "psVectorStats succeeded"); 56 56 ok(!isnan(myStats->sampleMedian), "psVectorStats() returned non-NAN"); 57 ok_float_tol(myStats->sampleMedian, realMedianWithMask, 1e-4,57 is_float_tol(myStats->sampleMedian, realMedianWithMask, 1e-4, 58 58 "The sample median was %f, should be %f", myStats->sampleMedian, realMedianWithMask); 59 59 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); -
trunk/psLib/test/math/tap_psStats06.c
r11420 r12607 45 45 ok(result, "psVectorStats succeeded"); 46 46 ok(!isnan(myStats->sampleStdev), "psVectorStats() returned non-NAN"); 47 ok_float_tol(myStats->sampleStdev, realStdevNoMask, 1e-4,47 is_float_tol(myStats->sampleStdev, realStdevNoMask, 1e-4, 48 48 "The mean was %f, should be %f", myStats->sampleStdev, realStdevNoMask); 49 49 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 56 56 ok(result, "psVectorStats succeeded"); 57 57 ok(!isnan(myStats->sampleStdev), "psVectorStats() returned non-NAN"); 58 ok_float_tol(myStats->sampleStdev, realStdevWithMask, 1e-4,58 is_float_tol(myStats->sampleStdev, realStdevWithMask, 1e-4, 59 59 "The mean was %f, should be %f", myStats->sampleStdev, realStdevWithMask); 60 60 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); -
trunk/psLib/test/math/tap_psStats08.c
r11661 r12607 45 45 ok(result, "psVectorStats succeeded"); 46 46 ok(!isnan(myStats->sampleLQ), "psVectorStats() returned non-NAN"); 47 ok_float_tol(myStats->sampleLQ, realLQNoMask, 1e-4,47 is_float_tol(myStats->sampleLQ, realLQNoMask, 1e-4, 48 48 "The sampleLQ was %f, should be %f", myStats->sampleLQ, realLQNoMask); 49 49 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 56 56 ok(result, "psVectorStats succeeded"); 57 57 ok(!isnan(myStats->sampleUQ), "psVectorStats() returned non-NAN"); 58 ok_float_tol(myStats->sampleUQ, realUQNoMask, 1e-4,58 is_float_tol(myStats->sampleUQ, realUQNoMask, 1e-4, 59 59 "The sampleUQ was %f, should be %f", myStats->sampleUQ, realUQNoMask); 60 60 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 67 67 ok(result, "psVectorStats succeeded"); 68 68 ok(!isnan(myStats->sampleLQ), "psVectorStats() returned non-NAN"); 69 ok_float_tol(myStats->sampleLQ, realLQWithMask, 1e-4,69 is_float_tol(myStats->sampleLQ, realLQWithMask, 1e-4, 70 70 "The sampleLQ was %f, should be %f", myStats->sampleLQ, 71 71 realLQWithMask); … … 79 79 ok(result, "psVectorStats succeeded"); 80 80 ok(!isnan(myStats->sampleUQ), "psVectorStats() returned non-NAN"); 81 ok_float_tol(myStats->sampleUQ, realUQWithMask, 1e-4,81 is_float_tol(myStats->sampleUQ, realUQWithMask, 1e-4, 82 82 "The sampleUQ was %f, should be %f", myStats->sampleUQ, 83 83 realUQWithMask);
Note:
See TracChangeset
for help on using the changeset viewer.
