casacore
Loading...
Searching...
No Matches
StatisticsIncrementer.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_STATISTICSINCREMENTER_H
26#define SCIMATH_STATISTICSINCREMENTER_H
27
28#include <casacore/casa/aips.h>
29
30namespace casacore {
31
32// Utility functions used for incrementing pointers in a data set used by the
33// stats framework.
34
35template <class DataIterator, class MaskIterator = const Bool*,
36 class WeightsIterator = DataIterator>
38 public:
40
42
43 //<group>
44 // <src>loopCount</src> is always incremented by one, independent of the
45 // value of <src>dataStride</src> and <src>maskStride</src>
46
47 inline static void increment(DataIterator& datum, uInt64& loopCount, uInt dataStride) {
48 std::advance(datum, dataStride);
49 ++loopCount;
50 }
51
52 inline static void increment(DataIterator& datum, uInt64& loopCount, WeightsIterator& weight,
53 uInt dataStride) {
54 std::advance(datum, dataStride);
55 std::advance(weight, dataStride);
56 ++loopCount;
57 }
58
59 inline static void increment(DataIterator& datum, uInt64& loopCount, MaskIterator& mask,
60 uInt dataStride, uInt maskStride) {
61 std::advance(datum, dataStride);
62 std::advance(mask, maskStride);
63 ++loopCount;
64 }
65
66 inline static void increment(DataIterator& datum, uInt64& loopCount, WeightsIterator& weight,
67 MaskIterator& mask, uInt dataStride, uInt maskStride) {
68 std::advance(datum, dataStride);
69 std::advance(weight, dataStride);
70 std::advance(mask, maskStride);
71 ++loopCount;
72 }
73 // </group>
74};
75
76} // namespace casacore
77
78#endif
static void increment(DataIterator &datum, uInt64 &loopCount, WeightsIterator &weight, MaskIterator &mask, uInt dataStride, uInt maskStride)
static void increment(DataIterator &datum, uInt64 &loopCount, uInt dataStride)
loopCount is always incremented by one, independent of the value of dataStride and maskStride
static void increment(DataIterator &datum, uInt64 &loopCount, WeightsIterator &weight, uInt dataStride)
static void increment(DataIterator &datum, uInt64 &loopCount, MaskIterator &mask, uInt dataStride, uInt maskStride)
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
unsigned long long uInt64
Definition aipsxtype.h:37