Changeset 41494 for trunk/psLib/src/math/psStats.c
- Timestamp:
- Feb 11, 2021, 2:35:51 PM (5 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psStats.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psStats.c
r36290 r41494 353 353 // Sort the temporary vector. 354 354 if (!psVectorSort(outVector, outVector)) { // Sort in-place (since it's a copy, it's OK) 355 // an error in psVectorSort is a serious error 355 // an error in psVectorSort is a serious error: 356 // NULL input vector, psVectorCopy failure, invalid vector type 356 357 psError(PS_ERR_UNEXPECTED_NULL, false, _("Failed to sort input data.")); 357 358 stats->sampleUQ = NAN; … … 1888 1889 // ************************************************************************ 1889 1890 if (stats->options & PS_STAT_SAMPLE_MEAN) { 1891 // NOTE: vectorSampleMean cannot return 'false' 1890 1892 if (!vectorSampleMean(inF32, errorsF32, maskVector, maskVal, stats)) { 1891 1893 psError(PS_ERR_UNKNOWN, false, "Failed to calculate vector sample mean"); … … 1896 1898 // ************************************************************************ 1897 1899 if (stats->options & (PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_QUARTILE)) { 1900 // NOTE: vectorSampleMedian only returns 'false' for very bad cases: 1901 // NULL input vector, psVectorCopy failure, invalid vector type (likely programming errors) 1898 1902 if (!vectorSampleMedian(inF32, maskVector, maskVal, stats)) { 1899 1903 psError(PS_ERR_UNKNOWN, false, "Failed to calculate sample median"); … … 1904 1908 // ************************************************************************ 1905 1909 if (stats->options & PS_STAT_SAMPLE_STDEV) { 1910 // NOTE: vectorSampleStdev cannot return 'false' 1906 1911 if (!vectorSampleStdev(inF32, errorsF32, maskVector, maskVal, stats)) { 1907 1912 psError(PS_ERR_UNKNOWN, false, "Failed to calculate sample stdev"); … … 1911 1916 1912 1917 if (stats->options & (PS_STAT_SAMPLE_SKEWNESS | PS_STAT_SAMPLE_KURTOSIS)) { 1918 // NOTE: vectorSampleMoments cannot return 'false' 1913 1919 if (!vectorSampleMoments(inF32, maskVector, maskVal, stats)) { 1914 1920 psError(PS_ERR_UNKNOWN, false, "Failed to calculate sample moments"); … … 1919 1925 // ************************************************************************ 1920 1926 if (stats->options & (PS_STAT_MAX | PS_STAT_MIN)) { 1921 if (vectorMinMax(inF32, maskVector, maskVal, stats) == 0) { 1922 psError(PS_ERR_UNKNOWN, false, "Failed to calculate vector minimum and maximum"); 1923 status &= false; 1924 }1927 // NOTE: vectorMinMax returns 0 if there are no valid values, 1928 // but this is not an error condition. stats.min,max are set to NAN. 1929 // vectorMinMax cannot raise an error 1930 vectorMinMax(inF32, maskVector, maskVal, stats); 1925 1931 } 1926 1932
Note:
See TracChangeset
for help on using the changeset viewer.
