Changeset 41520 for trunk/psLib
- Timestamp:
- Apr 2, 2021, 2:12:52 PM (5 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psStats.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psStats.c
r41503 r41520 377 377 } 378 378 379 int Qmin = (int) 0.25*count;380 int Qmax = (int) 0.75*count;379 int Qmin = (int)(0.25*count); 380 int Qmax = (int)(0.75*count); 381 381 psAssert (Qmin >= 0, "oops"); 382 382 psAssert (Qmin < outVector->n, "oops"); … … 385 385 386 386 // Calculate the quartile points exactly. 387 stats->sampleUQ = output[ (int)(0.75*count)];388 stats->sampleLQ = output[ (int)(0.25*count)];389 387 stats->sampleUQ = output[Qmax]; 388 stats->sampleLQ = output[Qmin]; 389 390 390 stats->results |= PS_STAT_SAMPLE_MEDIAN; 391 391 stats->results |= PS_STAT_SAMPLE_QUARTILE; … … 1915 1915 // NOTE: vectorSampleMedian only returns 'false' for very bad cases: 1916 1916 // NULL input vector, psVectorCopy failure, invalid vector type (likely programming errors) 1917 if (!vectorSampleMedian(inF32, maskVector, maskVal, stats)) {1918 psError(PS_ERR_UNKNOWN, false, "Failed to calculate sample median");1919 status &= false;1920 }1917 if (!vectorSampleMedian(inF32, maskVector, maskVal, stats)) { 1918 psError(PS_ERR_UNKNOWN, false, "Failed to calculate sample median"); 1919 status &= false; 1920 } 1921 1921 } 1922 1922
Note:
See TracChangeset
for help on using the changeset viewer.
