00001 //# Copyright (C) 2000,2001 00002 //# Associated Universities, Inc. Washington DC, USA. 00003 //# 00004 //# This library is free software; you can redistribute it and/or modify it 00005 //# under the terms of the GNU Library General Public License as published by 00006 //# the Free Software Foundation; either version 2 of the License, or (at your 00007 //# option) any later version. 00008 //# 00009 //# This library is distributed in the hope that it will be useful, but WITHOUT 00010 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00011 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00012 //# License for more details. 00013 //# 00014 //# You should have received a copy of the GNU Library General Public License 00015 //# along with this library; if not, write to the Free Software Foundation, 00016 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. 00017 //# 00018 //# Correspondence concerning AIPS++ should be addressed as follows: 00019 //# Internet email: aips2-request@nrao.edu. 00020 //# Postal address: AIPS++ Project Office 00021 //# National Radio Astronomy Observatory 00022 //# 520 Edgemont Road 00023 //# Charlottesville, VA 22903-2475 USA 00024 //# 00025 //# $Id: Array.h 21545 2015-01-22 19:36:35Z gervandiepen $ 00026 00027 #ifndef SCIMATH_STATISTICSTYPES_H 00028 #define SCIMATH_STATISTICSTYPES_H 00029 00030 #include <casacore/casa/aips.h> 00031 00032 #include <utility> 00033 #include <vector> 00034 00035 namespace casacore { 00036 00037 class Record; 00038 template <class T> class CountedPtr; 00039 00040 // Commonly used types in statistics framework. 00041 00042 #define DataRanges std::vector<std::pair<AccumType, AccumType> > 00043 00044 typedef std::pair<Int64, Int64> LocationType; 00045 00046 template <class AccumType> struct StatsData { 00047 Bool masked; 00048 CountedPtr<AccumType> max; 00049 LocationType maxpos; 00050 AccumType mean; 00051 CountedPtr<AccumType> median; 00052 CountedPtr<AccumType> medAbsDevMed; 00053 CountedPtr<AccumType> min; 00054 LocationType minpos; 00055 Double npts; 00056 AccumType nvariance; 00057 AccumType rms; 00058 AccumType stddev; 00059 AccumType sum; 00060 AccumType sumsq; 00061 AccumType sumweights; 00062 AccumType variance; 00063 Bool weighted; 00064 }; 00065 00066 template <class AccumType> 00067 StatsData<AccumType> initializeStatsData(); 00068 00069 template <class AccumType> 00070 StatsData<AccumType> copy(const StatsData<AccumType>& stats); 00071 00072 template <class AccumType> 00073 Record toRecord(const StatsData<AccumType>& stats); 00074 00075 } 00076 00077 #ifndef CASACORE_NO_AUTO_TEMPLATES 00078 #include <casacore/scimath/Mathematics/StatisticsTypes.tcc> 00079 #endif //# CASACORE_NO_AUTO_TEMPLATES 00080 00081 #endif