Changeset 21126
- Timestamp:
- Jan 17, 2009, 10:30:35 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20081230/psLib/src/math/psStats.c
r21074 r21126 13 13 * use ->min and ->max (PS_STAT_USE_RANGE) 14 14 * 15 * @version $Revision: 1.230.8. 1$ $Name: not supported by cvs2svn $16 * @date $Date: 200 8-12-30 20:40:00$15 * @version $Revision: 1.230.8.2 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2009-01-17 20:30:35 $ 17 17 * 18 18 * Copyright 2006 IfA, University of Hawaii … … 728 728 // XXX this would be better if we had globally defined mask values 729 729 psVectorMaskType maskVal = MASK_MARK | maskValInput; 730 psVector *mask = psVectorAlloc(myVector->n, PS_TYPE_ MASK); // The actual mask we will use730 psVector *mask = psVectorAlloc(myVector->n, PS_TYPE_VECTOR_MASK); // The actual mask we will use 731 731 psVectorInit(mask, 0); 732 732 if (maskInput) { … … 2256 2256 } 2257 2257 } 2258 psVector *mask U8= NULL; // Input mask vector, U8 version2258 psVector *maskVector = NULL; // Input mask vector, U8 version 2259 2259 if (mask) { 2260 if (mask->type.type == PS_TYPE_ MASK) {2261 mask U8= psMemIncrRefCounter((psPtr)mask);2260 if (mask->type.type == PS_TYPE_VECTOR_MASK) { 2261 maskVector = psMemIncrRefCounter((psPtr)mask); 2262 2262 } else { 2263 mask U8 = psVectorCopy(NULL, mask, PS_TYPE_MASK);2263 maskVector = psVectorCopy(NULL, mask, PS_TYPE_VECTOR_MASK); 2264 2264 } 2265 2265 } … … 2280 2280 // ************************************************************************ 2281 2281 if (stats->options & PS_STAT_SAMPLE_MEAN) { 2282 if (!vectorSampleMean(inF32, errorsF32, mask U8, maskVal, stats)) {2282 if (!vectorSampleMean(inF32, errorsF32, maskVector, maskVal, stats)) { 2283 2283 psError(PS_ERR_UNKNOWN, false, "Failed to calculate vector sample mean"); 2284 2284 status &= false; … … 2288 2288 // ************************************************************************ 2289 2289 if (stats->options & (PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_QUARTILE)) { 2290 if (!vectorSampleMedian(inF32, mask U8, maskVal, stats)) {2290 if (!vectorSampleMedian(inF32, maskVector, maskVal, stats)) { 2291 2291 psError(PS_ERR_UNKNOWN, false, "Failed to calculate sample median"); 2292 2292 status &= false; … … 2296 2296 // ************************************************************************ 2297 2297 if (stats->options & PS_STAT_SAMPLE_STDEV) { 2298 if (!vectorSampleStdev(inF32, errorsF32, mask U8, maskVal, stats)) {2298 if (!vectorSampleStdev(inF32, errorsF32, maskVector, maskVal, stats)) { 2299 2299 psError(PS_ERR_UNKNOWN, false, "Failed to calculate sample stdev"); 2300 2300 status &= false; … … 2303 2303 2304 2304 if (stats->options & (PS_STAT_SAMPLE_SKEWNESS | PS_STAT_SAMPLE_KURTOSIS)) { 2305 if (!vectorSampleMoments(inF32, mask U8, maskVal, stats)) {2305 if (!vectorSampleMoments(inF32, maskVector, maskVal, stats)) { 2306 2306 psError(PS_ERR_UNKNOWN, false, "Failed to calculate sample moments"); 2307 2307 status &= false; … … 2311 2311 // ************************************************************************ 2312 2312 if (stats->options & (PS_STAT_MAX | PS_STAT_MIN)) { 2313 if (vectorMinMax(inF32, mask U8, maskVal, stats) == 0) {2313 if (vectorMinMax(inF32, maskVector, maskVal, stats) == 0) { 2314 2314 psError(PS_ERR_UNKNOWN, false, "Failed to calculate vector minimum and maximum"); 2315 2315 status &= false; … … 2319 2319 // ************************************************************************ 2320 2320 if (stats->options & (PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV | PS_STAT_ROBUST_QUARTILE)) { 2321 if (!vectorRobustStats(inF32, errorsF32, mask U8, maskVal, stats)) {2321 if (!vectorRobustStats(inF32, errorsF32, maskVector, maskVal, stats)) { 2322 2322 psError(PS_ERR_UNKNOWN, false, _("Failed to calculate robust statistics")); 2323 2323 status &= false; … … 2327 2327 // ************************************************************************ 2328 2328 if (stats->options & (PS_STAT_FITTED_MEAN | PS_STAT_FITTED_STDEV)) { 2329 if (!vectorFittedStats(inF32, errorsF32, mask U8, maskVal, stats)) {2329 if (!vectorFittedStats(inF32, errorsF32, maskVector, maskVal, stats)) { 2330 2330 psError(PS_ERR_UNKNOWN, false, _("Failed to calculate fitted statistics")); 2331 2331 status &= false; … … 2338 2338 psAbort("you may not specify both FITTED_MEAN and FITTED_MEAN_V2"); 2339 2339 } 2340 if (!vectorFittedStats_v2(inF32, errorsF32, mask U8, maskVal, stats)) {2340 if (!vectorFittedStats_v2(inF32, errorsF32, maskVector, maskVal, stats)) { 2341 2341 psError(PS_ERR_UNKNOWN, false, _("Failed to calculate fitted statistics")); 2342 2342 status &= false; … … 2349 2349 psAbort("you may not specify both FITTED_MEAN and FITTED_MEAN_V3"); 2350 2350 } 2351 if (!vectorFittedStats_v3(inF32, errorsF32, mask U8, maskVal, stats)) {2351 if (!vectorFittedStats_v3(inF32, errorsF32, maskVector, maskVal, stats)) { 2352 2352 psError(PS_ERR_UNKNOWN, false, _("Failed to calculate fitted statistics")); 2353 2353 status &= false; … … 2360 2360 psAbort("you may not specify both FITTED_MEAN and FITTED_MEAN_V4"); 2361 2361 } 2362 if (!vectorFittedStats_v4(inF32, errorsF32, mask U8, maskVal, stats)) {2362 if (!vectorFittedStats_v4(inF32, errorsF32, maskVector, maskVal, stats)) { 2363 2363 psError(PS_ERR_UNKNOWN, false, _("Failed to calculate fitted statistics")); 2364 2364 status &= false; … … 2368 2368 // ************************************************************************ 2369 2369 if ((stats->options & PS_STAT_CLIPPED_MEAN) || (stats->options & PS_STAT_CLIPPED_STDEV)) { 2370 if (!vectorClippedStats(inF32, errorsF32, mask U8, maskVal, stats)) {2370 if (!vectorClippedStats(inF32, errorsF32, maskVector, maskVal, stats)) { 2371 2371 psError(PS_ERR_UNKNOWN, false, "Failed to calculate clipped statistics\n"); 2372 2372 status &= false; … … 2376 2376 psFree(inF32); 2377 2377 psFree(errorsF32); 2378 psFree(mask U8);2378 psFree(maskVector); 2379 2379 psTrace(TRACE, 3,"---- %s() end ----\n", __func__); 2380 2380 return status;
Note:
See TracChangeset
for help on using the changeset viewer.
