casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StatisticsTypes.h
Go to the documentation of this file.
1 //# Copyright (C) 2000,2001
2 //# Associated Universities, Inc. Washington DC, USA.
3 //#
4 //# This library is free software; you can redistribute it and/or modify it
5 //# under the terms of the GNU Library General Public License as published by
6 //# the Free Software Foundation; either version 2 of the License, or (at your
7 //# option) any later version.
8 //#
9 //# This library is distributed in the hope that it will be useful, but WITHOUT
10 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 //# License for more details.
13 //#
14 //# You should have received a copy of the GNU Library General Public License
15 //# along with this library; if not, write to the Free Software Foundation,
16 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
17 //#
18 //# Correspondence concerning AIPS++ should be addressed as follows:
19 //# Internet email: aips2-request@nrao.edu.
20 //# Postal address: AIPS++ Project Office
21 //# National Radio Astronomy Observatory
22 //# 520 Edgemont Road
23 //# Charlottesville, VA 22903-2475 USA
24 //#
25 //# $Id: Array.h 21545 2015-01-22 19:36:35Z gervandiepen $
26 
27 #ifndef SCIMATH_STATISTICSTYPES_H
28 #define SCIMATH_STATISTICSTYPES_H
29 
30 #include <casacore/casa/aips.h>
31 
32 #include <utility>
33 #include <vector>
34 
35 
36 // because the template signature has become unwieldy
37 #define CASA_STATD template < \
38  class AccumType, class DataIterator, class MaskIterator, \
39  class WeightsIterator \
40 >
41 #define CASA_STATP AccumType, DataIterator, MaskIterator, WeightsIterator
42 #define CASA_STATQ DataIterator, MaskIterator, WeightsIterator
43 
44 namespace casacore {
45 
46 class Record;
47 template <class T> class CountedPtr;
48 
49 // Commonly used types in statistics framework.
50 #define DataArray std::vector<AccumType>
51 #define DataRanges std::vector<std::pair<AccumType, AccumType>>
52 #define IncludeLimits std::vector<std::pair<AccumType, AccumType>>
53 
54 using BinCountArray = std::vector<uInt64>;
55 using LocationType = std::pair<Int64, Int64>;
56 
57 template <class AccumType> struct StatsData {
61  AccumType mean;
67  AccumType nvariance;
68  AccumType rms;
69  AccumType stddev;
70  AccumType sum;
71  AccumType sumsq;
72  AccumType sumweights;
73  AccumType variance;
75 };
76 
77 template <class AccumType>
79 
80 template <class AccumType>
82 
83 template <class AccumType>
85 
86 }
87 
88 #ifndef CASACORE_NO_AUTO_TEMPLATES
89 #include <casacore/scimath/StatsFramework/StatisticsTypes.tcc>
90 #endif //# CASACORE_NO_AUTO_TEMPLATES
91 
92 #endif
Record toRecord(const StatsData< AccumType > &stats)
StatsData< AccumType > copy(const StatsData< AccumType > &stats)
CountedPtr< AccumType > median
CountedPtr< AccumType > max
std::pair< Int64, Int64 > LocationType
double Double
Definition: aipstype.h:55
A hierarchical collection of named fields of various types.
Definition: Record.h:180
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
StatsData< AccumType > initializeStatsData()
std::vector< uInt64 > BinCountArray
CountedPtr< AccumType > min
CountedPtr< AccumType > medAbsDevMed
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42