Changeset 1879
- Timestamp:
- Sep 24, 2004, 10:08:22 AM (22 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 2 added
- 6 edited
-
dataManip/psConstants.h (added)
-
dataManip/psMinimize.c (modified) (2 diffs)
-
dataManip/psStats.c (modified) (10 diffs)
-
dataManip/psStats.h (modified) (6 diffs)
-
math/psConstants.h (added)
-
math/psMinimize.c (modified) (2 diffs)
-
math/psStats.c (modified) (10 diffs)
-
math/psStats.h (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/dataManip/psMinimize.c
r1861 r1879 9 9 * @author George Gusciora, MHPCC 10 10 * 11 * @version $Revision: 1.4 7$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-09-2 3 06:12:22 $11 * @version $Revision: 1.48 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-09-24 20:08:22 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 730 730 731 731 PS_CHECK_NULL_1DPOLY(myPoly); 732 PS_CHECK_NULL_VECTOR(x);733 PS_CHECK_EMPTY_VECTOR(x);734 732 PS_CHECK_NULL_VECTOR(y); 735 733 PS_CHECK_EMPTY_VECTOR(y); 734 735 // XXX: Verify that this is the correct action. 736 if (x == NULL) { 737 x = psVectorAlloc(y->n, PS_TYPE_F32); 738 for (i=0;i<x->n;i++) { 739 x->data.F32[i] = (float) i; 740 } 741 } 742 743 PS_CHECK_EMPTY_VECTOR(x); 736 744 PS_CHECK_NULL_VECTOR(yErr); 737 745 PS_CHECK_EMPTY_VECTOR(yErr); -
trunk/psLib/src/dataManip/psStats.c
r1846 r1879 9 9 * @author George Gusciora, MHPCC 10 10 * 11 * @version $Revision: 1.5 7$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-09-2 2 01:30:21$11 * @version $Revision: 1.58 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-09-24 20:08:22 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 23 23 24 24 /*****************************************************************************/ 25 26 25 /* INCLUDE FILES */ 27 28 26 /*****************************************************************************/ 29 27 #include "psMemory.h" … … 38 36 39 37 /*****************************************************************************/ 40 41 38 /* DEFINE STATEMENTS */ 42 43 39 /*****************************************************************************/ 44 40 // will use robust statistical methods. … … 88 84 89 85 /*****************************************************************************/ 90 91 86 /* TYPE DEFINITIONS */ 92 93 87 /*****************************************************************************/ 94 88 95 89 /*****************************************************************************/ 96 97 90 /* GLOBAL VARIABLES */ 98 99 91 /*****************************************************************************/ 100 92 … … 102 94 103 95 /*****************************************************************************/ 104 105 96 /* FILE STATIC VARIABLES */ 106 107 97 /*****************************************************************************/ 108 98 … … 110 100 111 101 /*****************************************************************************/ 112 113 102 /* FUNCTION IMPLEMENTATION - LOCAL */ 114 115 103 /*****************************************************************************/ 116 104 … … 471 459 // regardless of the vector size. 472 460 /* 473 * if (myVector->n > stats->sampleLimit) { psAbort(__func__, "Robust Statistic Algorithms have not yet474 * been defined or implemented.");475 *476 461 * // Calculate the robust quartiles. stats2 = psStatsAlloc(PS_STAT_ROBUST_MEDIAN); 477 462 * p_psVectorRobustStats(myVector, maskVector, maskVal, stats2); … … 1525 1510 newStruct->sampleUQ = NAN; 1526 1511 newStruct->sampleLQ = NAN; 1527 newStruct->sampleLimit = 30000;1528 1512 newStruct->robustMean = NAN; 1529 1513 newStruct->robustMedian = NAN; … … 1780 1764 algorithms stablize, we will then macro everything and put type support in 1781 1765 the various stat functions. 1766 1767 XXX: Should the default data type be F64? Since we are buying Athlons... 1782 1768 *****************************************************************************/ 1783 1769 psVector* p_psConvertToF32(psStats* stats, psVector* in, psVector* mask, unsigned int maskVal) … … 1826 1812 macro-ize everything and add PS_TYPE_U16 and PS_TYPE_F64. 1827 1813 *****************************************************************************/ 1828 psStats* psVectorStats(psStats* stats, psVector* in, psVector* mask, unsigned int maskVal) 1814 psStats* psVectorStats(psStats* stats, 1815 psVector* in, 1816 psVector* mask, 1817 unsigned int maskVal) 1829 1818 { 1830 1819 psVector* inF32; -
trunk/psLib/src/dataManip/psStats.h
r1470 r1879 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1.2 5$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-0 8-11 19:16:04$12 * @version $Revision: 1.26 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-09-24 20:08:22 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 31 31 * @see psStats, psVectorStats, psImageStats 32 32 */ 33 // XXX: Is PS_STAT_ROBUST_FOR_SAMPLE obsolete? 33 34 typedef enum { 34 35 PS_STAT_SAMPLE_MEAN = 0x000001, … … 43 44 PS_STAT_CLIPPED_MEAN = 0x000200, 44 45 PS_STAT_CLIPPED_STDEV = 0x000400, 45 PS_STAT_MAX = 0x000800,46 PS_STAT_MIN = 0x001000,47 PS_STAT_USE_RANGE = 0x002000,46 PS_STAT_MAX = 0x000800, 47 PS_STAT_MIN = 0x001000, 48 PS_STAT_USE_RANGE = 0x002000, 48 49 PS_STAT_USE_BINSIZE = 0x004000, 49 50 PS_STAT_ROBUST_FOR_SAMPLE = 0x008000 … … 60 61 double sampleUQ; ///< upper quartile of sample 61 62 double sampleLQ; ///< lower quartile of sample 62 double sampleLimit; ///<63 63 double robustMean; ///< robust mean of array 64 64 double robustMedian; ///< robust median of array … … 67 67 double robustUQ; ///< robust upper quartile 68 68 double robustLQ; ///< robust lower quartile 69 double XXX;70 69 double robustN50; ///< 71 70 double robustNfit; ///< 72 71 double clippedMean; ///< Nsigma clipped mean 73 72 double clippedStdev; ///< standard deviation after clipping 73 int clippedNvalues ///< ??? 74 74 double clipSigma; ///< Nsigma used for clipping; user input 75 75 int clipIter; ///< Number of clipping iterations; user input … … 86 86 */ 87 87 psStats* psVectorStats( 88 psStats* stats, 89 ///< stats structure defines stats to be calculated and how 90 91 psVector* in, 92 ///< Vector to be analysed: must be F32 93 94 psVector* mask, 95 ///< Ignore elements where (maskVector & maskVal) != 0: must be INT or NULL 96 97 unsigned int maskVal 98 ///< Only mask elements with one of these bits set in maskVector 88 psStats* stats, ///< stats structure defines stats to be calculated and how 89 psVector* in, ///< Vector to be analysed: must be F32 90 psVector* mask, ///< Ignore elements where (maskVector & maskVal) != 0: must be INT or NULL 91 unsigned int maskVal ///< Only mask elements with one of these bits set in maskVector 99 92 ); 100 93 -
trunk/psLib/src/math/psMinimize.c
r1861 r1879 9 9 * @author George Gusciora, MHPCC 10 10 * 11 * @version $Revision: 1.4 7$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-09-2 3 06:12:22 $11 * @version $Revision: 1.48 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-09-24 20:08:22 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 730 730 731 731 PS_CHECK_NULL_1DPOLY(myPoly); 732 PS_CHECK_NULL_VECTOR(x);733 PS_CHECK_EMPTY_VECTOR(x);734 732 PS_CHECK_NULL_VECTOR(y); 735 733 PS_CHECK_EMPTY_VECTOR(y); 734 735 // XXX: Verify that this is the correct action. 736 if (x == NULL) { 737 x = psVectorAlloc(y->n, PS_TYPE_F32); 738 for (i=0;i<x->n;i++) { 739 x->data.F32[i] = (float) i; 740 } 741 } 742 743 PS_CHECK_EMPTY_VECTOR(x); 736 744 PS_CHECK_NULL_VECTOR(yErr); 737 745 PS_CHECK_EMPTY_VECTOR(yErr); -
trunk/psLib/src/math/psStats.c
r1846 r1879 9 9 * @author George Gusciora, MHPCC 10 10 * 11 * @version $Revision: 1.5 7$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-09-2 2 01:30:21$11 * @version $Revision: 1.58 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-09-24 20:08:22 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 23 23 24 24 /*****************************************************************************/ 25 26 25 /* INCLUDE FILES */ 27 28 26 /*****************************************************************************/ 29 27 #include "psMemory.h" … … 38 36 39 37 /*****************************************************************************/ 40 41 38 /* DEFINE STATEMENTS */ 42 43 39 /*****************************************************************************/ 44 40 // will use robust statistical methods. … … 88 84 89 85 /*****************************************************************************/ 90 91 86 /* TYPE DEFINITIONS */ 92 93 87 /*****************************************************************************/ 94 88 95 89 /*****************************************************************************/ 96 97 90 /* GLOBAL VARIABLES */ 98 99 91 /*****************************************************************************/ 100 92 … … 102 94 103 95 /*****************************************************************************/ 104 105 96 /* FILE STATIC VARIABLES */ 106 107 97 /*****************************************************************************/ 108 98 … … 110 100 111 101 /*****************************************************************************/ 112 113 102 /* FUNCTION IMPLEMENTATION - LOCAL */ 114 115 103 /*****************************************************************************/ 116 104 … … 471 459 // regardless of the vector size. 472 460 /* 473 * if (myVector->n > stats->sampleLimit) { psAbort(__func__, "Robust Statistic Algorithms have not yet474 * been defined or implemented.");475 *476 461 * // Calculate the robust quartiles. stats2 = psStatsAlloc(PS_STAT_ROBUST_MEDIAN); 477 462 * p_psVectorRobustStats(myVector, maskVector, maskVal, stats2); … … 1525 1510 newStruct->sampleUQ = NAN; 1526 1511 newStruct->sampleLQ = NAN; 1527 newStruct->sampleLimit = 30000;1528 1512 newStruct->robustMean = NAN; 1529 1513 newStruct->robustMedian = NAN; … … 1780 1764 algorithms stablize, we will then macro everything and put type support in 1781 1765 the various stat functions. 1766 1767 XXX: Should the default data type be F64? Since we are buying Athlons... 1782 1768 *****************************************************************************/ 1783 1769 psVector* p_psConvertToF32(psStats* stats, psVector* in, psVector* mask, unsigned int maskVal) … … 1826 1812 macro-ize everything and add PS_TYPE_U16 and PS_TYPE_F64. 1827 1813 *****************************************************************************/ 1828 psStats* psVectorStats(psStats* stats, psVector* in, psVector* mask, unsigned int maskVal) 1814 psStats* psVectorStats(psStats* stats, 1815 psVector* in, 1816 psVector* mask, 1817 unsigned int maskVal) 1829 1818 { 1830 1819 psVector* inF32; -
trunk/psLib/src/math/psStats.h
r1470 r1879 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1.2 5$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-0 8-11 19:16:04$12 * @version $Revision: 1.26 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-09-24 20:08:22 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 31 31 * @see psStats, psVectorStats, psImageStats 32 32 */ 33 // XXX: Is PS_STAT_ROBUST_FOR_SAMPLE obsolete? 33 34 typedef enum { 34 35 PS_STAT_SAMPLE_MEAN = 0x000001, … … 43 44 PS_STAT_CLIPPED_MEAN = 0x000200, 44 45 PS_STAT_CLIPPED_STDEV = 0x000400, 45 PS_STAT_MAX = 0x000800,46 PS_STAT_MIN = 0x001000,47 PS_STAT_USE_RANGE = 0x002000,46 PS_STAT_MAX = 0x000800, 47 PS_STAT_MIN = 0x001000, 48 PS_STAT_USE_RANGE = 0x002000, 48 49 PS_STAT_USE_BINSIZE = 0x004000, 49 50 PS_STAT_ROBUST_FOR_SAMPLE = 0x008000 … … 60 61 double sampleUQ; ///< upper quartile of sample 61 62 double sampleLQ; ///< lower quartile of sample 62 double sampleLimit; ///<63 63 double robustMean; ///< robust mean of array 64 64 double robustMedian; ///< robust median of array … … 67 67 double robustUQ; ///< robust upper quartile 68 68 double robustLQ; ///< robust lower quartile 69 double XXX;70 69 double robustN50; ///< 71 70 double robustNfit; ///< 72 71 double clippedMean; ///< Nsigma clipped mean 73 72 double clippedStdev; ///< standard deviation after clipping 73 int clippedNvalues ///< ??? 74 74 double clipSigma; ///< Nsigma used for clipping; user input 75 75 int clipIter; ///< Number of clipping iterations; user input … … 86 86 */ 87 87 psStats* psVectorStats( 88 psStats* stats, 89 ///< stats structure defines stats to be calculated and how 90 91 psVector* in, 92 ///< Vector to be analysed: must be F32 93 94 psVector* mask, 95 ///< Ignore elements where (maskVector & maskVal) != 0: must be INT or NULL 96 97 unsigned int maskVal 98 ///< Only mask elements with one of these bits set in maskVector 88 psStats* stats, ///< stats structure defines stats to be calculated and how 89 psVector* in, ///< Vector to be analysed: must be F32 90 psVector* mask, ///< Ignore elements where (maskVector & maskVal) != 0: must be INT or NULL 91 unsigned int maskVal ///< Only mask elements with one of these bits set in maskVector 99 92 ); 100 93
Note:
See TracChangeset
for help on using the changeset viewer.
