casacore
Loading...
Searching...
No Matches
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: casa-feedback@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#ifndef SCIMATH_STATISTICSTYPES_H
26#define SCIMATH_STATISTICSTYPES_H
27
28#include <casacore/casa/aips.h>
29
30#include <utility>
31#include <vector>
32#include <memory>
33
34
35// because the template signature has become unwieldy
36#define CASA_STATD template < \
37 class AccumType, class DataIterator, class MaskIterator, \
38 class WeightsIterator \
39>
40#define CASA_STATP AccumType, DataIterator, MaskIterator, WeightsIterator
41#define CASA_STATQ DataIterator, MaskIterator, WeightsIterator
42
43namespace casacore {
44
45class Record;
46
47// Commonly used types in statistics framework.
48#define DataArray std::vector<AccumType>
49#define DataRanges std::vector<std::pair<AccumType, AccumType>>
50#define IncludeLimits std::vector<std::pair<AccumType, AccumType>>
51
52using BinCountArray = std::vector<uInt64>;
53using LocationType = std::pair<Int64, Int64>;
54
55template <class AccumType> struct StatsData {
57 std::shared_ptr<AccumType> max;
59 AccumType mean;
60 std::shared_ptr<AccumType> median;
61 std::shared_ptr<AccumType> medAbsDevMed;
62 std::shared_ptr<AccumType> min;
65 AccumType nvariance;
66 AccumType rms;
67 AccumType stddev;
68 AccumType sum;
69 AccumType sumsq;
70 AccumType sumweights;
71 AccumType variance;
73};
74
75template <class AccumType>
77
78template <class AccumType>
80
81template <class AccumType>
83
84}
85
86#ifndef CASACORE_NO_AUTO_TEMPLATES
87#include <casacore/scimath/StatsFramework/StatisticsTypes.tcc>
88#endif //# CASACORE_NO_AUTO_TEMPLATES
89
90#endif
this file contains all the compiler specific defines
Definition mainpage.dox:28
StatsData< AccumType > copy(const StatsData< AccumType > &stats)
StatsData< AccumType > initializeStatsData()
Record toRecord(const StatsData< AccumType > &stats)
std::vector< uInt64 > BinCountArray
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
double Double
Definition aipstype.h:53
std::pair< Int64, Int64 > LocationType
std::shared_ptr< AccumType > max
std::shared_ptr< AccumType > median
std::shared_ptr< AccumType > min
std::shared_ptr< AccumType > medAbsDevMed