Changeset 3160
- Timestamp:
- Feb 8, 2005, 9:24:26 AM (21 years ago)
- Location:
- trunk/psLib/test/dataManip
- Files:
-
- 2 edited
-
tst_psRandom.c (modified) (3 diffs)
-
tst_psStats09.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/dataManip/tst_psRandom.c
r3010 r3160 123 123 for (psS32 i = 0 ; i < NUM_DATA ; i++) { 124 124 rans->data.F64[i] = psRandomUniform(myRNG); 125 // printf("% f\n", rans->data.F64[i]);126 } 127 stats = psVectorStats(stats, rans, NULL, NULL, 0); 128 printf("Mean is % f\n", stats->sampleMean);125 // printf("%.2f\n", rans->data.F64[i]); 126 } 127 stats = psVectorStats(stats, rans, NULL, NULL, 0); 128 printf("Mean is %.2f\n", stats->sampleMean); 129 129 stats->options = PS_STAT_SAMPLE_STDEV; 130 130 stats = psVectorStats(stats, rans, NULL, NULL, 0); 131 printf("Standard deviation is % f\n", stats->sampleStdev);131 printf("Standard deviation is %.2f\n", stats->sampleStdev); 132 132 if ((fabs(stats->sampleMean - UNIFORM_MEAN) / UNIFORM_MEAN) > ERROR_TOLERANCE) { 133 printf("ERROR: psRandomUniform() mean is % f, should be %f\n", stats->sampleMean, UNIFORM_MEAN);133 printf("ERROR: psRandomUniform() mean is %.2f, should be %.2f\n", stats->sampleMean, UNIFORM_MEAN); 134 134 testStatus = false; 135 135 } 136 136 if ((fabs(stats->sampleStdev - UNIFORM_STDEV) / UNIFORM_STDEV) > ERROR_TOLERANCE) { 137 printf("ERROR: psRandomUniform() stdev is % f, should be %f\n", stats->sampleStdev, UNIFORM_STDEV);137 printf("ERROR: psRandomUniform() stdev is %.2f, should be %.2f\n", stats->sampleStdev, UNIFORM_STDEV); 138 138 testStatus = false; 139 139 } … … 184 184 for (psS32 i = 0 ; i < NUM_DATA ; i++) { 185 185 rans->data.F64[i] = psRandomGaussian(myRNG); 186 // printf("% f\n", rans->data.F64[i]);187 } 188 stats = psVectorStats(stats, rans, NULL, NULL, 0); 189 printf("Mean is % f\n", stats->sampleMean);186 // printf("%.2f\n", rans->data.F64[i]); 187 } 188 stats = psVectorStats(stats, rans, NULL, NULL, 0); 189 printf("Mean is %.2f\n", stats->sampleMean); 190 190 stats->options = PS_STAT_SAMPLE_STDEV; 191 191 stats = psVectorStats(stats, rans, NULL, NULL, 0); 192 printf("Standard deviation is % f\n", stats->sampleStdev);192 printf("Standard deviation is %.2f\n", stats->sampleStdev); 193 193 if ((fabs(stats->sampleMean - GAUSSIAN_MEAN) / 1.0) > ERROR_TOLERANCE) { 194 printf("ERROR: psRandomUniform() mean is % f, should be %f\n", stats->sampleMean, GAUSSIAN_MEAN);194 printf("ERROR: psRandomUniform() mean is %.2f, should be %.2f\n", stats->sampleMean, GAUSSIAN_MEAN); 195 195 testStatus = false; 196 196 } 197 197 if ((fabs(stats->sampleStdev - GAUSSIAN_STDEV) / GAUSSIAN_STDEV) > ERROR_TOLERANCE) { 198 printf("ERROR: psRandomUniform() stdev is % f, should be %f\n", stats->sampleStdev, GAUSSIAN_STDEV);198 printf("ERROR: psRandomUniform() stdev is %.2f, should be %.2f\n", stats->sampleStdev, GAUSSIAN_STDEV); 199 199 testStatus = false; 200 200 } … … 245 245 for (psS32 i = 0 ; i < NUM_DATA ; i++) { 246 246 rans->data.F64[i] = psRandomPoisson(myRNG, POISSON_MEAN); 247 // printf("% f\n", rans->data.F64[i]);248 } 249 stats = psVectorStats(stats, rans, NULL, NULL, 0); 250 printf("Mean is % f\n", stats->sampleMean);247 // printf("%.2f\n", rans->data.F64[i]); 248 } 249 stats = psVectorStats(stats, rans, NULL, NULL, 0); 250 printf("Mean is %.2f\n", stats->sampleMean); 251 251 stats->options = PS_STAT_SAMPLE_STDEV; 252 252 stats = psVectorStats(stats, rans, NULL, NULL, 0); 253 printf("Standard deviation is % f\n", stats->sampleStdev);253 printf("Standard deviation is %.2f\n", stats->sampleStdev); 254 254 if ((fabs(stats->sampleMean - POISSON_MEAN) / POISSON_MEAN) > ERROR_TOLERANCE) { 255 printf("ERROR: psRandomUniform() mean is % f, should be %f\n", stats->sampleMean, POISSON_MEAN);255 printf("ERROR: psRandomUniform() mean is %.2f, should be %.2f\n", stats->sampleMean, POISSON_MEAN); 256 256 testStatus = false; 257 257 } 258 258 if ((fabs(stats->sampleStdev - POISSON_STDEV) / POISSON_STDEV) > ERROR_TOLERANCE) { 259 printf("ERROR: psRandomUniform() stdev is % f, should be %f\n", stats->sampleStdev, POISSON_STDEV);259 printf("ERROR: psRandomUniform() stdev is %.2f, should be %.2f\n", stats->sampleStdev, POISSON_STDEV); 260 260 testStatus = false; 261 261 } -
trunk/psLib/test/dataManip/tst_psStats09.c
r2780 r3160 71 71 72 72 printf("Called psVectorStats() on a vector with no elements masked.\n"); 73 printf("The calculated clippedMean was % f\n", myStats->clippedMean);73 printf("The calculated clippedMean was %.2f\n", myStats->clippedMean); 74 74 75 75 printFooter(stdout, … … 85 85 86 86 printf("Called psVectorStats() on a vector with no elements masked.\n"); 87 printf("The calculated clippedStdev was % f\n", myStats->clippedStdev);87 printf("The calculated clippedStdev was %.2f\n", myStats->clippedStdev); 88 88 89 89 printFooter(stdout, … … 102 102 103 103 printf("Called psVectorStats() on a vector with elements masked.\n"); 104 printf("The calculated clippedMean was % f\n", myStats->clippedMean);104 printf("The calculated clippedMean was %.2f\n", myStats->clippedMean); 105 105 printFooter(stdout, 106 106 "psVector functions", … … 115 115 116 116 printf("Called psVectorStats() on a vector with elements masked.\n"); 117 printf("The calculated clippedStdev was % f\n", myStats->clippedStdev);117 printf("The calculated clippedStdev was %.2f\n", myStats->clippedStdev); 118 118 printFooter(stdout, 119 119 "psVector functions",
Note:
See TracChangeset
for help on using the changeset viewer.
