Changeset 1963 for trunk/psLib/src/math/psStats.c
- Timestamp:
- Oct 5, 2004, 12:47:21 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psStats.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psStats.c
r1928 r1963 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.6 3$ $Name: not supported by cvs2svn $12 * @date $Date: 2004- 09-29 19:52:53$11 * @version $Revision: 1.64 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-10-05 22:47:21 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 836 836 837 837 /***************************************************************************** 838 p_psNormalizeVector (myData): this is a private function which normalizes the838 p_psNormalizeVectorF32(myData): this is a private function which normalizes the 839 839 elements of a vector to a range between 0.0 and 1.0. 840 840 *****************************************************************************/ 841 void p_psNormalizeVector (psVector* myData)841 void p_psNormalizeVectorF32(psVector* myData) 842 842 { 843 843 float min = (float)HUGE; … … 867 867 p_psNormalizeVectorF64(myData): this is a private function which normalizes the 868 868 elements of a vector to a range between -1.0 and 1.0. 869 870 XXX: incorporate this into above871 872 869 XXX: 0-1 or -1:1? 873 870 *****************************************************************************/ 874 871 void p_psNormalizeVectorF64(psVector* myData) 875 872 { 876 float min = ( float)HUGE;877 float max = ( float)-HUGE;878 floatrange = 0.0;873 float min = (double)HUGE; 874 float max = (double)-HUGE; 875 double range = 0.0; 879 876 int i = 0; 880 877 … … 892 889 myData->data.F64[i] = -1.0 + 2.0 * 893 890 ((myData->data.F64[i] - min) / range); 891 } 892 893 // for (i = 0; i < myData->n; i++) { 894 // myData->data.F64[i] = (myData->data.F64[i] - 0.5 * (min + max)) / 895 // (0.5 * (max - min)); 896 // } 897 } 898 899 void p_psNormalizeVector(psVector* myData) 900 { 901 if (myData->type.type == PS_TYPE_F32) { 902 p_psNormalizeVectorF32(myData); 903 } else if (myData->type.type == PS_TYPE_F64) { 904 p_psNormalizeVectorF64(myData); 905 } else { 906 psError(__func__, "Unalowable data type.\n"); 894 907 } 895 908 } … … 1191 1204 // The following was necessary to fit a gaussian to the data, since 1192 1205 // gaussian functions produce data between 0.0 and 1.0. 1193 // p_psNormalizeVector (robustHistogramVector);1206 // p_psNormalizeVectorF32(robustHistogramVector); 1194 1207 1195 1208 /**************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.
