Changeset 1928
- Timestamp:
- Sep 29, 2004, 9:52:53 AM (22 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 2 edited
-
dataManip/psStats.c (modified) (5 diffs)
-
math/psStats.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/dataManip/psStats.c
r1921 r1928 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.6 2$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-09-2 8 23:27:37$11 * @version $Revision: 1.63 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-09-29 19:52:53 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 1780 1780 tmp = psVectorAlloc(in->n, PS_TYPE_F32); 1781 1781 for (i = 0; i < in->n; i++) { 1782 tmp->data.F32[i] = (float)in->data.S 32[i];1782 tmp->data.F32[i] = (float)in->data.S8[i]; 1783 1783 } 1784 1784 } else if (in->type.type == PS_TYPE_U16) { 1785 1785 tmp = psVectorAlloc(in->n, PS_TYPE_F32); 1786 1786 for (i = 0; i < in->n; i++) { 1787 tmp->data.F32[i] = (float)in->data.U 32[i];1787 tmp->data.F32[i] = (float)in->data.U16[i]; 1788 1788 } 1789 1789 } else if (in->type.type == PS_TYPE_F64) { … … 1851 1851 // ************************************************************************ 1852 1852 if (stats->options & PS_STAT_SAMPLE_MEAN) { 1853 p_psVectorSampleMean(in , mask, maskVal, stats);1853 p_psVectorSampleMean(inF32, mask, maskVal, stats); 1854 1854 } 1855 1855 // ************************************************************************ 1856 1856 if (stats->options & PS_STAT_SAMPLE_MEDIAN) { 1857 p_psVectorSampleMedian(in , mask, maskVal, stats);1857 p_psVectorSampleMedian(inF32, mask, maskVal, stats); 1858 1858 } 1859 1859 // ************************************************************************ … … 1861 1861 // mean has already been calculated? Or should we always calculate it? 1862 1862 if (stats->options & PS_STAT_SAMPLE_STDEV) { 1863 p_psVectorSampleMean(in , mask, maskVal, stats);1864 p_psVectorSampleStdev(in , mask, maskVal, stats);1863 p_psVectorSampleMean(inF32, mask, maskVal, stats); 1864 p_psVectorSampleStdev(inF32, mask, maskVal, stats); 1865 1865 } 1866 1866 // ************************************************************************ 1867 1867 if (stats->options & PS_STAT_SAMPLE_QUARTILE) { 1868 p_psVectorSampleQuartiles(in , mask, maskVal, stats);1868 p_psVectorSampleQuartiles(inF32, mask, maskVal, stats); 1869 1869 } 1870 1870 // Since the various robust stats quantities share much computation, they … … 1875 1875 (stats->options & PS_STAT_ROBUST_MODE) || 1876 1876 (stats->options & PS_STAT_ROBUST_STDEV) || (stats->options & PS_STAT_ROBUST_QUARTILE)) { 1877 p_psVectorRobustStats(in , mask, maskVal, stats);1877 p_psVectorRobustStats(inF32, mask, maskVal, stats); 1878 1878 } 1879 1879 1880 1880 if ((stats->options & PS_STAT_CLIPPED_MEAN) || (stats->options & PS_STAT_CLIPPED_STDEV)) { 1881 p_psVectorClippedStats(in , mask, maskVal, stats);1881 p_psVectorClippedStats(inF32, mask, maskVal, stats); 1882 1882 } 1883 1883 // ************************************************************************ 1884 1884 if (stats->options & PS_STAT_MAX) { 1885 p_psVectorMax(in , mask, maskVal, stats);1885 p_psVectorMax(inF32, mask, maskVal, stats); 1886 1886 } 1887 1887 // ************************************************************************ 1888 1888 if (stats->options & PS_STAT_MIN) { 1889 p_psVectorMin(in , mask, maskVal, stats);1889 p_psVectorMin(inF32, mask, maskVal, stats); 1890 1890 } 1891 1891 -
trunk/psLib/src/math/psStats.c
r1921 r1928 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.6 2$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-09-2 8 23:27:37$11 * @version $Revision: 1.63 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-09-29 19:52:53 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 1780 1780 tmp = psVectorAlloc(in->n, PS_TYPE_F32); 1781 1781 for (i = 0; i < in->n; i++) { 1782 tmp->data.F32[i] = (float)in->data.S 32[i];1782 tmp->data.F32[i] = (float)in->data.S8[i]; 1783 1783 } 1784 1784 } else if (in->type.type == PS_TYPE_U16) { 1785 1785 tmp = psVectorAlloc(in->n, PS_TYPE_F32); 1786 1786 for (i = 0; i < in->n; i++) { 1787 tmp->data.F32[i] = (float)in->data.U 32[i];1787 tmp->data.F32[i] = (float)in->data.U16[i]; 1788 1788 } 1789 1789 } else if (in->type.type == PS_TYPE_F64) { … … 1851 1851 // ************************************************************************ 1852 1852 if (stats->options & PS_STAT_SAMPLE_MEAN) { 1853 p_psVectorSampleMean(in , mask, maskVal, stats);1853 p_psVectorSampleMean(inF32, mask, maskVal, stats); 1854 1854 } 1855 1855 // ************************************************************************ 1856 1856 if (stats->options & PS_STAT_SAMPLE_MEDIAN) { 1857 p_psVectorSampleMedian(in , mask, maskVal, stats);1857 p_psVectorSampleMedian(inF32, mask, maskVal, stats); 1858 1858 } 1859 1859 // ************************************************************************ … … 1861 1861 // mean has already been calculated? Or should we always calculate it? 1862 1862 if (stats->options & PS_STAT_SAMPLE_STDEV) { 1863 p_psVectorSampleMean(in , mask, maskVal, stats);1864 p_psVectorSampleStdev(in , mask, maskVal, stats);1863 p_psVectorSampleMean(inF32, mask, maskVal, stats); 1864 p_psVectorSampleStdev(inF32, mask, maskVal, stats); 1865 1865 } 1866 1866 // ************************************************************************ 1867 1867 if (stats->options & PS_STAT_SAMPLE_QUARTILE) { 1868 p_psVectorSampleQuartiles(in , mask, maskVal, stats);1868 p_psVectorSampleQuartiles(inF32, mask, maskVal, stats); 1869 1869 } 1870 1870 // Since the various robust stats quantities share much computation, they … … 1875 1875 (stats->options & PS_STAT_ROBUST_MODE) || 1876 1876 (stats->options & PS_STAT_ROBUST_STDEV) || (stats->options & PS_STAT_ROBUST_QUARTILE)) { 1877 p_psVectorRobustStats(in , mask, maskVal, stats);1877 p_psVectorRobustStats(inF32, mask, maskVal, stats); 1878 1878 } 1879 1879 1880 1880 if ((stats->options & PS_STAT_CLIPPED_MEAN) || (stats->options & PS_STAT_CLIPPED_STDEV)) { 1881 p_psVectorClippedStats(in , mask, maskVal, stats);1881 p_psVectorClippedStats(inF32, mask, maskVal, stats); 1882 1882 } 1883 1883 // ************************************************************************ 1884 1884 if (stats->options & PS_STAT_MAX) { 1885 p_psVectorMax(in , mask, maskVal, stats);1885 p_psVectorMax(inF32, mask, maskVal, stats); 1886 1886 } 1887 1887 // ************************************************************************ 1888 1888 if (stats->options & PS_STAT_MIN) { 1889 p_psVectorMin(in , mask, maskVal, stats);1889 p_psVectorMin(inF32, mask, maskVal, stats); 1890 1890 } 1891 1891
Note:
See TracChangeset
for help on using the changeset viewer.
