Changeset 10848 for trunk/psLib/test/math
- Timestamp:
- Dec 28, 2006, 6:38:42 PM (20 years ago)
- Location:
- trunk/psLib/test/math
- Files:
-
- 19 edited
-
. (modified) (1 prop)
-
.cvsignore (modified) (1 diff)
-
Makefile.am (modified) (2 diffs)
-
tap_psPolyFit1D.c (modified) (2 diffs)
-
tap_psPolyFit2D.c (modified) (2 diffs)
-
tap_psPolyFit3D.c (modified) (2 diffs)
-
tap_psPolyFit4D.c (modified) (2 diffs)
-
tap_psPolynomialEval2D.c (modified) (2 diffs)
-
tap_psPolynomialEval3D.c (modified) (2 diffs)
-
tap_psPolynomialEval4D.c (modified) (2 diffs)
-
tap_psPolynomialUtils_Derivatives.c (modified) (9 diffs)
-
tap_psStats00.c (modified) (16 diffs)
-
tap_psStats01.c (modified) (9 diffs)
-
tap_psStats02.c (modified) (9 diffs)
-
tap_psStats03.c (modified) (2 diffs)
-
tap_psStats06.c (modified) (2 diffs)
-
tap_psStats07.c (modified) (2 diffs)
-
tap_psStats08.c (modified) (4 diffs)
-
tap_psStats09.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/math
- Property svn:ignore
-
old new 4 4 Makefile 5 5 Makefile.in 6 tst_psFunc017 tst_psHist008 tst_psHist019 tst_psHist0210 tst_psHist0311 tst_psMatrix0112 tst_psMatrix0213 tst_psMatrix0314 tst_psMatrix0415 tst_psMatrix0516 tst_psMatrix0617 tst_psMatrix0718 tst_psMatrixVectorArithmetic0119 tst_psMatrixVectorArithmetic0220 tst_psMatrixVectorArithmetic0321 tst_psMatrixVectorArithmetic0422 tst_psRandom23 tst_psStats0024 tst_psStats0125 tst_psStats0226 tst_psStats0327 tst_psStats0528 tst_psStats0629 tst_psStats0730 tst_psStats0831 tst_psStats0932 6 seed_msglog1.txt 33 7 seed_msglog2.txt 34 tst_psSpline1D35 tst_psMathUtils36 tst_psMinimizeLMM37 tst_psMinimizePowell38 tst_psPolyFit1D39 tst_psPolyFit2D40 tst_psPolyFit3D41 tst_psPolyFit4D42 tst_psPolynomial43 tst_psPolynomialEval1D44 tst_psPolynomialEval2D45 tst_psPolynomialEval3D46 tst_psPolynomialEval4D47 8 *.bb 48 9 *.bbg 49 10 *.da 50 11 gmon.out 12 tap_psHist00 13 tap_psHist01 14 tap_psHist02 15 tap_psHist03 16 tap_psMD5 17 tap_psMatrix01 18 tap_psMatrix02 19 tap_psMatrix03 20 tap_psMatrix04 21 tap_psMatrix05 22 tap_psMatrix06 23 tap_psMatrix07 24 tap_psPolyFit1D 25 tap_psPolyFit2D 26 tap_psPolyFit3D 27 tap_psPolyFit4D 28 tap_psPolynomial 29 tap_psPolynomialEval1D 30 tap_psPolynomialEval2D 31 tap_psPolynomialEval3D 32 tap_psPolynomialEval4D 33 tap_psPolynomialUtils_Derivatives 51 34 tap_psSparse 35 tap_psStats00 36 tap_psStats01 37 tap_psStats02 38 tap_psStats03 39 tap_psStats05 40 tap_psStats06 41 tap_psStats07 42 tap_psStats08 43 tap_psStats09 52 44 tap_psStatsTiming 53 tap_psMD554 45 tap_psStats_Sample_01 55 tap_psPolynomialUtils_Derivatives
-
- Property svn:ignore
-
trunk/psLib/test/math/.cvsignore
r10597 r10848 4 4 Makefile 5 5 Makefile.in 6 tst_psFunc017 tst_psHist008 tst_psHist019 tst_psHist0210 tst_psHist0311 tst_psMatrix0112 tst_psMatrix0213 tst_psMatrix0314 tst_psMatrix0415 tst_psMatrix0516 tst_psMatrix0617 tst_psMatrix0718 tst_psMatrixVectorArithmetic0119 tst_psMatrixVectorArithmetic0220 tst_psMatrixVectorArithmetic0321 tst_psMatrixVectorArithmetic0422 tst_psRandom23 tst_psStats0024 tst_psStats0125 tst_psStats0226 tst_psStats0327 tst_psStats0528 tst_psStats0629 tst_psStats0730 tst_psStats0831 tst_psStats0932 6 seed_msglog1.txt 33 7 seed_msglog2.txt 34 tst_psSpline1D35 tst_psMathUtils36 tst_psMinimizeLMM37 tst_psMinimizePowell38 tst_psPolyFit1D39 tst_psPolyFit2D40 tst_psPolyFit3D41 tst_psPolyFit4D42 tst_psPolynomial43 tst_psPolynomialEval1D44 tst_psPolynomialEval2D45 tst_psPolynomialEval3D46 tst_psPolynomialEval4D47 8 *.bb 48 9 *.bbg 49 10 *.da 50 11 gmon.out 12 13 tap_psHist00 14 tap_psHist01 15 tap_psHist02 16 tap_psHist03 17 tap_psMD5 18 tap_psMatrix01 19 tap_psMatrix02 20 tap_psMatrix03 21 tap_psMatrix04 22 tap_psMatrix05 23 tap_psMatrix06 24 tap_psMatrix07 25 tap_psPolyFit1D 26 tap_psPolyFit2D 27 tap_psPolyFit3D 28 tap_psPolyFit4D 29 tap_psPolynomial 30 tap_psPolynomialEval1D 31 tap_psPolynomialEval2D 32 tap_psPolynomialEval3D 33 tap_psPolynomialEval4D 34 tap_psPolynomialUtils_Derivatives 51 35 tap_psSparse 36 tap_psStats00 37 tap_psStats01 38 tap_psStats02 39 tap_psStats03 40 tap_psStats05 41 tap_psStats06 42 tap_psStats07 43 tap_psStats08 44 tap_psStats09 52 45 tap_psStatsTiming 53 tap_psMD554 46 tap_psStats_Sample_01 55 tap_psPolynomialUtils_Derivatives -
trunk/psLib/test/math/Makefile.am
r10597 r10848 13 13 14 14 TEST_PROGS = \ 15 tap_psHist00 \ 16 tap_psHist01 \ 17 tap_psHist02 \ 18 tap_psHist03 \ 15 19 tap_psMD5 \ 20 tap_psMatrix01 \ 21 tap_psMatrix02 \ 22 tap_psMatrix03 \ 23 tap_psMatrix04 \ 24 tap_psMatrix05 \ 25 tap_psMatrix06 \ 26 tap_psMatrix07 \ 27 tap_psPolyFit1D \ 28 tap_psPolyFit2D \ 29 tap_psPolyFit3D \ 30 tap_psPolyFit4D \ 31 tap_psPolynomial \ 32 tap_psPolynomialEval1D \ 33 tap_psPolynomialEval2D \ 34 tap_psPolynomialEval3D \ 35 tap_psPolynomialEval4D \ 36 tap_psPolynomialUtils_Derivatives \ 16 37 tap_psSparse \ 38 tap_psStats00 \ 39 tap_psStats01 \ 40 tap_psStats02 \ 41 tap_psStats03 \ 42 tap_psStats05 \ 43 tap_psStats06 \ 44 tap_psStats07 \ 45 tap_psStats08 \ 46 tap_psStats09 \ 17 47 tap_psStatsTiming \ 18 tap_psStats_Sample_01 \ 19 tap_psPolynomialUtils_Derivatives 48 tap_psStats_Sample_01 20 49 21 50 if BUILD_TESTS … … 29 58 30 59 test: check 60 $(top_srcdir)/test/test.pl -
trunk/psLib/test/math/tap_psPolyFit1D.c
r10820 r10848 272 272 } 273 273 274 psPolynomial1D *rc = NULL;274 bool rc = false; 275 275 if (flags & TS00_CLIP_FIT) { 276 276 rc = psVectorClipFitPolynomial1D(myPoly, stats, mask, MASK_VALUE, f, fErr, x); … … 279 279 } 280 280 281 if ( rc == NULL) {281 if (!rc) { 282 282 if (expectedRC == true) { 283 283 diag("TEST ERROR: the 1D polynomial fitting function returned NULL.\n"); -
trunk/psLib/test/math/tap_psPolyFit2D.c
r10820 r10848 279 279 } 280 280 281 psPolynomial2D *rc = NULL;281 bool rc = false; 282 282 if (flags & TS00_CLIP_FIT) { 283 283 rc = psVectorClipFitPolynomial2D(myPoly, stats, mask, MASK_VALUE, f, fErr, x, y); … … 286 286 } 287 287 288 if ( rc == NULL) {288 if (!rc) { 289 289 if (expectedRC == true) { 290 290 diag("TEST ERROR: the 2D polynomial fitting function returned NULL.\n"); -
trunk/psLib/test/math/tap_psPolyFit3D.c
r10820 r10848 324 324 } 325 325 326 psPolynomial3D *rc = NULL;326 bool rc = false; 327 327 if (flags & TS00_CLIP_FIT) { 328 328 rc = psVectorClipFitPolynomial3D(myPoly, stats, mask, MASK_VALUE, f, fErr, x, y, z); … … 331 331 } 332 332 333 if ( rc == NULL) {333 if (!rc) { 334 334 if (expectedRC == true) { 335 335 diag("TEST ERROR: the 3D polynomial fitting function returned NULL.\n"); -
trunk/psLib/test/math/tap_psPolyFit4D.c
r10820 r10848 377 377 } 378 378 379 psPolynomial4D *rc = NULL;379 bool rc = false; 380 380 if (flags & TS00_CLIP_FIT) { 381 381 rc = psVectorClipFitPolynomial4D(myPoly, stats, mask, MASK_VALUE, f, fErr, x, y, z, t); … … 384 384 } 385 385 386 if ( rc == NULL) {386 if (!rc) { 387 387 if (expectedRC == true) { 388 388 diag("TEST ERROR: the 4D polynomial fitting function returned NULL.\n"); -
trunk/psLib/test/math/tap_psPolynomialEval2D.c
r10820 r10848 4 4 * ORD and CHEB type polynomials. 5 5 * 6 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $7 * @date $Date: 2006-12-2 1 20:05:12 $6 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2006-12-29 04:38:42 $ 8 8 * 9 9 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 148 148 psMemId id = psMemGetId(); 149 149 psPolynomial2D* polyOrd = psPolynomial2DAlloc(99, TERMS-1, TERMS-1); 150 ok(polyOrd != NULL, "Ordinary polynomial allocation successful");151 skip_start(polyOrd == NULL, 2, "Skipping tests because psPolynomial2DAlloc() failed");150 ok(polyOrd == NULL, "Ordinary polynomial allocation successful"); 151 skip_start(polyOrd == NULL, 1, "Skipping tests because psPolynomial2DAlloc() failed"); 152 152 153 153 // Attempt to evaluation invalid polynomial type -
trunk/psLib/test/math/tap_psPolynomialEval3D.c
r10820 r10848 4 4 * ORD and CHEB type polynomials. 5 5 * 6 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $7 * @date $Date: 2006-12-2 1 20:05:12 $6 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2006-12-29 04:38:42 $ 8 8 * 9 9 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 207 207 psMemId id = psMemGetId(); 208 208 psPolynomial3D* polyOrd = psPolynomial3DAlloc(99, TERMS-1, TERMS-1, TERMS-1); 209 ok(polyOrd != NULL, "Ordinary polynomial allocation successful");210 skip_start(polyOrd == NULL, 2, "Skipping tests because psPolynomial3DAlloc() failed");209 ok(polyOrd == NULL, "Ordinary polynomial allocation successful"); 210 skip_start(polyOrd == NULL, 1, "Skipping tests because psPolynomial3DAlloc() failed"); 211 211 212 212 // Attempt to evaluation invalid polynomial type -
trunk/psLib/test/math/tap_psPolynomialEval4D.c
r10820 r10848 4 4 * ORD and CHEB type polynomials. 5 5 * 6 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $7 * @date $Date: 2006-12-2 1 20:05:12 $6 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2006-12-29 04:38:42 $ 8 8 * 9 9 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 448 448 psMemId id = psMemGetId(); 449 449 psPolynomial4D* polyOrd = psPolynomial4DAlloc(99, TERMS-1, TERMS-1, TERMS-1, TERMS-1); 450 ok(polyOrd != NULL, "Ordinary polynomial allocation successful");451 skip_start(polyOrd == NULL, 2, "Skipping tests because psPolynomial4DAlloc() failed");450 ok(polyOrd == NULL, "Ordinary polynomial allocation successful"); 451 skip_start(polyOrd == NULL, 1, "Skipping tests because psPolynomial4DAlloc() failed"); 452 452 453 453 // Attempt to evaluation invalid polynomial type -
trunk/psLib/test/math/tap_psPolynomialUtils_Derivatives.c
r10605 r10848 8 8 int main (void) 9 9 { 10 plan_tests( 72);11 12 diag("psPolynomial2D Derivative tests");10 plan_tests(54); 11 12 note("psPolynomial2D Derivative tests"); 13 13 14 14 // test psPolynomial2D_dX (no supplied output) … … 16 16 psMemId id = psMemGetId(); 17 17 18 diag("test psPolynomial2D_dX (no supplied output)");18 note ("test psPolynomial2D_dX (no supplied output)"); 19 19 20 20 psPolynomial2D *poly = psPolynomial2DAlloc(PS_POLYNOMIAL_ORD, 2, 2); … … 64 64 psMemId id = psMemGetId(); 65 65 66 diag("test psPolynomial2D_dX (supplied output)");66 note ("test psPolynomial2D_dX (supplied output)"); 67 67 68 68 psPolynomial2D *poly = psPolynomial2DAlloc(PS_POLYNOMIAL_ORD, 2, 2); … … 113 113 psMemId id = psMemGetId(); 114 114 115 diag("test psPolynomial2D_dX (supplied output)");115 note ("test psPolynomial2D_dX (supplied output)"); 116 116 117 117 psPolynomial2D *poly = psPolynomial2DAlloc(PS_POLYNOMIAL_ORD, 2, 2); … … 134 134 poly->mask[2][2] = 1; 135 135 136 poly = psPolynomial2D_dX (poly, poly); 137 138 ok(poly->nX == 1, "new x order is %d", poly->nX); 139 ok(poly->nY == 2, "new y order is %d", poly->nY); 140 141 ok_float(poly->coeff[0][0], +2.0, "x^0 y^0 coeff is %f", poly->coeff[0][0]); 142 ok_float(poly->coeff[1][0], -6.0, "x^1 y^0 coeff is %f", poly->coeff[1][0]); 143 ok_float(poly->coeff[0][1], +4.0, "x^0 y^1 coeff is %f", poly->coeff[0][1]); 144 145 ok(!poly->mask[0][0], "x^0 y^0 coeff is unmasked"); 146 ok(!poly->mask[1][0], "x^1 y^0 coeff is unmasked"); 147 ok(!poly->mask[0][1], "x^0 y^1 coeff is unmasked"); 148 149 ok(poly->mask[1][1], "x^1 y^1 coeff is masked"); 150 ok(poly->mask[1][2], "x^1 y^2 coeff is masked"); 151 152 psFree (poly); 153 136 psPolynomial2D *result = psPolynomial2D_dX (poly, poly); 137 ok (result == NULL, "psPolynomial2D_dX failed as expected: cannot assign output to input"); 138 139 psFree (poly); 154 140 skip_end(); 155 141 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 160 146 psMemId id = psMemGetId(); 161 147 162 diag("test psPolynomial2D_dY (no supplied output)");148 note ("test psPolynomial2D_dY (no supplied output)"); 163 149 164 150 psPolynomial2D *poly = psPolynomial2DAlloc(PS_POLYNOMIAL_ORD, 2, 2); … … 208 194 psMemId id = psMemGetId(); 209 195 210 diag("test psPolynomial2D_dY (supplied output)");196 note ("test psPolynomial2D_dY (supplied output)"); 211 197 212 198 psPolynomial2D *poly = psPolynomial2DAlloc(PS_POLYNOMIAL_ORD, 2, 2); … … 257 243 psMemId id = psMemGetId(); 258 244 259 diag("test psPolynomial2D_dY (supplied output)");245 note ("test psPolynomial2D_dY (supplied output)"); 260 246 261 247 psPolynomial2D *poly = psPolynomial2DAlloc(PS_POLYNOMIAL_ORD, 2, 2); … … 278 264 poly->mask[2][2] = 1; 279 265 280 poly = psPolynomial2D_dY (poly, poly); 281 282 ok(poly->nX == 2, "new x order is %d", poly->nX); 283 ok(poly->nY == 1, "new y order is %d", poly->nY); 284 285 ok_float(poly->coeff[0][0], +3.0, "x^0 y^0 coeff is %f", poly->coeff[0][0]); 286 ok_float(poly->coeff[1][0], +4.0, "x^1 y^0 coeff is %f", poly->coeff[1][0]); 287 ok_float(poly->coeff[0][1], -4.0, "x^0 y^1 coeff is %f", poly->coeff[0][1]); 288 289 ok(!poly->mask[0][0], "x^0 y^0 coeff is unmasked"); 290 ok(!poly->mask[1][0], "x^1 y^0 coeff is unmasked"); 291 ok(!poly->mask[0][1], "x^0 y^1 coeff is unmasked"); 292 293 ok(poly->mask[1][1], "x^1 y^1 coeff is masked"); 294 ok(poly->mask[1][2], "x^1 y^2 coeff is masked"); 266 psPolynomial2D *result = psPolynomial2D_dY (poly, poly); 267 ok (result == NULL, "psPolynomial2D_dY failed as expected: cannot assign output to input"); 295 268 296 269 psFree (poly); -
trunk/psLib/test/math/tap_psStats00.c
r10831 r10848 1 @file tst_psStats00.c 2 * 3 * @brief Contains tests for psVectorStats with sample mean calculations 4 * 5 * We extensively test the code with data type PS_TYPE_F32. If these pass, we 6 * do 7 a much simpler test with data type PS_TYPE_U8, PS_TYPE_U16, PS_TYPE_F64. 8 * 9 * @author GLG, MHPCC 10 * 11 * @version $Revision: 12 1.8 $ $Name: 13 $ 14 * @date $Date: 15 2006/07/28 00: 16 44: 17 05 $ 18 * 19 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii 20 */ 21 #include <stdio.h> 22 #include <string.h> 23 #include <pslib.h> 24 #include "tap.h" 25 #include "pstap.h" 26 27 #define N 15 28 29 static psF32 samplesF32[N] = 30 { 31 1.1, 2.2, -3.3, 4.4, 5.5, -6.6, 7.7, 8.8, -9.9, 10.0, 32 11.01, -12.02, 13.03, 14.04, -15.05 33 }; 1 /** @file tst_psStats00.c 2 * 3 * @brief Contains tests for psVectorStats with sample mean calculations 4 * 5 6 * We extensively test the code with data type PS_TYPE_F32. If these pass, we do a much 7 * simpler test with data type PS_TYPE_U8, PS_TYPE_U16, PS_TYPE_F64. 8 * 9 * @author GLG, MHPCC 10 * 11 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2006-12-29 04:38:42 $ 13 * 14 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii 15 */ 16 17 #include <stdio.h> 18 #include <string.h> 19 #include <pslib.h> 20 #include "tap.h" 21 #include "pstap.h" 22 23 #define N 15 24 25 static psF32 samplesF32[N] = 26 { 27 1.1, 2.2, -3.3, 4.4, 5.5, -6.6, 7.7, 8.8, -9.9, 10.0, 28 11.01, -12.02, 13.03, 14.04, -15.05 29 }; 34 30 static psS8 samplesS8[N] = 35 31 { … … 92 88 { 93 89 psMemId id = psMemGetId(); 94 myStats = psVectorStats(myStats, myVector, NULL, NULL, 0); 90 bool result = psVectorStats(myStats, myVector, NULL, NULL, 0); 91 ok(result, "psVectorStats suceeded"); 95 92 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 96 93 ok_float_tol(myStats->sampleMean, expectedMeanNoMaskF32, 1e-4, … … 102 99 { 103 100 psMemId id = psMemGetId(); 104 myStats = psVectorStats(myStats, myVector, myErrors, NULL, 0); 101 bool result = psVectorStats(myStats, myVector, myErrors, NULL, 0); 102 ok(result, "psVectorStats suceeded"); 105 103 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 106 104 ok_float_tol(myStats->sampleMean, expectedWeightMeanNoMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedWeightMeanNoMaskF32); … … 114 112 myStats->min = -10.0; 115 113 myStats->max = 8.0; 116 myStats = psVectorStats(myStats, myVector, NULL, NULL, 0); 114 bool result = psVectorStats(myStats, myVector, NULL, NULL, 0); 115 ok(result, "psVectorStats suceeded"); 117 116 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 118 117 ok_float_tol(myStats->sampleMean, expectedMeanRangeNoMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanRangeNoMaskF32); … … 125 124 psMemId id = psMemGetId(); 126 125 myStats->options = PS_STAT_SAMPLE_MEAN | PS_STAT_USE_RANGE; 127 myStats = psVectorStats(myStats, myVector, myErrors, NULL, 0); 126 bool result = psVectorStats(myStats, myVector, myErrors, NULL, 0); 127 ok(result, "psVectorStats suceeded"); 128 128 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 129 129 ok_float_tol(myStats->sampleMean, expectedWeightMeanNoMaskRangeF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedWeightMeanNoMaskRangeF32); … … 135 135 psMemId id = psMemGetId(); 136 136 myStats->options = PS_STAT_SAMPLE_MEAN; 137 myStats = psVectorStats(myStats, myVector, NULL, maskVector, 1); 137 bool result = psVectorStats(myStats, myVector, NULL, maskVector, 1); 138 ok(result, "psVectorStats suceeded"); 138 139 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 139 140 ok_float_tol(myStats->sampleMean, expectedMeanWithMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanWithMaskF32); … … 144 145 { 145 146 psMemId id = psMemGetId(); 146 myStats = psVectorStats(myStats, myVector, myErrors, maskVector, 1); 147 bool result = psVectorStats(myStats, myVector, myErrors, maskVector, 1); 148 ok(result, "psVectorStats suceeded"); 147 149 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 148 150 ok_float_tol(myStats->sampleMean, expectedWeightMeanWithMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedWeightMeanWithMaskF32); … … 154 156 psMemId id = psMemGetId(); 155 157 myStats->options = PS_STAT_SAMPLE_MEAN | PS_STAT_USE_RANGE; 156 myStats = psVectorStats(myStats, myVector, NULL, maskVector, 1); 158 bool result = psVectorStats(myStats, myVector, NULL, maskVector, 1); 159 ok(result, "psVectorStats suceeded"); 157 160 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 158 161 ok_float_tol(myStats->sampleMean, expectedMeanRangeWithMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanRangeWithMaskF32); … … 163 166 { 164 167 psMemId id = psMemGetId(); 165 myStats = psVectorStats(myStats, myVector, myErrors, maskVector, 1); 168 bool result = psVectorStats(myStats, myVector, myErrors, maskVector, 1); 169 ok(result, "psVectorStats suceeded"); 166 170 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 167 171 ok_float_tol(myStats->sampleMean, expectedWeightMeanWithMaskRangeF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedWeightMeanWithMaskRangeF32); … … 178 182 } 179 183 } 180 myStats = psVectorStats(myStats, myVector, NULL, maskVector, 2); 184 bool result = psVectorStats(myStats, myVector, NULL, maskVector, 2); 185 ok(result, "psVectorStats suceeded"); 181 186 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 182 187 ok_float_tol(myStats->sampleMean, expectedMeanWithMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanWithMaskF32); … … 193 198 } 194 199 } 195 myStats = psVectorStats(myStats, myVector, NULL, maskVector, 4); 200 bool result = psVectorStats(myStats, myVector, NULL, maskVector, 4); 201 ok(result, "psVectorStats suceeded"); 196 202 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 197 203 ok_float_tol(myStats->sampleMean, expectedMeanNoMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanNoMaskF32); … … 206 212 maskVector->data.U8[i] = 1; 207 213 } 208 myStats = psVectorStats(myStats, myVector, NULL, maskVector, 1); 214 bool result = psVectorStats(myStats, myVector, NULL, maskVector, 1); 215 ok(result, "psVectorStats suceeded"); 209 216 ok(isnan(myStats->sampleMean), "psVectorStats() returned NAN"); 210 217 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 214 221 { 215 222 psMemId id = psMemGetId(); 216 ok(psVectorStats(myStats, NULL, NULL, NULL, 0) == NULL, "psVectorStats() returned NULL with NULL inputs"); 217 ok(psVectorStats(NULL, myVector, NULL, NULL, 0) == NULL, "psVectorStats() returned NULL with NULL inputs"); 218 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 219 } 220 221 222 223 224 225 226 227 228 229 223 ok(!psVectorStats(myStats, NULL, NULL, NULL, 0), "psVectorStats() returned false with NULL inputs"); 224 ok(!psVectorStats(NULL, myVector, NULL, NULL, 0), "psVectorStats() returned false with NULL inputs"); 225 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 226 } 230 227 231 228 psFree(myStats); … … 247 244 } 248 245 249 myStats = psVectorStats(myStats, myVector, NULL, NULL, 0); 246 bool result = psVectorStats(myStats, myVector, NULL, NULL, 0); 247 ok(result, "psVectorStats suceeded"); 250 248 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 251 249 ok_float_tol(myStats->sampleMean, expectedMeanNoMaskS8, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanNoMaskS8); … … 267 265 } 268 266 269 myStats = psVectorStats(myStats, myVector, NULL, NULL, 0); 267 bool result = psVectorStats(myStats, myVector, NULL, NULL, 0); 268 ok(result, "psVectorStats suceeded"); 270 269 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 271 270 ok_float_tol(myStats->sampleMean, expectedMeanNoMaskU16, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanNoMaskU16); … … 286 285 } 287 286 288 myStats = psVectorStats(myStats, myVector, NULL, NULL, 0); 287 bool result = psVectorStats(myStats, myVector, NULL, NULL, 0); 288 ok(result, "psVectorStats suceeded"); 289 289 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 290 290 ok_float_tol(myStats->sampleMean, expectedMeanNoMaskF64, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanNoMaskF64); -
trunk/psLib/test/math/tap_psStats01.c
r10831 r10848 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $11 * @date $Date: 2006-12-2 6 20:33:55$10 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2006-12-29 04:38:42 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 60 60 { 61 61 psMemId id = psMemGetId(); 62 myStats = psVectorStats(myStats, myVector, NULL, NULL, 0); 62 bool result = psVectorStats(myStats, myVector, NULL, NULL, 0); 63 ok(result, "psVectorStats suceeded"); 63 64 ok(!isnan(myStats->max), "psVectorStats() returned non-NAN"); 64 65 ok_float_tol(myStats->max, expectedMaxNoMaskF32, 1e-4, … … 70 71 { 71 72 psMemId id = psMemGetId(); 72 myStats = psVectorStats(myStats, myVector, NULL, maskVector, 1); 73 bool result = psVectorStats(myStats, myVector, NULL, maskVector, 1); 74 ok(result, "psVectorStats suceeded"); 73 75 ok(!isnan(myStats->max), "psVectorStats() returned non-NAN"); 74 76 ok_float_tol(myStats->max, expectedMaxWithMaskF32, 1e-4, … … 83 85 myStats->max = 10.2; 84 86 myStats->min = 0.0; 85 myStats = psVectorStats(myStats, myVector, NULL, NULL, 0); 87 bool result = psVectorStats(myStats, myVector, NULL, NULL, 0); 88 ok(result, "psVectorStats suceeded"); 86 89 ok(!isnan(myStats->max), "psVectorStats() returned non-NAN"); 87 90 ok_float_tol(myStats->max, expectedMaxRangeNoMaskF32, 1e-4, … … 95 98 myStats->max = 14.0; 96 99 myStats->min = 0.0; 97 myStats = psVectorStats(myStats, myVector, NULL, maskVector, 1); 100 bool result = psVectorStats(myStats, myVector, NULL, maskVector, 1); 101 ok(result, "psVectorStats suceeded"); 98 102 ok(!isnan(myStats->max), "psVectorStats() returned non-NAN"); 99 103 ok_float_tol(myStats->max, expectedMaxRangeWithMaskF32, 1e-4, … … 107 111 myStats->max = 100.00; 108 112 myStats->min = 90.00; 109 myStats = psVectorStats(myStats, myVector, NULL, NULL, 0); 113 bool result = psVectorStats(myStats, myVector, NULL, NULL, 0); 114 ok(!result, "psVectorStats failed as expected"); 110 115 ok(isnan(myStats->max), "psVectorStats() returned NAN"); 111 116 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 128 133 } 129 134 130 myStats = psVectorStats(myStats, myVector, NULL, NULL, 0); 135 bool result = psVectorStats(myStats, myVector, NULL, NULL, 0); 136 ok(result, "psVectorStats suceeded"); 131 137 ok(!isnan(myStats->max), "psVectorStats() returned non-NAN"); 132 138 ok_float_tol(myStats->max, expectedMaxNoMaskS8, 1e-4, … … 148 154 } 149 155 150 myStats = psVectorStats(myStats, myVector, NULL, NULL, 0); 156 bool result = psVectorStats(myStats, myVector, NULL, NULL, 0); 157 ok(result, "psVectorStats suceeded"); 151 158 ok(!isnan(myStats->max), "psVectorStats() returned non-NAN"); 152 159 ok_float_tol(myStats->max, expectedMaxNoMaskU16, 1e-4, … … 168 175 } 169 176 170 myStats = psVectorStats(myStats, myVector, NULL, NULL, 0); 177 bool result = psVectorStats(myStats, myVector, NULL, NULL, 0); 178 ok(result, "psVectorStats suceeded"); 171 179 ok(!isnan(myStats->max), "psVectorStats() returned non-NAN"); 172 180 ok_float_tol(myStats->max, expectedMaxNoMaskF64, 1e-4, -
trunk/psLib/test/math/tap_psStats02.c
r10831 r10848 11 11 * @author GLG, MHPCC 12 12 * 13 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $14 * @date $Date: 2006-12-2 6 20:33:55$13 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2006-12-29 04:38:42 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 64 64 { 65 65 psMemId id = psMemGetId(); 66 myStats = psVectorStats(myStats, myVector, NULL, NULL, 0); 66 bool result = psVectorStats(myStats, myVector, NULL, NULL, 0); 67 ok(result, "psVectorStats suceeded"); 67 68 ok(!isnan(myStats->min), "psVectorStats() returned non-NAN"); 68 69 ok_float_tol(myStats->min, expectedMinNoMaskF32, 1e-4, … … 76 77 { 77 78 psMemId id = psMemGetId(); 78 myStats = psVectorStats(myStats, myVector, NULL, maskVector, 1); 79 bool result = psVectorStats(myStats, myVector, NULL, maskVector, 1); 80 ok(result, "psVectorStats suceeded"); 79 81 ok(!isnan(myStats->min), "psVectorStats() returned non-NAN"); 80 82 ok_float_tol(myStats->min, expectedMinWithMaskF32, 1e-4, … … 89 91 myStats->max = 10.2; 90 92 myStats->min = 0.0; 91 myStats = psVectorStats(myStats, myVector, NULL, NULL, 0); 93 bool result = psVectorStats(myStats, myVector, NULL, NULL, 0); 94 ok(result, "psVectorStats suceeded"); 92 95 ok(!isnan(myStats->min), "psVectorStats() returned non-NAN"); 93 96 ok_float_tol(myStats->min, expectedMinRangeNoMaskF32, 1e-4, … … 101 104 myStats->max = 10.1; 102 105 myStats->min = -15.00; 103 myStats = psVectorStats(myStats, myVector, NULL, maskVector, 1); 106 bool result = psVectorStats(myStats, myVector, NULL, maskVector, 1); 107 ok(result, "psVectorStats succeeded"); 104 108 ok(!isnan(myStats->min), "psVectorStats() returned non-NAN"); 105 109 ok_float_tol(myStats->min, expectedMinRangeWithMaskF32, 1e-4, … … 113 117 myStats->max = 100.00; 114 118 myStats->min = 90.00; 115 myStats = psVectorStats(myStats, myVector, NULL, NULL, 0); 119 bool result = psVectorStats(myStats, myVector, NULL, NULL, 0); 120 ok(!result, "psVectorStats failed as expected"); 116 121 ok(isnan(myStats->min), "psVectorStats() returned NAN"); 117 122 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 134 139 } 135 140 136 myStats = psVectorStats(myStats, myVector, NULL, NULL, 0); 141 bool result = psVectorStats(myStats, myVector, NULL, NULL, 0); 142 ok(result, "psVectorStats succeeded"); 137 143 ok(!isnan(myStats->min), "psVectorStats() returned non-NAN"); 138 144 ok_float_tol(myStats->min, expectedMinNoMaskS8, 1e-4, … … 154 160 } 155 161 156 myStats = psVectorStats(myStats, myVector, NULL, NULL, 0); 162 bool result = psVectorStats(myStats, myVector, NULL, NULL, 0); 163 ok(result, "psVectorStats succeeded"); 157 164 ok(!isnan(myStats->min), "psVectorStats() returned non-NAN"); 158 165 ok_float_tol(myStats->min, expectedMinNoMaskU16, 1e-4, … … 174 181 } 175 182 176 myStats = psVectorStats(myStats, myVector, NULL, NULL, 0); 183 bool result = psVectorStats(myStats, myVector, NULL, NULL, 0); 184 ok(result, "psVectorStats succeeded"); 177 185 ok(!isnan(myStats->min), "psVectorStats() returned non-NAN"); 178 186 ok_float_tol(myStats->min, expectedMinNoMaskF64, 1e-4, -
trunk/psLib/test/math/tap_psStats03.c
r10831 r10848 41 41 { 42 42 psMemId id = psMemGetId(); 43 myStats = psVectorStats(myStats, myVector, NULL, NULL, 0); 43 bool result = psVectorStats(myStats, myVector, NULL, NULL, 0); 44 ok(result, "psVectorStats succeeded"); 44 45 ok(!isnan(myStats->sampleMedian), "psVectorStats() returned non-NAN"); 45 46 ok_float_tol(myStats->sampleMedian, realMedianNoMask, 1e-4, … … 51 52 { 52 53 psMemId id = psMemGetId(); 53 myStats = psVectorStats(myStats, myVector, NULL, maskVector, 1); 54 bool result = psVectorStats(myStats, myVector, NULL, maskVector, 1); 55 ok(result, "psVectorStats succeeded"); 54 56 ok(!isnan(myStats->sampleMedian), "psVectorStats() returned non-NAN"); 55 57 ok_float_tol(myStats->sampleMedian, realMedianWithMask, 1e-4, -
trunk/psLib/test/math/tap_psStats06.c
r10831 r10848 42 42 { 43 43 psMemId id = psMemGetId(); 44 myStats = psVectorStats(myStats, myVector, NULL, NULL, 0); 44 bool result = psVectorStats(myStats, myVector, NULL, NULL, 0); 45 ok(result, "psVectorStats succeeded"); 45 46 ok(!isnan(myStats->sampleStdev), "psVectorStats() returned non-NAN"); 46 47 ok_float_tol(myStats->sampleStdev, realStdevNoMask, 1e-4, … … 52 53 { 53 54 psMemId id = psMemGetId(); 54 myStats = psVectorStats(myStats, myVector, NULL, maskVector, 1); 55 bool result = psVectorStats(myStats, myVector, NULL, maskVector, 1); 56 ok(result, "psVectorStats succeeded"); 55 57 ok(!isnan(myStats->sampleStdev), "psVectorStats() returned non-NAN"); 56 58 ok_float_tol(myStats->sampleStdev, realStdevWithMask, 1e-4, -
trunk/psLib/test/math/tap_psStats07.c
r10831 r10848 314 314 if (expectedRC == true) { 315 315 psStats *myStats = psStatsAlloc(PS_STAT_SAMPLE_MEAN | PS_STAT_SAMPLE_STDEV | PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_QUARTILE); 316 psStats *rc = psVectorStats(myStats, in, NULL, NULL, maskValue);317 if (rc == NULL) {316 bool rc = psVectorStats(myStats, in, NULL, NULL, maskValue); 317 if (rc == false) { 318 318 diag("TEST ERROR: the psVectorStats() function returned NULL.\n"); 319 319 testStatus = false; … … 406 406 PS_STAT_FITTED_MEAN | 407 407 PS_STAT_FITTED_STDEV); 408 psStats *rc = psVectorStats(myStats, in, errors, mask, maskValue);409 410 if (rc == NULL) {408 bool rc = psVectorStats(myStats, in, errors, mask, maskValue); 409 410 if (rc == false) { 411 411 if (expectedRC == true) { 412 412 diag("TEST ERROR: the psVectorStats() function returned NULL.\n"); -
trunk/psLib/test/math/tap_psStats08.c
r10831 r10848 42 42 { 43 43 psMemId id = psMemGetId(); 44 myStats = psVectorStats(myStats, myVector, NULL, NULL, 0); 44 bool result = psVectorStats(myStats, myVector, NULL, NULL, 0); 45 ok(result, "psVectorStats succeeded"); 45 46 ok(!isnan(myStats->sampleLQ), "psVectorStats() returned non-NAN"); 46 47 ok_float_tol(myStats->sampleLQ, realLQNoMask, 1e-4, … … 52 53 { 53 54 psMemId id = psMemGetId(); 54 myStats = psVectorStats(myStats, myVector, NULL, NULL, 0); 55 bool result = psVectorStats(myStats, myVector, NULL, NULL, 0); 56 ok(result, "psVectorStats succeeded"); 55 57 ok(!isnan(myStats->sampleUQ), "psVectorStats() returned non-NAN"); 56 58 ok_float_tol(myStats->sampleUQ, realUQNoMask, 1e-4, … … 62 64 { 63 65 psMemId id = psMemGetId(); 64 myStats = psVectorStats(myStats, myVector, NULL, maskVector, 1); 66 bool result = psVectorStats(myStats, myVector, NULL, maskVector, 1); 67 ok(result, "psVectorStats succeeded"); 65 68 ok(!isnan(myStats->sampleLQ), "psVectorStats() returned non-NAN"); 66 69 ok_float_tol(myStats->sampleLQ, realLQWithMask, 1e-4, … … 72 75 { 73 76 psMemId id = psMemGetId(); 74 myStats = psVectorStats(myStats, myVector, NULL, maskVector, 1); 77 bool result = psVectorStats(myStats, myVector, NULL, maskVector, 1); 78 ok(result, "psVectorStats succeeded"); 75 79 ok(!isnan(myStats->sampleUQ), "psVectorStats() returned non-NAN"); 76 80 ok_float_tol(myStats->sampleUQ, realUQNoMask, 1e-4, -
trunk/psLib/test/math/tap_psStats09.c
r10831 r10848 280 280 if (expectedRC == true) { 281 281 psStats *myStats = psStatsAlloc(PS_STAT_SAMPLE_MEAN | PS_STAT_SAMPLE_STDEV); 282 psStats *rc = psVectorStats(myStats, in, errors, outliers, 1);283 if (rc == NULL) {282 bool rc = psVectorStats(myStats, in, errors, outliers, 1); 283 if (rc == false) { 284 284 diag("TEST ERROR: the psVectorStats() function returned NULL.\n"); 285 285 testStatus = false; … … 298 298 myStats->clipSigma = 5.0; 299 299 myStats->clipIter = 2; 300 psStats *rc = psVectorStats(myStats, in, errors, mask, maskValue);301 if (rc == NULL) {300 bool rc = psVectorStats(myStats, in, errors, mask, maskValue); 301 if (rc == false) { 302 302 if (expectedRC == true) { 303 303 diag("TEST ERROR: the psVectorStats() function returned NULL.\n");
Note:
See TracChangeset
for help on using the changeset viewer.
